From 281a7fcec924094957df70dcf9df6fb0466d7dc9 Mon Sep 17 00:00:00 2001 From: xxx Date: Mon, 21 Aug 2023 21:23:11 +0800 Subject: [PATCH 1/2] no message Match-id-d6a3208ee097cb055896df32a473baa66e885057 --- BUILD.gn | 47 - LICENSE | 177 -- README_zh.md | 47 - bundle.json | 106 - config/BUILD.gn | 23 - test/dts/README_zh.md => docs/Readme-CN.md | 41 +- .../figures/zh-cn_image_0000001593518280.png | Bin 0 -> 64148 bytes .../figures/zh-cn_image_0000001593677984.png | Bin 0 -> 26150 bytes .../figures/zh-cn_image_0000001643038221.png | Bin 0 -> 26031 bytes .../figures/zh-cn_image_0000001643320073.png | Bin 0 -> 24287 bytes .../ts-basic-components-seclocationbutton.md | 137 ++ .../ts-basic-components-secpastebutton.md | 96 + .../ts-basic-components-secsavebutton.md | 104 + ...-universal-attributes-securitycomponent.md | 76 + .../figures/zh-cn_image_0000001566651300.png | Bin 0 -> 72286 bytes .../security-components-guidelines.md | 128 ++ docs/security/security-components-overview.md | 63 + frameworks/BUILD.gn | 94 - frameworks/common/include/sec_comp_err.h | 54 - frameworks/common/include/sec_comp_log.h | 62 - frameworks/common/include/sec_comp_tool.h | 28 - frameworks/common/src/sec_comp_tool.cpp | 142 -- .../include/sec_comp_enhance_adapter.h | 122 -- .../src/sec_comp_enhance_adapter.cpp | 235 -- .../include/sec_comp_click_event_parcel.h | 38 - .../src/location_button.cpp | 53 - .../security_component/src/paste_button.cpp | 53 - .../security_component/src/save_button.cpp | 53 - .../security_component/src/sec_comp_base.cpp | 369 ---- .../src/sec_comp_click_event_parcel.cpp | 102 - hisysevent.yaml | 94 - interfaces/inner_api/enhance_kits/BUILD.gn | 57 - .../include/sec_comp_enhance_kit.h | 32 - .../include/sec_comp_enhance_kit_c.h | 21 - .../enhance_kits/src/sec_comp_enhance_kit.cpp | 45 - .../inner_api/enhance_kits/test/BUILD.gn | 48 - .../unittest/src/sec_comp_enhance_test.cpp | 135 -- .../test/unittest/src/sec_comp_enhance_test.h | 38 - .../inner_api/security_component/BUILD.gn | 67 - .../include/i_sec_comp_probe.h | 30 - .../include/i_sec_comp_service.h | 45 - .../include/location_button.h | 57 - .../security_component/include/paste_button.h | 46 - .../security_component/include/save_button.h | 54 - .../include/sec_comp_base.h | 139 -- .../include/sec_comp_caller_authorization.h | 43 - .../include/sec_comp_client.h | 68 - .../include/sec_comp_death_recipient.h | 32 - .../include/sec_comp_info.h | 130 -- .../security_component/include/sec_comp_kit.h | 40 - .../include/sec_comp_load_callback.h | 33 - .../include/sec_comp_proxy.h | 43 - .../include/sec_comp_ui_register.h | 33 - ...ity_component_service_ipc_interface_code.h | 43 - .../src/sec_comp_caller_authorization.cpp | 67 - .../src/sec_comp_client.cpp | 258 --- .../src/sec_comp_death_recipient.cpp | 28 - .../security_component/src/sec_comp_kit.cpp | 138 -- .../src/sec_comp_load_callback.cpp | 61 - .../security_component/src/sec_comp_proxy.cpp | 274 --- .../src/sec_comp_ui_register.cpp | 39 - .../security_component/test/BUILD.gn | 191 -- .../src/location_button_sample_build.cpp | 78 - .../src/location_button_sample_build.h | 31 - .../unittest/src/location_button_test.cpp | 607 ------ .../test/unittest/src/location_button_test.h | 38 - .../test/unittest/src/paste_button_test.cpp | 254 --- .../test/unittest/src/paste_button_test.h | 38 - .../test/unittest/src/save_button_test.cpp | 253 --- .../test/unittest/src/save_button_test.h | 38 - .../test/unittest/src/sec_comp_kit_test.cpp | 177 -- .../test/unittest/src/sec_comp_kit_test.h | 37 - .../src/sec_comp_register_callback_test.cpp | 153 -- .../src/sec_comp_register_challenge_test.cpp | 111 - ...ec_comp_register_without_callback_test.cpp | 112 - ...ec_comp_report_click_without_hmac_test.cpp | 116 - security_component.gni | 14 - .../security_component_service/sa/BUILD.gn | 91 - .../sa/sa_main/app_mgr_death_recipient.cpp | 28 - .../sa/sa_main/app_mgr_death_recipient.h | 33 - .../sa/sa_main/app_state_observer.cpp | 129 -- .../sa/sa_main/app_state_observer.h | 57 - .../sa/sa_main/delay_exit_task.cpp | 72 - .../sa/sa_main/delay_exit_task.h | 44 - .../sa/sa_main/first_use_dialog.cpp | 297 --- .../sa/sa_main/first_use_dialog.h | 64 - .../sa/sa_main/sec_comp_entity.cpp | 84 - .../sa/sa_main/sec_comp_entity.h | 80 - .../sa/sa_main/sec_comp_info_helper.cpp | 272 --- .../sa/sa_main/sec_comp_info_helper.h | 51 - .../sa/sa_main/sec_comp_manager.cpp | 519 ----- .../sa/sa_main/sec_comp_manager.h | 101 - .../sa/sa_main/sec_comp_perm_manager.cpp | 130 -- .../sa/sa_main/sec_comp_perm_manager.h | 57 - .../sa/sa_main/sec_comp_service.cpp | 284 --- .../sa/sa_main/sec_comp_service.h | 65 - .../sa/sa_main/sec_comp_stub.cpp | 223 -- .../sa/sa_main/sec_comp_stub.h | 47 - .../sa/sa_main/sec_event_handler.cpp | 40 - .../sa/sa_main/sec_event_handler.h | 37 - .../sa/sa_profile/3506.json | 12 - .../sa/sa_profile/BUILD.gn | 19 - .../sa/security_component_service.cfg | 24 - .../sa/security_component_service.rc | 19 - .../sa/test/BUILD.gn | 145 -- .../sa/test/mock/include/access_token.h | 57 - .../sa/test/mock/include/accesstoken_kit.h | 53 - .../sa/test/mock/include/app_mgr_interface.h | 38 - .../include/application_state_observer_stub.h | 73 - .../mock/include/if_system_ability_manager.h | 51 - .../sa/test/mock/include/ipc_mock_skeleton.h | 38 - .../sa/test/mock/include/iservice_registry.h | 33 - .../sa/test/mock/include/mock_app_mgr_proxy.h | 37 - .../mock/include/mock_system_ability_proxy.h | 32 - .../mock/include/sec_comp_enhance_adapter.h | 36 - .../sa/test/mock/include/system_ability.h | 47 - .../sa/test/mock/src/mock_app_mgr_proxy.cpp | 20 - .../sa/test/mock/src/mock_ipc_skeleton.cpp | 20 - .../test/mock/src/mock_iservice_registry.cpp | 34 - .../mock/src/sec_comp_enhance_adapter.cpp | 109 - .../unittest/src/app_state_observer_test.cpp | 182 -- .../unittest/src/app_state_observer_test.h | 41 - .../unittest/src/sec_comp_entity_test.cpp | 157 -- .../test/unittest/src/sec_comp_entity_test.h | 42 - .../src/sec_comp_info_helper_test.cpp | 713 ------ .../unittest/src/sec_comp_info_helper_test.h | 37 - .../unittest/src/sec_comp_manager_test.cpp | 361 --- .../test/unittest/src/sec_comp_manager_test.h | 39 - .../src/sec_comp_service_mock_test.cpp | 365 ---- .../unittest/src/sec_comp_service_test.cpp | 307 --- .../test/unittest/src/sec_comp_service_test.h | 42 - .../test/unittest/src/sec_comp_stub_test.cpp | 177 -- .../sa/test/unittest/src/sec_comp_stub_test.h | 79 - test/dts/location_button.d.ts | 263 --- test/dts/paste_button.d.ts | 175 -- test/dts/save_button.d.ts | 239 -- test/dts/security_component.d.ts | 242 --- test/fuzztest/security_component/BUILD.gn | 34 - .../BUILD.gn | 49 - .../corpus/init | 14 - .../getenhanceremoteobjectInner_fuzzer.cpp | 49 - .../getenhanceremoteobjectInner_fuzzer.h | 24 - .../project.xml | 25 - .../getenhanceremoteobject_fuzzer/BUILD.gn | 48 - .../getenhanceremoteobject_fuzzer/corpus/init | 14 - .../getenhanceremoteobject_fuzzer.cpp | 41 - .../getenhanceremoteobject_fuzzer.h | 23 - .../getenhanceremoteobject_fuzzer/project.xml | 25 - .../BUILD.gn | 48 - .../corpus/init | 14 - .../getpointereventenhancedata_fuzzer.cpp | 43 - .../getpointereventenhancedata_fuzzer.h | 23 - .../project.xml | 25 - .../BUILD.gn | 49 - .../corpus/init | 14 - .../project.xml | 25 - ...eafterverifysavepermissionInner_fuzzer.cpp | 48 - ...uceafterverifysavepermissionInner_fuzzer.h | 24 - .../BUILD.gn | 48 - .../corpus/init | 14 - .../project.xml | 25 - ...reduceafterverifysavepermission_fuzzer.cpp | 40 - .../reduceafterverifysavepermission_fuzzer.h | 23 - .../BUILD.gn | 49 - .../corpus/init | 14 - .../project.xml | 25 - .../registersecuritycomponentInner_fuzzer.cpp | 51 - .../registersecuritycomponentInner_fuzzer.h | 21 - .../registersecuritycomponent_fuzzer/BUILD.gn | 50 - .../corpus/init | 14 - .../project.xml | 25 - .../registersecuritycomponent_fuzzer.cpp | 43 - .../registersecuritycomponent_fuzzer.h | 21 - .../BUILD.gn | 49 - .../corpus/init | 14 - .../project.xml | 25 - ...ecuritycomponentclickeventInner_fuzzer.cpp | 49 - ...tsecuritycomponentclickeventInner_fuzzer.h | 21 - .../BUILD.gn | 50 - .../corpus/init | 14 - .../project.xml | 25 - ...portsecuritycomponentclickevent_fuzzer.cpp | 51 - ...reportsecuritycomponentclickevent_fuzzer.h | 23 - .../setenhancecfg_fuzzer/BUILD.gn | 49 - .../setenhancecfg_fuzzer/corpus/init | 14 - .../setenhancecfg_fuzzer/project.xml | 25 - .../setenhancecfg_fuzzer.cpp | 41 - .../setenhancecfg_fuzzer.h | 21 - .../BUILD.gn | 49 - .../corpus/init | 14 - .../project.xml | 25 - ...nregistersecuritycomponentInner_fuzzer.cpp | 49 - .../unregistersecuritycomponentInner_fuzzer.h | 21 - .../BUILD.gn | 48 - .../corpus/init | 14 - .../project.xml | 25 - .../unregistersecuritycomponent_fuzzer.cpp | 40 - .../unregistersecuritycomponent_fuzzer.h | 21 - .../BUILD.gn | 49 - .../corpus/init | 14 - .../project.xml | 25 - .../updatesecuritycomponentInner_fuzzer.cpp | 49 - .../updatesecuritycomponentInner_fuzzer.h | 21 - .../updatesecuritycomponent_fuzzer/BUILD.gn | 52 - .../corpus/init | 14 - .../project.xml | 25 - .../updatesecuritycomponent_fuzzer.cpp | 41 - .../updatesecuritycomponent_fuzzer.h | 21 - test/security_component/AppScope/app.json | 21 - .../resources/base/element/string.json | 8 - .../resources/base/media/app_icon.png | Bin 6790 -> 0 bytes test/security_component/BUILD.gn | 41 - test/security_component/Test.json | 20 - .../src/main/ets/Application/AbilityStage.ts | 9 - .../src/main/ets/MainAbility/MainAbility.ts | 37 - .../ets/MainAbility/pages/index/index.ets | 56 - .../ets/MainAbility/pages/locationButton.ets | 241 --- .../MainAbility/pages/locationButton_1.ets | 432 ---- .../ets/MainAbility/pages/pasteButton.ets | 241 --- .../main/ets/MainAbility/pages/saveButton.ets | 241 --- .../ets/MainAbility/pages/saveButton_1.ets | 320 --- .../src/main/ets/TestAbility/TestAbility.ts | 50 - .../src/main/ets/TestAbility/pages/index.ets | 48 - .../ets/TestRunner/OpenHarmonyTestRunner.ts | 79 - .../entry/src/main/ets/test/List.test.ets | 28 - .../ets/test/LocationComponentTest.test.ets | 1927 ----------------- .../ets/test/LocationComponentTest_1.test.ets | 490 ----- .../main/ets/test/PasteComponentTest.test.ets | 1923 ---------------- .../main/ets/test/SaveComponentTest.test.ets | 1926 ---------------- .../ets/test/SaveComponentTest_1.test.ets | 358 --- .../entry/src/main/ets/test/Utils.ets | 118 - .../entry/src/main/module.json | 46 - .../main/resources/base/element/color.json | 12 - .../main/resources/base/element/float.json | 12 - .../main/resources/base/element/string.json | 60 - .../src/main/resources/base/media/icon.png | Bin 6790 -> 0 bytes .../resources/base/profile/main_pages.json | 10 - .../signature/openharmony_sx.p7b | Bin 3431 -> 0 bytes 238 files changed, 629 insertions(+), 24434 deletions(-) delete mode 100644 BUILD.gn delete mode 100644 LICENSE delete mode 100644 README_zh.md delete mode 100644 bundle.json delete mode 100644 config/BUILD.gn rename test/dts/README_zh.md => docs/Readme-CN.md (55%) create mode 100644 docs/arkui-ts/figures/zh-cn_image_0000001593518280.png create mode 100644 docs/arkui-ts/figures/zh-cn_image_0000001593677984.png create mode 100644 docs/arkui-ts/figures/zh-cn_image_0000001643038221.png create mode 100644 docs/arkui-ts/figures/zh-cn_image_0000001643320073.png create mode 100644 docs/arkui-ts/ts-basic-components-seclocationbutton.md create mode 100644 docs/arkui-ts/ts-basic-components-secpastebutton.md create mode 100644 docs/arkui-ts/ts-basic-components-secsavebutton.md create mode 100644 docs/arkui-ts/ts-universal-attributes-securitycomponent.md create mode 100644 docs/security/figures/zh-cn_image_0000001566651300.png create mode 100644 docs/security/security-components-guidelines.md create mode 100644 docs/security/security-components-overview.md delete mode 100644 frameworks/BUILD.gn delete mode 100644 frameworks/common/include/sec_comp_err.h delete mode 100644 frameworks/common/include/sec_comp_log.h delete mode 100644 frameworks/common/include/sec_comp_tool.h delete mode 100644 frameworks/common/src/sec_comp_tool.cpp delete mode 100644 frameworks/enhance_adapter/include/sec_comp_enhance_adapter.h delete mode 100644 frameworks/enhance_adapter/src/sec_comp_enhance_adapter.cpp delete mode 100644 frameworks/security_component/include/sec_comp_click_event_parcel.h delete mode 100644 frameworks/security_component/src/location_button.cpp delete mode 100644 frameworks/security_component/src/paste_button.cpp delete mode 100644 frameworks/security_component/src/save_button.cpp delete mode 100644 frameworks/security_component/src/sec_comp_base.cpp delete mode 100644 frameworks/security_component/src/sec_comp_click_event_parcel.cpp delete mode 100644 hisysevent.yaml delete mode 100644 interfaces/inner_api/enhance_kits/BUILD.gn delete mode 100644 interfaces/inner_api/enhance_kits/include/sec_comp_enhance_kit.h delete mode 100644 interfaces/inner_api/enhance_kits/include/sec_comp_enhance_kit_c.h delete mode 100644 interfaces/inner_api/enhance_kits/src/sec_comp_enhance_kit.cpp delete mode 100644 interfaces/inner_api/enhance_kits/test/BUILD.gn delete mode 100644 interfaces/inner_api/enhance_kits/test/unittest/src/sec_comp_enhance_test.cpp delete mode 100644 interfaces/inner_api/enhance_kits/test/unittest/src/sec_comp_enhance_test.h delete mode 100644 interfaces/inner_api/security_component/BUILD.gn delete mode 100644 interfaces/inner_api/security_component/include/i_sec_comp_probe.h delete mode 100644 interfaces/inner_api/security_component/include/i_sec_comp_service.h delete mode 100644 interfaces/inner_api/security_component/include/location_button.h delete mode 100644 interfaces/inner_api/security_component/include/paste_button.h delete mode 100644 interfaces/inner_api/security_component/include/save_button.h delete mode 100644 interfaces/inner_api/security_component/include/sec_comp_base.h delete mode 100644 interfaces/inner_api/security_component/include/sec_comp_caller_authorization.h delete mode 100644 interfaces/inner_api/security_component/include/sec_comp_client.h delete mode 100644 interfaces/inner_api/security_component/include/sec_comp_death_recipient.h delete mode 100644 interfaces/inner_api/security_component/include/sec_comp_info.h delete mode 100644 interfaces/inner_api/security_component/include/sec_comp_kit.h delete mode 100644 interfaces/inner_api/security_component/include/sec_comp_load_callback.h delete mode 100644 interfaces/inner_api/security_component/include/sec_comp_proxy.h delete mode 100644 interfaces/inner_api/security_component/include/sec_comp_ui_register.h delete mode 100644 interfaces/inner_api/security_component/include/security_component_service_ipc_interface_code.h delete mode 100644 interfaces/inner_api/security_component/src/sec_comp_caller_authorization.cpp delete mode 100644 interfaces/inner_api/security_component/src/sec_comp_client.cpp delete mode 100644 interfaces/inner_api/security_component/src/sec_comp_death_recipient.cpp delete mode 100644 interfaces/inner_api/security_component/src/sec_comp_kit.cpp delete mode 100644 interfaces/inner_api/security_component/src/sec_comp_load_callback.cpp delete mode 100644 interfaces/inner_api/security_component/src/sec_comp_proxy.cpp delete mode 100644 interfaces/inner_api/security_component/src/sec_comp_ui_register.cpp delete mode 100644 interfaces/inner_api/security_component/test/BUILD.gn delete mode 100644 interfaces/inner_api/security_component/test/unittest/src/location_button_sample_build.cpp delete mode 100644 interfaces/inner_api/security_component/test/unittest/src/location_button_sample_build.h delete mode 100644 interfaces/inner_api/security_component/test/unittest/src/location_button_test.cpp delete mode 100644 interfaces/inner_api/security_component/test/unittest/src/location_button_test.h delete mode 100644 interfaces/inner_api/security_component/test/unittest/src/paste_button_test.cpp delete mode 100644 interfaces/inner_api/security_component/test/unittest/src/paste_button_test.h delete mode 100644 interfaces/inner_api/security_component/test/unittest/src/save_button_test.cpp delete mode 100644 interfaces/inner_api/security_component/test/unittest/src/save_button_test.h delete mode 100644 interfaces/inner_api/security_component/test/unittest/src/sec_comp_kit_test.cpp delete mode 100644 interfaces/inner_api/security_component/test/unittest/src/sec_comp_kit_test.h delete mode 100644 interfaces/inner_api/security_component/test/unittest/src/sec_comp_register_callback_test.cpp delete mode 100644 interfaces/inner_api/security_component/test/unittest/src/sec_comp_register_challenge_test.cpp delete mode 100644 interfaces/inner_api/security_component/test/unittest/src/sec_comp_register_without_callback_test.cpp delete mode 100644 interfaces/inner_api/security_component/test/unittest/src/sec_comp_report_click_without_hmac_test.cpp delete mode 100644 security_component.gni delete mode 100644 services/security_component_service/sa/BUILD.gn delete mode 100644 services/security_component_service/sa/sa_main/app_mgr_death_recipient.cpp delete mode 100644 services/security_component_service/sa/sa_main/app_mgr_death_recipient.h delete mode 100644 services/security_component_service/sa/sa_main/app_state_observer.cpp delete mode 100644 services/security_component_service/sa/sa_main/app_state_observer.h delete mode 100644 services/security_component_service/sa/sa_main/delay_exit_task.cpp delete mode 100644 services/security_component_service/sa/sa_main/delay_exit_task.h delete mode 100644 services/security_component_service/sa/sa_main/first_use_dialog.cpp delete mode 100644 services/security_component_service/sa/sa_main/first_use_dialog.h delete mode 100644 services/security_component_service/sa/sa_main/sec_comp_entity.cpp delete mode 100644 services/security_component_service/sa/sa_main/sec_comp_entity.h delete mode 100644 services/security_component_service/sa/sa_main/sec_comp_info_helper.cpp delete mode 100644 services/security_component_service/sa/sa_main/sec_comp_info_helper.h delete mode 100644 services/security_component_service/sa/sa_main/sec_comp_manager.cpp delete mode 100644 services/security_component_service/sa/sa_main/sec_comp_manager.h delete mode 100644 services/security_component_service/sa/sa_main/sec_comp_perm_manager.cpp delete mode 100644 services/security_component_service/sa/sa_main/sec_comp_perm_manager.h delete mode 100644 services/security_component_service/sa/sa_main/sec_comp_service.cpp delete mode 100644 services/security_component_service/sa/sa_main/sec_comp_service.h delete mode 100644 services/security_component_service/sa/sa_main/sec_comp_stub.cpp delete mode 100644 services/security_component_service/sa/sa_main/sec_comp_stub.h delete mode 100644 services/security_component_service/sa/sa_main/sec_event_handler.cpp delete mode 100644 services/security_component_service/sa/sa_main/sec_event_handler.h delete mode 100644 services/security_component_service/sa/sa_profile/3506.json delete mode 100644 services/security_component_service/sa/sa_profile/BUILD.gn delete mode 100644 services/security_component_service/sa/security_component_service.cfg delete mode 100644 services/security_component_service/sa/security_component_service.rc delete mode 100644 services/security_component_service/sa/test/BUILD.gn delete mode 100644 services/security_component_service/sa/test/mock/include/access_token.h delete mode 100644 services/security_component_service/sa/test/mock/include/accesstoken_kit.h delete mode 100644 services/security_component_service/sa/test/mock/include/app_mgr_interface.h delete mode 100644 services/security_component_service/sa/test/mock/include/application_state_observer_stub.h delete mode 100644 services/security_component_service/sa/test/mock/include/if_system_ability_manager.h delete mode 100644 services/security_component_service/sa/test/mock/include/ipc_mock_skeleton.h delete mode 100644 services/security_component_service/sa/test/mock/include/iservice_registry.h delete mode 100644 services/security_component_service/sa/test/mock/include/mock_app_mgr_proxy.h delete mode 100644 services/security_component_service/sa/test/mock/include/mock_system_ability_proxy.h delete mode 100644 services/security_component_service/sa/test/mock/include/sec_comp_enhance_adapter.h delete mode 100644 services/security_component_service/sa/test/mock/include/system_ability.h delete mode 100644 services/security_component_service/sa/test/mock/src/mock_app_mgr_proxy.cpp delete mode 100644 services/security_component_service/sa/test/mock/src/mock_ipc_skeleton.cpp delete mode 100644 services/security_component_service/sa/test/mock/src/mock_iservice_registry.cpp delete mode 100644 services/security_component_service/sa/test/mock/src/sec_comp_enhance_adapter.cpp delete mode 100644 services/security_component_service/sa/test/unittest/src/app_state_observer_test.cpp delete mode 100644 services/security_component_service/sa/test/unittest/src/app_state_observer_test.h delete mode 100644 services/security_component_service/sa/test/unittest/src/sec_comp_entity_test.cpp delete mode 100644 services/security_component_service/sa/test/unittest/src/sec_comp_entity_test.h delete mode 100644 services/security_component_service/sa/test/unittest/src/sec_comp_info_helper_test.cpp delete mode 100644 services/security_component_service/sa/test/unittest/src/sec_comp_info_helper_test.h delete mode 100644 services/security_component_service/sa/test/unittest/src/sec_comp_manager_test.cpp delete mode 100644 services/security_component_service/sa/test/unittest/src/sec_comp_manager_test.h delete mode 100644 services/security_component_service/sa/test/unittest/src/sec_comp_service_mock_test.cpp delete mode 100644 services/security_component_service/sa/test/unittest/src/sec_comp_service_test.cpp delete mode 100644 services/security_component_service/sa/test/unittest/src/sec_comp_service_test.h delete mode 100644 services/security_component_service/sa/test/unittest/src/sec_comp_stub_test.cpp delete mode 100644 services/security_component_service/sa/test/unittest/src/sec_comp_stub_test.h delete mode 100644 test/dts/location_button.d.ts delete mode 100644 test/dts/paste_button.d.ts delete mode 100644 test/dts/save_button.d.ts delete mode 100644 test/dts/security_component.d.ts delete mode 100644 test/fuzztest/security_component/BUILD.gn delete mode 100644 test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/BUILD.gn delete mode 100644 test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/corpus/init delete mode 100644 test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/getenhanceremoteobjectInner_fuzzer.cpp delete mode 100644 test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/getenhanceremoteobjectInner_fuzzer.h delete mode 100644 test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/project.xml delete mode 100644 test/fuzztest/security_component/getenhanceremoteobject_fuzzer/BUILD.gn delete mode 100644 test/fuzztest/security_component/getenhanceremoteobject_fuzzer/corpus/init delete mode 100644 test/fuzztest/security_component/getenhanceremoteobject_fuzzer/getenhanceremoteobject_fuzzer.cpp delete mode 100644 test/fuzztest/security_component/getenhanceremoteobject_fuzzer/getenhanceremoteobject_fuzzer.h delete mode 100644 test/fuzztest/security_component/getenhanceremoteobject_fuzzer/project.xml delete mode 100644 test/fuzztest/security_component/getpointereventenhancedata_fuzzer/BUILD.gn delete mode 100644 test/fuzztest/security_component/getpointereventenhancedata_fuzzer/corpus/init delete mode 100644 test/fuzztest/security_component/getpointereventenhancedata_fuzzer/getpointereventenhancedata_fuzzer.cpp delete mode 100644 test/fuzztest/security_component/getpointereventenhancedata_fuzzer/getpointereventenhancedata_fuzzer.h delete mode 100644 test/fuzztest/security_component/getpointereventenhancedata_fuzzer/project.xml delete mode 100644 test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/BUILD.gn delete mode 100644 test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/corpus/init delete mode 100644 test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/project.xml delete mode 100644 test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/reduceafterverifysavepermissionInner_fuzzer.cpp delete mode 100644 test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/reduceafterverifysavepermissionInner_fuzzer.h delete mode 100644 test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/BUILD.gn delete mode 100644 test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/corpus/init delete mode 100644 test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/project.xml delete mode 100644 test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/reduceafterverifysavepermission_fuzzer.cpp delete mode 100644 test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/reduceafterverifysavepermission_fuzzer.h delete mode 100644 test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/BUILD.gn delete mode 100644 test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/corpus/init delete mode 100644 test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/project.xml delete mode 100644 test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/registersecuritycomponentInner_fuzzer.cpp delete mode 100644 test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/registersecuritycomponentInner_fuzzer.h delete mode 100644 test/fuzztest/security_component/registersecuritycomponent_fuzzer/BUILD.gn delete mode 100644 test/fuzztest/security_component/registersecuritycomponent_fuzzer/corpus/init delete mode 100644 test/fuzztest/security_component/registersecuritycomponent_fuzzer/project.xml delete mode 100644 test/fuzztest/security_component/registersecuritycomponent_fuzzer/registersecuritycomponent_fuzzer.cpp delete mode 100644 test/fuzztest/security_component/registersecuritycomponent_fuzzer/registersecuritycomponent_fuzzer.h delete mode 100644 test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/BUILD.gn delete mode 100644 test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/corpus/init delete mode 100644 test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/project.xml delete mode 100644 test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/reportsecuritycomponentclickeventInner_fuzzer.cpp delete mode 100644 test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/reportsecuritycomponentclickeventInner_fuzzer.h delete mode 100644 test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/BUILD.gn delete mode 100644 test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/corpus/init delete mode 100644 test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/project.xml delete mode 100644 test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/reportsecuritycomponentclickevent_fuzzer.cpp delete mode 100644 test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/reportsecuritycomponentclickevent_fuzzer.h delete mode 100644 test/fuzztest/security_component/setenhancecfg_fuzzer/BUILD.gn delete mode 100644 test/fuzztest/security_component/setenhancecfg_fuzzer/corpus/init delete mode 100644 test/fuzztest/security_component/setenhancecfg_fuzzer/project.xml delete mode 100644 test/fuzztest/security_component/setenhancecfg_fuzzer/setenhancecfg_fuzzer.cpp delete mode 100644 test/fuzztest/security_component/setenhancecfg_fuzzer/setenhancecfg_fuzzer.h delete mode 100644 test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/BUILD.gn delete mode 100644 test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/corpus/init delete mode 100644 test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/project.xml delete mode 100644 test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/unregistersecuritycomponentInner_fuzzer.cpp delete mode 100644 test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/unregistersecuritycomponentInner_fuzzer.h delete mode 100644 test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/BUILD.gn delete mode 100644 test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/corpus/init delete mode 100644 test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/project.xml delete mode 100644 test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/unregistersecuritycomponent_fuzzer.cpp delete mode 100644 test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/unregistersecuritycomponent_fuzzer.h delete mode 100644 test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/BUILD.gn delete mode 100644 test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/corpus/init delete mode 100644 test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/project.xml delete mode 100644 test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/updatesecuritycomponentInner_fuzzer.cpp delete mode 100644 test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/updatesecuritycomponentInner_fuzzer.h delete mode 100644 test/fuzztest/security_component/updatesecuritycomponent_fuzzer/BUILD.gn delete mode 100644 test/fuzztest/security_component/updatesecuritycomponent_fuzzer/corpus/init delete mode 100644 test/fuzztest/security_component/updatesecuritycomponent_fuzzer/project.xml delete mode 100644 test/fuzztest/security_component/updatesecuritycomponent_fuzzer/updatesecuritycomponent_fuzzer.cpp delete mode 100644 test/fuzztest/security_component/updatesecuritycomponent_fuzzer/updatesecuritycomponent_fuzzer.h delete mode 100644 test/security_component/AppScope/app.json delete mode 100644 test/security_component/AppScope/resources/base/element/string.json delete mode 100644 test/security_component/AppScope/resources/base/media/app_icon.png delete mode 100644 test/security_component/BUILD.gn delete mode 100644 test/security_component/Test.json delete mode 100644 test/security_component/entry/src/main/ets/Application/AbilityStage.ts delete mode 100644 test/security_component/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100644 test/security_component/entry/src/main/ets/MainAbility/pages/index/index.ets delete mode 100644 test/security_component/entry/src/main/ets/MainAbility/pages/locationButton.ets delete mode 100644 test/security_component/entry/src/main/ets/MainAbility/pages/locationButton_1.ets delete mode 100644 test/security_component/entry/src/main/ets/MainAbility/pages/pasteButton.ets delete mode 100644 test/security_component/entry/src/main/ets/MainAbility/pages/saveButton.ets delete mode 100644 test/security_component/entry/src/main/ets/MainAbility/pages/saveButton_1.ets delete mode 100644 test/security_component/entry/src/main/ets/TestAbility/TestAbility.ts delete mode 100644 test/security_component/entry/src/main/ets/TestAbility/pages/index.ets delete mode 100644 test/security_component/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts delete mode 100644 test/security_component/entry/src/main/ets/test/List.test.ets delete mode 100644 test/security_component/entry/src/main/ets/test/LocationComponentTest.test.ets delete mode 100644 test/security_component/entry/src/main/ets/test/LocationComponentTest_1.test.ets delete mode 100644 test/security_component/entry/src/main/ets/test/PasteComponentTest.test.ets delete mode 100644 test/security_component/entry/src/main/ets/test/SaveComponentTest.test.ets delete mode 100644 test/security_component/entry/src/main/ets/test/SaveComponentTest_1.test.ets delete mode 100644 test/security_component/entry/src/main/ets/test/Utils.ets delete mode 100644 test/security_component/entry/src/main/module.json delete mode 100644 test/security_component/entry/src/main/resources/base/element/color.json delete mode 100644 test/security_component/entry/src/main/resources/base/element/float.json delete mode 100644 test/security_component/entry/src/main/resources/base/element/string.json delete mode 100644 test/security_component/entry/src/main/resources/base/media/icon.png delete mode 100644 test/security_component/entry/src/main/resources/base/profile/main_pages.json delete mode 100644 test/security_component/signature/openharmony_sx.p7b diff --git a/BUILD.gn b/BUILD.gn deleted file mode 100644 index 58080d8..0000000 --- a/BUILD.gn +++ /dev/null @@ -1,47 +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("//build/ohos.gni") - -group("security_component_build_module") { - if (is_standard_system) { - deps = [ - "interfaces/inner_api/enhance_kits:libsecurity_component_enhance_sdk", - "interfaces/inner_api/security_component:libsecurity_component_sdk", - "services/security_component_service/sa:security_component_service", - "services/security_component_service/sa/sa_profile:security_component_sa_profile_standard", - ] - } -} - -group("security_component_build_module_test") { - testonly = true - deps = [] - if (is_standard_system) { - deps += [ - "interfaces/inner_api/enhance_kits/test:unittest", - "interfaces/inner_api/security_component/test:unittest", - "services/security_component_service/sa/test:unittest", - ] - } -} - -group("security_component_build_fuzz_test") { - testonly = true - deps = [] - if (is_standard_system) { - deps += [ - "test/fuzztest/security_component:fuzztest", - ] - } -} \ No newline at end of file diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 4a45986..0000000 --- a/LICENSE +++ /dev/null @@ -1,177 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - 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: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) 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 - - (d) 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/README_zh.md b/README_zh.md deleted file mode 100644 index 141edb1..0000000 --- a/README_zh.md +++ /dev/null @@ -1,47 +0,0 @@ -# 安全控件管理服务 - -## 简介 - -安全控件是OpenHarmony提供的一组系统实现的ArkUI基础组件。当用户点击了这类组件后,应用将被授予临时授权,应用开发者仅需要像使用Button等组件那样集成到应用自己的页面即可。 -安全控件管理服务主要提供如下功能: - -- 提供应用安全控件的注册、临时授权、取消注册等Native接口实现。 -- 负责安全控件的合法性检查,只有合法的安全控件才能授权成功。 -- 提供其他SA查询临时授权的Native接口实现。提供安全增强相关接口及适配层,供厂商定制安全增强功能使用。 - -## 目录 - -``` -/base/security/security_component -├── frameworks # 框架层,基础功能代码存放目录 -│ ├── common # 框架公共代码存放目录 -│ ├── enhance_adapter # 能力增强适配代码存放目录 -│ └── security_component # 安全控件服务框架代码存放目录 -├── interfaces # 接口层 -│ └── inner_api # 内部接口层 -│ ├── enhance_kits # 安全控件配置接口代码存放目录 -│ └── security_component # 安全控件服务接口层代码存放目录 -└── services # 服务层 - └── security_component_service/sa - └── sa_main # 安全控件服务侧代码存放目录 - -``` - -## 使用 -### 接口说明 - -| **接口申明** | **接口描述** | -| --- | --- | -| int32_t RegisterSecurityComponent(SecCompType type, const std::string& componentInfo, int32_t& scId); | 注册安全控件 | -| int32_t UpdateSecurityComponent(int32_t scId, const std::string& componentInfo); | 更新安全控件信息 | -| int32_t UnregisterSecurityComponent(int32_t scId); | 取消注册安全控件 | -| int32_t ReportSecurityComponentClickEvent(int32_t scId, const std::string& componentInfo, const SecCompClickEvent& touchInfo); | 上报点击事件,申请临时授权 | -| int32_t SetEnhanceCfg(uint8_t* cfg, uint32_t cfgLen); | 设置安全控件增强的配置,供多模服务使用 | -| int32_t GetPointerEventEnhanceData(void* data, uint32_t dataLen, uint8_t* enhanceData, uint32_t& enHancedataLen); | 获取点击事件的安全增强数据,供多模服务使用 | -| bool ReduceAfterVerifySavePermission(AccessToken::AccessTokenID tokenId); | 校验后取消保存控件权限 | - -## 相关仓 - -**[arkui\_ace\_engine](https://gitee.com/openharmony/arkui_ace_engine/blob/master/README_zh.md)** - -**[multimodalinput\_input](https://gitee.com/openharmony/multimodalinput_input/blob/master/README_zh.md)** diff --git a/bundle.json b/bundle.json deleted file mode 100644 index f9134f4..0000000 --- a/bundle.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "name": "@openharmony/security_component", - "description": "security_component", - "version": "4.0.0", - "license": "Apache License 2.0", - "publishAs": "code-segment", - "segment": { - "destPath": "base/security/security_component" - }, - "dirs": {}, - "scripts": {}, - "component": { - "name": "security_component", - "subsystem": "security", - "syscap": [], - "hisysevent_config": [ - "//base/security/security_component/hisysevent.yaml" - ], - "features": [ "security_component_feature_coverage = false" ], - "adapted_system_type": [ - "standard" - ], - "rom": "2048KB", - "ram": "5102KB", - "deps": { - "components": [ - "ability_base", - "ability_runtime", - "access_token", - "c_utils", - "eventhandler", - "hilog", - "hisysevent", - "hitrace", - "graphic_2d", - "ipc", - "safwk", - "samgr", - "window_manager" - ], - "third_party": [ - "cJSON", - "googletest" - ] - }, - "build": { - "sub_component": [ - "//base/security/security_component:security_component_build_module" - ], - "inner_kits": [ - { - "name": "//base/security/security_component/interfaces/inner_api/security_component:libsecurity_component_sdk", - "header": { - "header_files": [ - "i_sec_comp_probe.h", - "sec_comp_kit.h" - ], - "header_base": "//base/security/security_component/interfaces/inner_api/security_component/include" - } - }, - { - "name": "//base/security/security_component/interfaces/inner_api/enhance_kits:libsecurity_component_enhance_sdk", - "header": { - "header_files": [ - "sec_comp_enhance_kit.h" - ], - "header_base": "//base/security/security_component/interfaces/inner_api/enhance_kits/include" - } - }, - { - "name": "//base/security/security_component/frameworks:libsecurity_component_framework", - "header": { - "header_files": [ - "location_button.h", - "paste_button.h", - "save_button.h" - ], - "header_base": "//base/security/security_component/interfaces/inner_api/security_component/include" - } - }, - { - "name": "//base/security/security_component/frameworks:libsecurity_component_enhance_adapter", - "header": { - "header_files": [ - "sec_comp_enhance_adapter.h" - ], - "header_base": "//base/security/security_component/frameworks/enhance_adapter/include" - } - }, - { - "name": "//base/security/security_component/services/security_component_service/sa:security_component_service", - "header": { - "header_files": [ - "sec_comp_manager.h" - ], - "header_base": "//base/security/security_component/services/security_component_service/sa/sa_main" - } - } - ], - "test": [ - "//base/security/security_component:security_component_build_module_test", - "//base/security/security_component:security_component_build_fuzz_test" - ] - } - } -} diff --git a/config/BUILD.gn b/config/BUILD.gn deleted file mode 100644 index 9cf7554..0000000 --- a/config/BUILD.gn +++ /dev/null @@ -1,23 +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. - -declare_args() { - security_component_feature_coverage = false -} - -config("coverage_flags") { - if (security_component_feature_coverage) { - cflags = [ "--coverage" ] - ldflags = [ "--coverage" ] - } -} diff --git a/test/dts/README_zh.md b/docs/Readme-CN.md similarity index 55% rename from test/dts/README_zh.md rename to docs/Readme-CN.md index bd54370..4d76dca 100644 --- a/test/dts/README_zh.md +++ b/docs/Readme-CN.md @@ -1,18 +1,24 @@ # 安全控件管理服务 + ## 简介 安全控件是OpenHarmony提供的一组系统实现的ArkUI基础组件。当用户点击了这类组件后,应用将被授予临时授权,应用开发者仅需要像使用Button等组件那样集成到应用自己的页面即可。 + 安全控件管理服务主要提供如下功能: -- 提供应用安全控件的注册、临时授权、取消注册等Native接口实现。 -- 负责安全控件的合法性检查,只有合法的安全控件才能授权成功。 -- 提供其他SA查询临时授权的Native接口实现。提供安全增强相关接口及适配层,供厂商定制安全增强功能使用。 +- 提供应用安全控件的注册、临时授权、取消注册等Native接口实现。 + +- 负责安全控件的合法性检查,只有合法的安全控件才能授权成功。 + +- 提供其他SA查询临时授权的Native接口实现。 + +- 提供安全增强相关接口及适配层,供厂商定制安全增强功能使用。 + ## 目录 ``` -/base/security/security_component ├── frameworks # 框架层,基础功能代码存放目录 │ ├── common # 框架公共代码存放目录 │ ├── enhance_adapter # 能力增强适配代码存放目录 @@ -24,24 +30,27 @@ └── services # 服务层 └── security_component_service/sa └── sa_main # 安全控件服务侧代码存放目录 - ``` + ## 使用 + + ### 接口说明 -| **接口申明** | **接口描述** | -| --- | --- | -| int32_t RegisterSecurityComponent(SecCompType type, const std::string& componentInfo, int32_t& scId); | 注册安全控件 | -| int32_t UpdateSecurityComponent(int32_t scId, const std::string& componentInfo); | 更新安全控件信息 | -| int32_t UnregisterSecurityComponent(int32_t scId); | 取消注册安全控件 | -| int32_t ReportSecurityComponentClickEvent(int32_t scId, const std::string& componentInfo, const SecCompClickEvent& touchInfo); | 上报点击事件,申请临时授权 | -| int32_t SetEnhanceCfg(SecCompEnhanceCfgBase* cfg); | 设置安全控件增强的配置,供多模服务使用 | -| int32_t GetPointerEventEnhanceData(void* data, uint32_t dataLen, uint8_t* enhanceData, uint32_t& enHancedataLen); | 获取点击事件的安全增强数据,供多模服务使用 | -| bool ReduceAfterVerifySavePermission(AccessToken::AccessTokenID tokenId); | 校验后取消保存控件权限 | +| 定义 | 说明 | +| -------- | -------- | +| int32_t RegisterSecurityComponent(SecCompType type, const std::string& componentInfo, int32_t& scId); | 注册安全控件 | +| int32_t UpdateSecurityComponent(int32_t scId, const std::string& componentInfo); | 更新安全控件信息 | +| int32_t UnregisterSecurityComponent(int32_t scId); | 取消注册安全控件 | +| int32_t ReportSecurityComponentClickEvent(int32_t scId, const std::string& componentInfo, const SecCompClickEvent& touchInfo); | 上报点击事件,申请临时授权 | +| int32_t SetEnhanceCfg(SecCompEnhanceCfgBase\* cfg); | 设置安全控件增强的配置,供多模服务使用 | +| int32_t GetPointerEventEnhanceData(void\* data, uint32_t dataLen, uint8_t\* enhanceData, uint32_t& enHancedataLen); | 获取点击事件的安全增强数据,供多模服务使用 | +| bool ReduceAfterVerifySavePermission(AccessToken::AccessTokenID tokenId); | 校验后取消保存控件权限 | + ## 相关仓 -**[arkui\_ace\_engine](https://gitee.com/openharmony/arkui_ace_engine/blob/master/README_zh.md)** +**[arkui_ace_engine]** -**[multimodalinput\_input](https://gitee.com/openharmony/multimodalinput_input/blob/master/README_zh.md)** +**[multimodalinput_input]** diff --git a/docs/arkui-ts/figures/zh-cn_image_0000001593518280.png b/docs/arkui-ts/figures/zh-cn_image_0000001593518280.png new file mode 100644 index 0000000000000000000000000000000000000000..acaa811077eec62791dcfefd3acfd6fc9f9b18d6 GIT binary patch literal 64148 zcmdpe^-~8Tr|+FJ=S;YYk~9Dj9}x-)3Lq;Zp#}v7Z36}M>C+duk0S`0XYL;xXlFHP zF{tWE!sCyf&z7Q!qEJwEu}Ck*u>W1-D5K*H1%(3sZ-E|iC^dtEdio|SA*$hFc;*ZH zi&DGw?wcKfk$ZSMO+NtXb091T=LI?dbd%pt*3vHcMadDeO@@F@d0s!#HU?=-emz{v zmgQSP)^@6$8JYNxnYS^ z^n(_1o-)pErQW<9TB4$OEU@vQJtVd&p1fJpz}^ZYK+2-g;!DeQ?E(TZgH*ORh0rYY`T+!>mp@Q zzfvzTPrn+Bnl4d&LfrnR^o*{5JcGrB#a%b-FIBEgQdY^8%PyPPfzCm)3Qbn>z2o5S!UvLuSiUP2Wy|vdBu+OQVqEN zCqG>0y|G#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WAHzg}7Oz^N|*JXiL_QiVExTk2?QUi<$C+%^&z*Pc-J X=!Z|x-<*t~JYVmXG~d=LScU&D(oSF2 literal 0 HcmV?d00001 diff --git a/docs/arkui-ts/figures/zh-cn_image_0000001593677984.png b/docs/arkui-ts/figures/zh-cn_image_0000001593677984.png new file mode 100644 index 0000000000000000000000000000000000000000..41a2510def2bdd21aaa1b6a6d74122d7857b0351 GIT binary patch literal 26150 zcmb?i^;2Cvv@P!LZWk%VF7EE`R@~j)id?L?ySqbi_Y1`-P~6?!?e&}YC%pGVCdo{) zGdX9ioxRUliBwjULO~=%{PN`sij1_l>c4vE%NGcIc-Vg}C`O&Ae-(tQs+8!L+9~4W ze;sH`5e1PiUmD_&-i%@X^%0z;bzHxEK^^?BK#Vw+n|=9W-YFw4qV8pI?hhA8t&wqG zac6SKoyI zbQn;v^JA*!qCi4;ICs&p<8(s3*GJ>N(qa8Ihk4D48k*H?)W}H5-(oaAXcRtyVi4I3 zG#YOV%PML%$^u0|!D^Ns6pc>6Iw33>flOdQP9+|O%odM9DHcZX|2lkJN$j?7NM{XG zJfdC4Y19htEz!X0`OTE7NuRw9O3_kgH;Yx)!rm|jPem35*R9Khc#gyP!h=85-_ zX&QIuDcX2hcPZ*K(O~D*5@RwY;R|uZ1SOGs<5i2!M(e$Cq-4w6d#C?=&WcoaS2;Ps zd8kd}OQ)NOF1vKcsh^B(Nt3ymh;OVNGL9)%$bS+U-WQ`{+3)}8iSoA7V&7(N8{ID% zI9rU=pkWr|EscqX!R0FEx|{0%UOK=^kllv_g)h4;OS&Cs&Z)@nBgAjbF*95} z1{7iphjvPF6l_d5qu?nnWT*lQ9JrR>c5LQ`rvirDf>kl4sW2!Zw!cHTs7#fAa#swL z5w7N9I}cic*o2x%29r3!Hat(y4hDUjd(TDjnctEpjYO8`4FHlqtu@U8Ilw}Hn5eaL zLyN(6V}ytvwfKFc1pRYpbX(C$t4`YCF|qNq=IBpYn+Q6@xUP#5D!q|^HqRrioJF0O zRW42{J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j&prL}v;Pl>u%sL|0bfJlJ7I4((!u8g<0g=9N*b)o&nXiaEYzP5Zw!zkFglV9pRssE(WdC>7TEA-j zQ&sC30XOtv@LMH-Eo<)sitH+e_ogfD3EWA^y`m8N9P}q;f9vaE<3V z<-N+n^M#B$)$C&;&I!po4{nZSn_s{8m)q@#y_S}!otHu}qr*slHYcWt3+}iD1+!!% z$nkV^a|MCYG)&;c2$`walX=vCIR1m`Fu}&#b0GFn5mtIjWxp>NIsZM2#F^~}yip;+ zqR}C6cnz@9($jR z(;QKgxW;gov%8k38W_*#|QqN_@uXZb_ zC%pf@Ve+nn0Ae$i{LsL)rskdrJS;i1?qN!hz^4+R;gNfxpLo(Lh{KRgP@Cv;s3pOY4Syv{hqcBts`+N?5?u7Wx2vAD3eMT0HXagvmF&x@z4A ziI5}YcjAXcbJKpbXhoUy9>qlpv&r&r;@>e08_x=UwLvnGqLO58U~fh()PCF27CX?A zt4%9r(6e?O2Fd%6rohHoYm+oL$bOtR7g1CP_pdcceAz2a<~hTfgGpCTGiHO~!JSoT zUAlsYh=vMFwjs^9fow95^ysbJLC+m{X$m*qU8e6X3ZE4vU-l_SIKF!g{C_Pb`G2TA d@ql{#xYZhyPK4L`U-8R-vXV*?HDV@#{|6shq22%h literal 0 HcmV?d00001 diff --git a/docs/arkui-ts/figures/zh-cn_image_0000001643038221.png b/docs/arkui-ts/figures/zh-cn_image_0000001643038221.png new file mode 100644 index 0000000000000000000000000000000000000000..21409ff9b6699683e2aba8dbbee453ca87defc6b GIT binary patch literal 26031 zcmcFpV|yjf)6Q<}jgu4Gwr$&XPHfw@ZDV6??3~zkvdPBT7|;Ix-{E;NJ>7FnT|HCX z)pgfh6{Vygi3kUP0|Ns?l$H`x0R#I+_OB0uf%?~?j3A=^yM1#}krV-|pTYb6ZvbH_ zEH4ZO)|3GMZVdTv4C^SR?E(gdH1yx~ZOoz43=GU%Oj=A>&C}qr7rIbiJ&XUBLhs+d zWQ?%H#6=l_YGp7~YuJ$8q-{7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docs/arkui-ts/figures/zh-cn_image_0000001643320073.png new file mode 100644 index 0000000000000000000000000000000000000000..a9d96dcb1c6082a329f87126d5dbc6678b2a3e41 GIT binary patch literal 24287 zcmc$FQ+sAju=d2xBv0&2Y}>Z&iEU@1iEZ0YY))+3wr%6fyZ2An2j9WEdeuSqs#Vq1 zU3b^rVG45M2(Z|&KYsi`kdzQn`flfc`~V?@hWvgTFVijfZa|!r#D#uTP2!$>3*csg zvVuQ;)W*QQ8$f)^F!mCfPCtGi_Wk#O4B3?!|M;QjEGZ(W;;wh$4V8;$lJ>~_(6E-U zt^$DWprAUd_J`2*)U7pI`xw}0tp3yoK~_-_Id3hePHwDeT0nz4UPV(^6ag;;2LNUh z*5tEZ`KQ>QNI(D(JpZ1uJ&z<0v(q@8OgmpXpFGCYD-#8xaXGm_Jztr{qjB*B9WOgSG7z$bWL{} z=$g}34!M&@c)Ht(6ZL={jiP?e+Yz@EvPhx`Ei^YQbh&ANpf|u}(cewFYngAuKM)PR#5q?Ahv?t~my2@Nzq%zrt_8AvYu|&Z8XerEugqUnDZ? z&@uJZUdH9ee);JfXm?wayh+fNa*SEp$GqU4cy3g;G1@^d_=H7@%!UR^h=8j>^FKzt zNX~MBmd)TZiIkK6rxINr!ziGsWGpyY-Q8soYcq#tCHK1&y= zA%VMkWwSF_FkNiPM3M`H%C7Y+Uw5MpUWeR!%UN`Tg}?Kj1aZi2TObPavOK6DTgBry z)=Kssl^=C#auuP|%#s6AFC9;Zf9mTMfmkp3i9#gBQjXRNm51+nk~thYVeEv3q$uoY ziYHUib{i_*pwD}^X(~myH{Sm9{O`XXXK7nq#5M+KbcXgk#ANS}+`5O7jJmD9F3_#5 z=!%oiNyAi9RW%eL*l1BY_~XOU7qSI5u=H!2Re^OSS+cL=Fr>p#$xqazrj%2q4XJ7G zWWgxPilpPdrmCk*gf5ue1EjcG9f)7vHvtY5)u#yM@7kuEjCwBE&hJ#Za^wdi|GAzV zIOsG@A_n$SOEG)*(qQN2(?lx+Cv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HAbO#nlNu#2xCM1zES z{W2m(Gs`YUFmKEeQ!ZCL7TMDj>q-l-Ksupy2mn)}j8esx--kEM)5)bcyrMrgPG`@< z)FP&oZ>{lz!-*LXK#1`O4a(*?^496(@CMoU$Q$x(=qUJ_jtb z-H~sovr~cn_%5VhYGde=K6p<4j*_L;u;d8fXB<)D^8KdCSg0`SB*%~x literal 0 HcmV?d00001 diff --git a/docs/arkui-ts/ts-basic-components-seclocationbutton.md b/docs/arkui-ts/ts-basic-components-seclocationbutton.md new file mode 100644 index 0000000..dbea7b3 --- /dev/null +++ b/docs/arkui-ts/ts-basic-components-seclocationbutton.md @@ -0,0 +1,137 @@ +# LocationButton + + +安全组件的位置按钮,用户通过点击该位置按钮,可以临时获取精准定位权限,而不需要权限弹框授权确认。 + + +> **说明:** +> +> 该组件从API Version 10开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 + + +## 子组件 + +不支持。 + + +## 接口 + +**方法1:** LocationButton() + +默认创建带有图标、文本、背景的位置按钮。 + +**方法2:** LocationButton(option:{icon?: LocationIconStyle, text?: LocationDescription, buttonType?: ButtonType}) + +创建包含指定元素的位置按钮。 + +**参数:** + +| 参数名 | 参数类型 | 必填 | 参数描述 | +| -------- | -------- | -------- | -------- | +| icon | [LocationIconStyle](#locationiconstyle枚举说明) | 否 | 设置位置按钮的图标风格
不传入该参数表示没有图标,icon和text至少存在一个。 | +| text | [LocationDescription](#locationdescription枚举说明) | 否 | 设置位置按钮的文本描述
不传入该参数表示没有文字描述,icon和text至少存在一个。 | +| buttonType | [ButtonType](ts-basic-components-button.md#ButtonType枚举说明) | 否 | 设置位置按钮的背景样式
不传入该参数表示没有背景。 | + + +## LocationIconStyle枚举说明 + +| 名称 | 描述 | +| -------- | -------- | +| FULL_FILLED | 位置按钮展示填充样式图标。 | +| LINES | 位置按钮展示线条样式图标。 | + + +## LocationDescription枚举说明 + +| 名称 | 描述 | +| -------- | -------- | +| CURRENT_LOCATION | 位置按钮的文字描述为“当前位置”。 | +| ADD_LOCATION | 位置按钮的文字描述为“添加位置”。 | +| SELECT_LOCATION | 位置按钮的文字描述为“选择位置”。 | +| SHARE_LOCATION | 位置按钮的文字描述为“共享位置”。 | +| SEND_LOCATION | 位置按钮的文字描述为“发送位置”。 | +| LOCATING | 位置按钮的文字描述为“定位”。 | +| LOCATION | 位置按钮的文字描述为“位置”。 | +| SEND_CURRENT_LOCATION | 位置按钮的文字描述为“发送实时位置”。 | +| RELOCATION | 位置按钮的文字描述为“重定位”。 | +| PUNCH_IN | 位置按钮的文字描述为“打卡定位”。 | +| CURRENT_POSITION | 位置按钮的文字描述为“所在位置”。 | + + +## LocationButtonOnClickResult枚举说明 + +| 名称 | 描述 | +| -------- | -------- | +| SUCCESS | 位置按钮点击成功。 | +| TEMPORARY_AUTHORIZATION_FAILED | 位置按钮点击后位置权限授权失败。 | + + +## 属性 + +不支持通用属性,仅继承[安全组件通用属性](ts-universal-attributes-securitycomponent.md#属性)。 + + +## 事件 + +不支持通用事件,仅支持以下事件: + +| 名称 | 功能描述 | +| -------- | -------- | +| onClick(event: (event: [ClickEvent](ts-universal-events-click.md#clickevent对象说明)), result: [LocationButtonOnClickResult](#locationbuttononclickresult枚举说明)) => void) | 点击动作触发该回调。
result:位置权限的授权结果。
event:见ClickEvent对象说明。 | + + +## 示例 + +``` +// xxx.ets +@Entry +@Component +struct Index { + build() { + Row() { + Column({space:10}) { + // 默认位置按钮 + LocationButton() + // 生成默认位置按钮,包含图标+文字+背景 + LocationButton() + .fontSize(35) + .fontColor(Color.White) + .iconSize(30) + .layoutDirection(SecurityComponentLayoutDirection.HORIZONTAL) + .borderWidth(1) + .borderStyle(BorderStyle.Dashed) + .borderColor(Color.Blue) + .borderRadius(20) + .fontWeight(100) + .iconColor(Color.White) + .padding({ left: 50, top: 50, bottom: 50, right: 50 }) + .textIconSpace(20) + .backgroundColor(0x3282f6) + .onClick((event: ClickEvent, result: LocationButtonOnClickResult)=>{ + console.error("result " + result) + }) + // 生成定制图标、文字、背景的位置按钮 + LocationButton({icon:LocationIconStyle.LINES, text:LocationDescription.CURRENT_POSITION, buttonType:ButtonType.Normal}) + .fontSize(35) + .fontColor(0x3282f6) + .iconSize(30) + .layoutDirection(SecurityComponentLayoutDirection.VERTICAL) + .borderWidth(1) + .borderStyle(BorderStyle.Dashed) + .borderColor(0x9ffcfd) + .borderRadius(20) + .fontWeight(100) + .iconColor(0x3282f6) + .padding({left:50, top:50, bottom:50, right:50}) + .textIconSpace(20) + .backgroundColor(0x9ffcfd) + .onClick((event: ClickEvent, result: LocationButtonOnClickResult)=>{ + console.error("result " + result) + }) + }.width('100%') + }.height('100%') + } +} +``` + +![zh-cn_image_0000001593518280](figures/zh-cn_image_0000001593518280.png) diff --git a/docs/arkui-ts/ts-basic-components-secpastebutton.md b/docs/arkui-ts/ts-basic-components-secpastebutton.md new file mode 100644 index 0000000..5eb67a3 --- /dev/null +++ b/docs/arkui-ts/ts-basic-components-secpastebutton.md @@ -0,0 +1,96 @@ +# PasteButton + + +安全组件的粘贴按钮,用户通过点击该粘贴按钮,可以临时获取读取剪贴板权限,而不会触发toast提示。 + + +> **说明:** +> +> 该组件从API Version 10开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 + + +## 子组件 + +不支持。 + + +## 接口 + +**方法1:** PasteButton() + +默认创建带有图标、文本、背景的粘贴按钮。 + +**方法2:** PasteButton(option:{icon?: PasteIconStyle, text?: PasteDescription, buttonType?: ButtonType}) + +创建包含指定元素的粘贴按钮。 + +**参数:** + +| 参数名 | 参数类型 | 必填 | 参数描述 | +| -------- | -------- | -------- | -------- | +| icon | [PasteIconStyle](#pasteiconstyle枚举说明) | 否 | 设置粘贴按钮的图标风格。
不传入该参数表示没有图标,icon和text至少存在一个。 | +| text | [PasteDescription](#pastedescription枚举说明) | 否 | 设置粘贴按钮的文本描述。
不传入该参数表示没有文字描述,icon和text至少存在一个。 | +| buttonType | [ButtonType](ts-basic-components-button.md#ButtonType枚举说明) | 否 | 设置粘贴按钮的背景样式。
不传入该参数表示没有背景。 | + + +## 属性 + +不支持通用属性,仅继承[安全组件通用属性](ts-universal-attributes-securitycomponent.md#属性)。 + + +## PasteIconStyle枚举说明 + +| 名称 | 描述 | +| -------- | -------- | +| LINES | 粘贴按钮展示线条样式图标。 | + + +## PasteDescription枚举说明 + +| 名称 | 描述 | +| -------- | -------- | +| PASTE | 粘贴按钮的文字描述为“粘贴”。 | + + +## PasteButtonOnClickResult枚举说明 + +| 名称 | 描述 | +| -------- | -------- | +| SUCCESS | 粘贴按钮点击成功。 | +| TEMPORARY_AUTHORIZATION_FAILED | 粘贴按钮点击后权限授权失败。 | + + +## 事件 + +不支持通用事件,仅支持以下事件: + +| 名称 | 功能描述 | +| -------- | -------- | +| onClick(event: (event: [ClickEvent](ts-universal-events-click.md#clickevent对象说明)), result: [PasteButtonOnClickResult](#pastebuttononclickresult枚举说明)) => void) | 点击动作触发该回调。
result:剪贴板权限的授权结果,授权后可以读取当前剪贴板内容,如果内容发生变化再次读取仍需授权。
event:见ClickEvent对象说明。 | + + +## 示例 + +``` +// xxx.ets +@Entry +@Component +struct Index { + build() { + Row() { + Column({space:10}) { + // 默认参数下,图标、文字、背景都存在 + PasteButton() + // 传入参数即表示元素存在,不传入的参数表示元素不存在,例如:只显示图标 + PasteButton({icon:PasteIconStyle.LINES}) + // 只显示图标+背景 + PasteButton({icon:PasteIconStyle.LINES, buttonType:ButtonType.Capsule}) + // 图标、文字、背景都存在 + PasteButton({icon:PasteIconStyle.LINES, text:PasteDescription.PASTE, buttonType:ButtonType.Capsule}) + }.width('100%') + }.height('100%') + } +} +``` + +![zh-cn_image_0000001593677984](figures/zh-cn_image_0000001593677984.png) diff --git a/docs/arkui-ts/ts-basic-components-secsavebutton.md b/docs/arkui-ts/ts-basic-components-secsavebutton.md new file mode 100644 index 0000000..dc0e1ba --- /dev/null +++ b/docs/arkui-ts/ts-basic-components-secsavebutton.md @@ -0,0 +1,104 @@ +# SaveButton + + +安全组件的保存按钮,用户通过点击该保存按钮,可以临时获取存储权限,而不需要权限弹框授权确认。 + + +> **说明:** +> +> 该组件从API Version 10开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 + + +## 子组件 + +不支持。 + + +## 接口 + +**方法1:** SaveButton() + +默认创建带有图标、文本、背景的保存按钮。 + +**方法2:** SaveButton(option:{icon?: SaveIconStyle, text?: SaveDescription, buttonType?: ButtonType}) + +创建包含指定元素的保存按钮。 + +**参数:** + +| 参数名 | 参数类型 | 必填 | 参数描述 | +| -------- | -------- | -------- | -------- | +| icon | [SaveIconStyle](#saveiconstyle枚举说明) | 否 | 设置保存按钮的图标风格
不传入该参数表示没有图标,icon和text至少存在一个。 | +| text | [SaveDescription](#savedescription枚举说明) | 否 | 设置保存按钮的文本描述
不传入该参数表示没有文字描述,icon和text至少存在一个。 | +| buttonType | [ButtonType](ts-basic-components-button.md#ButtonType枚举说明) | 否 | 设置保存按钮的背景样式
不传入该参数表示没有背景。 | + + +## SaveIconStyle枚举说明 + +| 名称 | 描述 | +| -------- | -------- | +| FULL_FILLED | 保存按钮展示填充样式图标。 | +| LINES | 保存按钮展示线条样式图标。 | + + +## SaveDescription枚举说明 + +| 名称 | 描述 | +| -------- | -------- | +| DOWNLOAD | 保存按钮的文字描述为“下载”。 | +| DOWNLOAD_FILE | 保存按钮的文字描述为“下载文件”。 | +| SAVE | 保存按钮的文字描述为“保存”。 | +| SAVE_IMAGE | 保存按钮的文字描述为“保存图片”。 | +| SAVE_FILE | 保存按钮的文字描述为“保存文件”。 | +| DOWNLOAD_AND_SHARE | 保存按钮的文字描述为“下载分享”。 | +| RECEIVE | 保存按钮的文字描述为“接收”。 | +| CONTINUE_TO_RECEIVE | 保存按钮的文字描述为“继续接收”。 | + + +## SecSaveButtonOnClickResult枚举说明 + +| 名称 | 描述 | +| -------- | -------- | +| SUCCESS | 保存按钮点击成功。 | +| TEMPORARY_AUTHORIZATION_FAILED | 保存按钮点击后权限授权失败。 | + + +## 属性 + +不支持通用属性,仅继承[安全组件通用属性](ts-universal-attributes-securitycomponent.md#属性)。 + + +## 事件 + +不支持通用事件,仅支持以下事件: + +| 名称 | 功能描述 | +| -------- | -------- | +| onClick(event: (event: [ClickEvent](ts-universal-events-click.md#clickevent对象说明)), result: [SaveButtonOnClickResult](#secsavebuttononclickresult枚举说明)) => void) | 点击动作触发该回调。
result:存储权限的授权结果,授权方式为5秒单次,即触发点击后,可以在5秒中之内调用媒体库接口一次,超出5秒或者调用次数超出一次都会鉴权失败。
event:见ClickEvent对象说明。 | + + +## 示例 + +``` +// xxx.ets +@Entry +@Component +struct Index { + build() { + Row() { + Column({space:10}) { + // 默认参数下,图标、文字、背景都存在 + SaveButton() + // 传入参数即表示元素存在,不传入的参数表示元素不存在,例如:只显示图标 + SaveButton({icon:SaveIconStyle.FULL_FILLED}) + // 只显示图标+背景 + SaveButton({icon:SaveIconStyle.FULL_FILLED, buttonType:ButtonType.Capsule}) + // 图标、文字、背景都存在 + SaveButton({icon:SaveIconStyle.FULL_FILLED, text:SaveDescription.DOWNLOAD, buttonType:ButtonType.Capsule}) + }.width('100%') + }.height('100%') + } +} +``` + +![zh-cn_image_0000001643320073](figures/zh-cn_image_0000001643320073.png) diff --git a/docs/arkui-ts/ts-universal-attributes-securitycomponent.md b/docs/arkui-ts/ts-universal-attributes-securitycomponent.md new file mode 100644 index 0000000..1c0a867 --- /dev/null +++ b/docs/arkui-ts/ts-universal-attributes-securitycomponent.md @@ -0,0 +1,76 @@ +# 安全组件通用 + + +安全组件的基础属性,用于设置安全组件通用的属性。 + + +> **说明:** +> +> 该组件从API Version 10开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 + + +## 属性 + +| 名称 | 参数类型 | 必填 | 描述 | +| -------- | -------- | -------- | -------- | +| iconSize | [Dimension](ts-types.md#dimension10) | 否 | 设置安全组件上图标的尺寸。
默认值:16vp | +| layoutDirection | [SecurityComponentLayoutDirection](#securitycomponentlayoutdirection枚举说明) | 否 | 设置安全组件上图标和文字分布的方向。
默认值:SecurityComponentLayoutDirection.HORIZONTAL | +| position | [Position](ts-types.md#position8) | 否 | 设置绝对定位,设置安全组件的左上角相对于父容器左上角的偏移位置。
默认值:
{
x: 0,
y: 0
} | +| markAnchor | [Position](ts-types.md#position8) | 否 | 设置安全控件在位置定位时的锚点,以控件左上角作为基准点进行偏移。通常配合position和offset属性使用,单独使用时,效果类似offset
默认值:
{
x: 0,
y: 0
} | +| offset | [Position](ts-types.md#position8) | 否 | 设置相对定位,安全组件相对于自身的偏移量。
默认值:
{
x: 0,
y: 0
} | +| fontSize | [Dimension](ts-types.md#dimension10) | 否 | 设置安全组件上文字的尺寸。
默认值:16fp | +| fontStyle | [FontStyle](ts-appendix-enums.md#fontstyle) | 否 | 设置安全组件上文字的样式。
默认值:FontStyle.Normal | +| fontWeight | number \| [FontWeight](ts-appendix-enums.md#fontweight) \| string | 否 | 设置安全组件上文字粗细。
默认值:FontWeight.Medium | +| fontFamily | string \| [Resource](ts-types.md#resource) | 否 | 设置安全组件上文字的字体。
默认字体:'HarmonyOS Sans' | +| fontColor | [ResourceColor](ts-types.md#resourcecolor) | 否 | 设置安全组件上文字的颜色。
默认值:\#ffffffff | +| iconColor | [ResourceColor](ts-types.md#resourcecolor) | 否 | 设置安全组件上图标的颜色。
默认值:\#ffffffff | +| backgroundColor | [ResourceColor](ts-types.md#resourcecolor) | 否 | 设置安全组件的背景颜色。
默认值:\#007dff | +| borderStyle | [BorderStyle](ts-appendix-enums.md#borderstyle) | 否 | 设置安全组件的边框的样式。
默认不设置边框样式 | +| borderWidth | [Dimension](ts-types.md#dimension10) | 否 | 设置安全组件的边框的宽度。
默认不设置边框宽度 | +| borderColor | [ResourceColor](ts-types.md#resourcecolor) | 否 | 设置安全组件的边框的颜色。
默认不设置边框颜色 | +| borderRadius | [Dimension](ts-types.md#dimension10) | 否 | 设置安全组件的边框圆角半径。
默认值:1/2 按钮整高 | +| padding | [Padding](ts-types.md#padding) \| [Dimension](ts-types.md#dimension10) | 否 | 设置安全组件的内边距。
默认值:上下8vp, 左右24vp | +| textIconSpace | [Dimension](ts-types.md#dimension10) | 否 | 设置安全组件中图标和文字的间距。
默认值:4vp | + + +## SecurityComponentLayoutDirection枚举说明 + +| 名称 | 描述 | +| -------- | -------- | +| HORIZONTAL | 安全组件上图标和文字分布的方向为水平排列。 | +| VERTICAL | 安全组件上图标和文字分布的方向为垂直排列。 | + + +## 示例 + +```ts +// xxx.ets +@Entry +@Component +struct Index { + build() { + Row() { + Column() { + // 生成一个保存按钮,并设置它的SecurityComponent属性 + SecSaveButton() + .fontSize(35) + .fontColor(Color.White) + .iconSize(30) + .layoutDirection(SecurityComponentLayoutDirection.HORIZONTAL) + .layoutOrder(SecurityComponentLayoutOrder.TEXT_FIRST) + .borderWidth(1) + .borderStyle(BorderStyle.Dashed) + .borderColor(Color.Blue) + .borderRadius(20) + .fontWeight(100) + .iconColor(Color.White) + .padding({left:50, top:50, bottom:50, right:50}) + .textIconSpace(20) + .backgroundColor(0x3282f6) + }.width('100%') + }.height('100%') + } +} +``` + +![zh-cn_image_0000001643038221](figures/zh-cn_image_0000001643038221.png) diff --git a/docs/security/figures/zh-cn_image_0000001566651300.png b/docs/security/figures/zh-cn_image_0000001566651300.png new file mode 100644 index 0000000000000000000000000000000000000000..dc5b9c4a7287896dd6a5513ca0e90a09100328a4 GIT binary patch literal 72286 zcmagGbyQSg+b;}Arwk(9HH36ZBOnYll!(&ZAl*m{2nY-!J<=s1N{4{bf|Nstlyo-( z-yZdO-uGMUoOS+SF|+p_dtdpx;+`0&=3^p!YJ4;_G$K_MMIAIWOc)v(MjS3S8X7tR z`KuVXf$pL6SOKkah;{?`f@v$SA&-VulSpuFjs<+jb5k+&KtrP-Mg5`ovmeQ#q1_g$ zD$48mnrtJTtM4O%)(FJA@x%>q~dDVszuZ<-%kTejy>45Wy<- zE{Uf?-uz9}iyvQAuHNz(awa4!_2NjbX-5$EhBDnV zMJgD6Tjl`cw^QxMip*QX2h#Y;O*tRS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w)Pfw-#l*>m^$Pb;3T+w6lC z8p#_lLb@&s++H)*aX*IBRD_+wNB~Q%VzR#}O2P&yagDrLMDd5d^33~5hNe)&C0C-Y2;>p0 z_tNz17>!MxVYFI9TT<1Kd;9N>nFCh*s2tD5 zjzk*uJqo#KAfWS@4QDK12LMq+o5+5o+wA}l9=Zf#&=M(xAqYKbuF;&HyKb2UiL(tN;iu%s7m z^&A<@!(JcS*oxz9>&pvB)*w3b>{4q0x==^Gx6?XsJ>a!|s&s6LbM@d%rv>^r)>DhP)Wo_;i%Q&P?9k)BD%9 z%IZHcQ^6IcC>L#lbi4jEsaOfY`MeLpxQE=1&kMiECaBPYp~J=9isNB3TpiI@Ha9KN zPkW@!wny4|Krlqv$kg*UnWXLUB*ZZU<-^2m(fWXVzJJ7GkPl*P^|ozp?hO{c62NSo?p4fz-YP!~Y)$*wgf1pp81|{))m_cL3QhPz_9+ w|64<1cTnm*;T_d4!)+NrW87;OAy5uIHab57wMaDs#?iplu3RpJ-FWc70E5K-d;kCd literal 0 HcmV?d00001 diff --git a/docs/security/security-components-guidelines.md b/docs/security/security-components-guidelines.md new file mode 100644 index 0000000..c173f6b --- /dev/null +++ b/docs/security/security-components-guidelines.md @@ -0,0 +1,128 @@ +# 安全组件开发指导 + + +## 场景介绍 + +安全组件是OpenHarmony提供的一组系统实现的ArkUI基础组件,应用集成这类组件就可以实现在用户点击后自动授权,而无需弹窗授权。 + +目前有三类安全组件,分别是位置组件(LocationButton)、粘贴组件(PasteButton)、保存组件(SaveButton),分别对应精准定位、剪贴板读取、媒体库写入三类特权,下面分别说明这三种使用场景。 + +- 位置组件(LocationButton) + +应用集成位置组件后,用户点击该组件,不管应用有没有申请过或者授予精准定位权限,都会在本次前台期间获得精准定位的授权,可以调用位置服务获取精准定位。精准定位的临时授权会持续到灭屏、应用切后台、应用退出等任一情况发生,之后恢复到临时授权之前的授权状态(授予/未授予/未申请)。应用在授权期间没有调用特权接口的次数限制。 + +使用场景:应用本身不是强位置关联应用(如导航、运动健康等),仅在"部分场景前台"需要使用位置信息(如:定位城市、打卡、分享位置等),如果需要长时间或者后台使用位置信息,建议申请权限。 + +- 粘贴组件(PasteButton) + +应用集成粘贴组件后,用户点击该组件,应用读取剪贴板数据时不会弹出toast提示,直到新的数据被写入剪贴板为止(如用户复制了新的数据),灭屏、应用切后台、应用退出不影响授权,应用在授权期间没有次数限制。 + +使用场景:粘贴组件可以用于任何应用需要读取剪贴板的场景,避免toast提示对用户造成干扰。 + +- 保存组件(SaveButton) + +应用集成保存组件后,用户点击该组件,应用会获取5秒内单次访问媒体库特权接口的授权。 + +开发者需要注意两点: + +1. 应用在onClick()触发回调到调用媒体库特权接口的时间间隔不大于5秒。 + +2. 用户点击一次仅获取一次授权调用,应用如需要创建多个文件,需要使用单次创建多文件接口。 + +3. 使用场景:保存组件可以用于任何应用需要保存文件到媒体库的场景(下载、保存图片、保存文档、保存音视频等),区别于使用filepicker方式(filepicker需要拉起系统应用,再由用户选择具体路径保存文件),安全组件操作更快捷。 + + +## 创建方式 + +安全组件是由图标(icon)、文本(text)、背景(buttonType)组成的类似button的按钮,其中图标、文本两者至少有其一,背景是可选的。图标和文本不支持自定义,仅支持在已有的选项中选择。应用申明安全组件的接口时,分为传参和不传参两种,不传参默认创建图标+文字+背景的按钮,传参根据传入的参数创建,不包含没有配置的元素。 + +例如保存组件: + +``` +/* 默认样式 */ +SaveButton() + +/* 自定义样式 icon、text、buttonType都是可选项,配置即存在,不配置即不存在*/ +SaveButton(options: SaveButtonOptions) + +/* 只有图标的样式 */ +SaveButton({ icon:SaveIconStyle.FULL_FILLED }) + +/* 只有文字和图标的样式 */ +SaveButton({ icon:SaveIconStyle.FULL_FILLED, text:SaveDescription.DOWNLOAD }) +``` + + +## 公共属性 + +安全组件有公共的UX属性,应用可以通过这些属性定制样式。 + +| 属性名 | 描述 | +| -------- | -------- | +| iconSize(value: Dimension) | 设置安全组件的图标尺寸 | +| layoutDirection(value: SecurityComponentLayoutDirection) | 设置安全组件上图标和文字分布的方向 | +| position(value: Position) | 设置绝对定位 | +| markAnchor(value: Position) | 设置绝对定位的锚点 | +| offset(value: Position) | 设置相对定位 | +| fontSize(value: Dimension) | 设置安全组件上的文字尺寸 | +| fontStyle(value: FontStyle) | 设置安全组件上的文字样式 | +| fontWeight(value: number \| FontWeight \| string) | 设置安全组件上文字粗细 | +| fontFamily(value: string \| Resource) | 设置安全组件上文字的字体 | +| fontColor(value: ResourceColor) | 设置安全组件上文字颜色 | +| iconColor(value: ResourceColor) | 设置安全组件上图标颜色 | +| backgroundColor(value: ResourceColor) | 设置安全组件的背景颜色 | +| borderStyle(value: BorderStyle) | 设置安全组件边框的样式 | +| borderWidth(value: Dimension) | 设置安全组件边框的宽度 | +| borderColor(value: ResourceColor) | 设置安全组件的边框颜色 | +| borderColor(value: ResourceColor) | 设置安全组件的边框圆角半径 | +| padding(value: Padding \| Dimension) | 设置安全组件的内边距 | +| textIconSpace(value: Dimension) | 设置安全组件中图标和文字的间距 | + + +## 开发步骤 + +1. ets文件中声明安全组件。 + ``` + LocationButton() + ``` + +2. 配置安全组件的属性。 + ``` + LocationButton().iconSize(15.0) + ``` + +3. 注册onCLick回调,回调中调用特权接口,以位置组件为例,获取定位信息。 + ``` + import geoLocationManager from '@ohos.geoLocationManager'; + @Entry + @Component + struct locationButton { + build() { + Row() { + Column() { + LocationButton({ icon: LocationIconStyle.FULL_FILLED }).iconSize(15.0) + .onClick((event: ClickEvent, result: LocationButtonOnClickResult) => { + if (result == LocationButtonOnClickResult.SUCCESS) { + /* 示例接口来自js-apis-geoLocationManager.md#currentlocationrequest */ + let requestInfo = { 'priority': 0x203, 'scenario': 0x300, 'maxAccuracy': 0 }; + let locationChange = (err, location) => { + if (err) { + console.log('locationChanger: err=' + JSON.stringify(err)); + } + if (location) { + console.log('locationChanger: location=' + JSON.stringify(location)); + } + }; + + try { + geoLocationManager.getCurrentLocation(requestInfo, locationChange); + } catch (err) { + console.error("errCode:" + err.code + ",errMessage:" + err.message); + } + } + }) + } + } + } + } + ``` diff --git a/docs/security/security-components-overview.md b/docs/security/security-components-overview.md new file mode 100644 index 0000000..3cf2a5a --- /dev/null +++ b/docs/security/security-components-overview.md @@ -0,0 +1,63 @@ +# 安全组件开发概述 + + +安全组件是OpenHarmony提供的一组系统实现的ArkUI基础组件。当用户点击了这类组件后,应用将被授予临时授权,应用开发者仅需要像使用Button等组件那样集成到应用自己的页面即可。 + + +当前提供了三种安全组件: + + +- 位置组件:获取精准定位授权。 + +- 粘贴组件:获取读取剪贴板授权。 + +- 保存组件:获取媒体库写入授权。 + + +安全组件可以作为一种"特殊的按钮"融入应用页面,无需向用户弹窗授权,实现用户点击即许可的设计思路。精准的场景可以避免权限的滥用,保护用户隐私,同时也减少了弹窗对用户的干扰。 + + +应用集成安全组件后,注册OnClick回调监听用户点击。当用户点击后,安全组件底层将申请权限,并将结果返回给应用。如果成功,应用可以临时使用需要特权的接口。 + + +说明:不同类型的安全组件,对于权限的使用方式不同、授权的有效期也不同,详情请参考开发指导。 + + +安全组件因其自动授权的特性,为了保障用户的隐私不被恶意应用获取,针对安全组件作了很多的限制,例如尺寸不能过小、颜色不能透明等等,确保安全组件是可见的且用户能够识别的,所以三方开发者需要合理的配置组件的尺寸、颜色等属性,避免视觉混淆的情况,如果发生因组件的样式不合法导致授权失败的情况,请检查设备错误日志。 + + +## 技术框架 + +安全组件特性方案有2个主要部件构成。 + +- 安全组件实现: + 集成在ArkUI中,提供ETS接口负责安全组件的生成、属性配置、布局、绘制、点击回调、销毁等功能。 + +- 安全组件管理服务: + 独立的服务进程,负责安全组件的注册、临时授权、取消授权、取消注册等管理,以及合法性检查。 + + +## 运作流程 + +![zh-cn_image_0000001566651300](figures/zh-cn_image_0000001566651300.png) + +1. 应用开发者在ETS文件中集成安全组件,通过JS引擎解析后,在ArkUI框架中生成具体的组件。 + +2. 安全组件注册组件信息到安全组件管理服务,安全组件管理服务检查组件信息的合法性。 + +3. 用户点击事件分发到安全组件。 + +4. 安全组件将点击事件上报到安全组件管理服务。 + +5. 安全组件管理服务根据组件种类对应不同权限,调用权限管理服务进行临时授权。 + +6. 授权成功后,安全组件回调OnClick通知应用层授权成功。 + +7. 应用调用相应的特权操作,如获取地理位置、读取剪贴板信息、媒体库中创建文件等。 + +8. 对应的服务会调用权限管理服务或安全组件管理服务,获取授权结果,返回鉴权结果。 + + +## 约束与限制 + +应用开发者需尽量保证安全组件在应用界面上清晰可见,防止因覆盖、混淆等因素导致授权失败。 diff --git a/frameworks/BUILD.gn b/frameworks/BUILD.gn deleted file mode 100644 index 866b79a..0000000 --- a/frameworks/BUILD.gn +++ /dev/null @@ -1,94 +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("//build/ohos.gni") - -sec_comp_root_dir = ".." - -config("libsecurity_component_framework_config") { - include_dirs = [ - "common/include", - "${sec_comp_root_dir}/interfaces/inner_api/security_component/include", - ] -} - -ohos_shared_library("libsecurity_component_framework") { - subsystem_name = "security" - part_name = "security_component" - output_name = "libsecurity_component_framework" - - include_dirs = [ - "common/include", - "security_component/include", - "${sec_comp_root_dir}/interfaces/inner_api/security_component/include", - "//third_party/json/include", - ] - - sources = [ - "common/src/sec_comp_tool.cpp", - "security_component/src/location_button.cpp", - "security_component/src/paste_button.cpp", - "security_component/src/save_button.cpp", - "security_component/src/sec_comp_base.cpp", - "security_component/src/sec_comp_click_event_parcel.cpp", - ] - - configs = [ "${sec_comp_root_dir}/config:coverage_flags" ] - public_configs = [ ":libsecurity_component_framework_config" ] - - external_deps = [ - "c_utils:utils", - "hilog:libhilog", - ] - - cflags_cc = [ "-DHILOG_ENABLE" ] -} - -config("libsecurity_component_enhance_adapter_config") { - include_dirs = [ - "common/include", - "enhance_adapter/include", - "${sec_comp_root_dir}/interfaces/inner_api/security_component/include", - "//third_party/json/include" - ] -} - -ohos_shared_library("libsecurity_component_enhance_adapter") { - subsystem_name = "security" - part_name = "security_component" - output_name = "libsecurity_component_enhance_adapter" - - include_dirs = [ - "common/include", - "enhance_adapter/include", - "${sec_comp_root_dir}/interfaces/inner_api/security_component/include", - "//third_party/json/include" - ] - - sources = [ "enhance_adapter/src/sec_comp_enhance_adapter.cpp" ] - - configs = [ "${sec_comp_root_dir}/config:coverage_flags" ] - public_configs = [ ":libsecurity_component_enhance_adapter_config" ] - - external_deps = [ - "c_utils:utils", - "hilog:libhilog", - "ipc:ipc_single", - ] - - cflags_cc = [ "-DHILOG_ENABLE" ] - - if (current_cpu == "arm64") { - defines = [ "_ARM64_" ] - } -} diff --git a/frameworks/common/include/sec_comp_err.h b/frameworks/common/include/sec_comp_err.h deleted file mode 100644 index 8cacb68..0000000 --- a/frameworks/common/include/sec_comp_err.h +++ /dev/null @@ -1,54 +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. - */ -#ifndef FRAMEWORKS_COMMON_SECURITY_COMPONENT_ERR_H -#define FRAMEWORKS_COMMON_SECURITY_COMPONENT_ERR_H - -#include - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -enum SCErrCode : int32_t { - SC_OK = 0, - - SC_SERVICE_ERROR_VALUE_INVALID = -50, - SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL = -51, - SC_SERVICE_ERROR_MEMORY_OPERATE_FAIL = -52, - SC_SERVICE_ERROR_IPC_REQUEST_FAIL = -54, - SC_SERVICE_ERROR_SERVICE_NOT_EXIST = -55, - SC_SERVICE_ERROR_COMPONENT_INFO_INVALID = -56, - SC_SERVICE_ERROR_COMPONENT_RECT_OVERLAP = -57, - SC_SERVICE_ERROR_COMPONENT_NOT_EXIST = -58, - SC_SERVICE_ERROR_PERMISSION_OPER_FAIL = -59, - SC_SERVICE_ERROR_CLICK_EVENT_INVALID = -60, - SC_SERVICE_ERROR_COMPONENT_INFO_NOT_EQUAL = -61, - SC_SERVICE_ERROR_CALLER_INVALID = -62, - - SC_ENHANCE_ERROR_NOT_EXIST_ENHANCE = -100, - SC_ENHANCE_ERROR_VALUE_INVALID = -101, - SC_ENHANCE_ERROR_OPER_FAIL = -102, - SC_ENHANCE_ERROR_CALLBACK_REDIRECT = -103, - SC_ENHANCE_ERROR_CALLBACK_REGIST_FAIL = -104, - SC_ENHANCE_ERROR_CALLBACK_HAS_EXIST = -105, - SC_ENHANCE_ERROR_CALLBACK_NOT_EXIST = -106, - SC_ENHANCE_ERROR_CALLBACK_OPER_FAIL = -107, - SC_ENHANCE_ERROR_CALLBACK_CHECK_FAIL = -108, - SC_ENHANCE_ERROR_IN_MALICIOUS_LIST = -109, - SC_ENHANCE_ERROR_CHALLENGE_CHECK_FAIL = -110 -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // FRAMEWORKS_COMMON_SECURITY_COMPONENT_ERR_H diff --git a/frameworks/common/include/sec_comp_log.h b/frameworks/common/include/sec_comp_log.h deleted file mode 100644 index 71ab801..0000000 --- a/frameworks/common/include/sec_comp_log.h +++ /dev/null @@ -1,62 +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. - */ -#ifndef SECURITY_COMPONENT_LOG_H -#define SECURITY_COMPONENT_LOG_H - -#ifdef HILOG_ENABLE - -#include "hilog/log.h" - -#ifndef __cplusplus - -#undef LOG_DOMAIN -#define LOG_DOMAIN 0xD002F07 - -#define SC_LOG_DEBUG(fmt, ...) HILOG_DEBUG(LOG_CORE, "[%{public}s]:" fmt, __func__, ##__VA_ARGS__) -#define SC_LOG_INFO(fmt, ...) HILOG_INFO(LOG_CORE, "[%{public}s]:" fmt, __func__, ##__VA_ARGS__) -#define SC_LOG_WARN(fmt, ...) HILOG_WARN(LOG_CORE, "[%{public}s]:" fmt, __func__, ##__VA_ARGS__) -#define SC_LOG_ERROR(fmt, ...) HILOG_ERROR(LOG_CORE, "[%{public}s]:" fmt, __func__, ##__VA_ARGS__) -#define SC_LOG_FATAL(fmt, ...) HILOG_FATAL(LOG_CORE, "[%{public}s]:" fmt, __func__, ##__VA_ARGS__) - -#else - -static constexpr unsigned int SECURITY_DOMAIN_SECURITY_COMPONENT = 0xD002F07; - -#define SC_LOG_DEBUG(label, fmt, ...) \ - OHOS::HiviewDFX::HiLog::Debug(label, "[%{public}s]:" fmt, __func__, ##__VA_ARGS__) -#define SC_LOG_INFO(label, fmt, ...) OHOS::HiviewDFX::HiLog::Info(label, "[%{public}s]:" fmt, __func__, ##__VA_ARGS__) -#define SC_LOG_WARN(label, fmt, ...) OHOS::HiviewDFX::HiLog::Warn(label, "[%{public}s]:" fmt, __func__, ##__VA_ARGS__) -#define SC_LOG_ERROR(label, fmt, ...) \ - OHOS::HiviewDFX::HiLog::Error(label, "[%{public}s]:" fmt, __func__, ##__VA_ARGS__) -#define SC_LOG_FATAL(label, fmt, ...) \ - OHOS::HiviewDFX::HiLog::Fatal(label, "[%{public}s]:" fmt, __func__, ##__VA_ARGS__) - -#endif // __cplusplus - -#else - -#include - -#undef LOG_TAG - -#define SC_LOG_DEBUG(fmt, ...) printf("[%s] debug: %s: " fmt "\n", LOG_TAG, __func__, ##__VA_ARGS__) -#define SC_LOG_INFO(fmt, ...) printf("[%s] info: %s: " fmt "\n", LOG_TAG, __func__, ##__VA_ARGS__) -#define SC_LOG_WARN(fmt, ...) printf("[%s] warn: %s: " fmt "\n", LOG_TAG, __func__, ##__VA_ARGS__) -#define SC_LOG_ERROR(fmt, ...) printf("[%s] error: %s: " fmt "\n", LOG_TAG, __func__, ##__VA_ARGS__) -#define SC_LOG_FATAL(fmt, ...) printf("[%s] fatal: %s: " fmt "\n", LOG_TAG, __func__, ##__VA_ARGS__) - -#endif // HILOG_ENABLE - -#endif // SECURITY_COMPONENT_LOG_H diff --git a/frameworks/common/include/sec_comp_tool.h b/frameworks/common/include/sec_comp_tool.h deleted file mode 100644 index 197f67d..0000000 --- a/frameworks/common/include/sec_comp_tool.h +++ /dev/null @@ -1,28 +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. - */ -#ifndef SECURITY_COMPONENT_TOOL_H -#define SECURITY_COMPONENT_TOOL_H - -#include "sec_comp_info.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { - bool IsColorSimilar(const SecCompColor& color1, const SecCompColor& color2); - bool IsColorTransparent(const SecCompColor& color); -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // SECURITY_COMPONENT_TOOL_H diff --git a/frameworks/common/src/sec_comp_tool.cpp b/frameworks/common/src/sec_comp_tool.cpp deleted file mode 100644 index 36d45c4..0000000 --- a/frameworks/common/src/sec_comp_tool.cpp +++ /dev/null @@ -1,142 +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 "sec_comp_tool.h" - -#include -#include -#include "sec_comp_log.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -namespace { -static constexpr double PI_CIRCLE = 3.1415926; -static constexpr double MIN_HSV_DISTANCE = 25.0; -static constexpr double MAX_RGB_VALUE = 255.0; -static constexpr uint8_t MAX_TRANSPARENT = 0x99; // 60% -static constexpr double ZERO_DOUBLE = 0.0; -static constexpr double THIRTY_ANGLE = 30.0; -static constexpr double SIXTY_ANGLE = 60.0; -static constexpr double ONE_HUNDRED_TWEENTY_ANGLE = 120.0; -static constexpr double ONE_HUNDRED_EIGHTY_ANGLE = 180.0; -static constexpr double TWO_HUNDREDS_FORTY_ANGLE = 240.0; -static constexpr double THREE_HUNDREDS_SIXTY_ANGLE = 360.0; -static constexpr double DEFAULT_R = 100.0; - -constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompTool"}; -} - -static inline double MaxValue(double a, double b, double c) -{ - return ((a > b) ? ((a > c) ? a : c) : ((b > c) ? b : c)); -} - -static inline double MinValue(double a, double b, double c) -{ - return ((a < b) ? ((a < c) ? a : c) : ((b < c) ? b : c)); -} - -struct HsvColor { - double h; - double s; - double v; -}; - -static HsvColor RgbToHsv(uint8_t r, uint8_t g, uint8_t b) -{ - HsvColor hsv; - double red = static_cast(r) / MAX_RGB_VALUE; - double green = static_cast(g) / MAX_RGB_VALUE; - double blue = static_cast(b) / MAX_RGB_VALUE; - double max = MaxValue(red, green, blue); - double min = MinValue(red, green, blue); - double delta = max - min; - if (max == min) { - hsv.h = ZERO_DOUBLE; - } else if (max == red) { - hsv.h = fmod((SIXTY_ANGLE * ((green - blue) / delta) + THREE_HUNDREDS_SIXTY_ANGLE), - THREE_HUNDREDS_SIXTY_ANGLE); - } else if (max == green) { - hsv.h = fmod((SIXTY_ANGLE * ((blue - red) / delta) + ONE_HUNDRED_TWEENTY_ANGLE), THREE_HUNDREDS_SIXTY_ANGLE); - } else if (max == blue) { - hsv.h = fmod((SIXTY_ANGLE * ((red - green) / delta) + TWO_HUNDREDS_FORTY_ANGLE), THREE_HUNDREDS_SIXTY_ANGLE); - } - - if (max == 0) { - hsv.s = ZERO_DOUBLE; - } else { - hsv.s = delta / max; - } - - hsv.v = max; - return hsv; -} - -static inline double GetHsvDisX(const HsvColor& hsv, double r) -{ - return r * hsv.v * hsv.s * cos(hsv.h / ONE_HUNDRED_EIGHTY_ANGLE * PI_CIRCLE); -} - -static inline double GetHsvDisY(const HsvColor& hsv, double r) -{ - return r * hsv.v * hsv.s * sin(hsv.h / ONE_HUNDRED_EIGHTY_ANGLE * PI_CIRCLE); -} - -static inline double GetHsvDisZ(const HsvColor& hsv, double h) -{ - return h * (1 - hsv.v); -} - -static double HsvDistance(const HsvColor& hsv1, const HsvColor& hsv2) -{ - double rDef = DEFAULT_R; - double angle = THIRTY_ANGLE; - double h = rDef * cos(angle / ONE_HUNDRED_EIGHTY_ANGLE * PI_CIRCLE); - double r = rDef * sin(angle / ONE_HUNDRED_EIGHTY_ANGLE * PI_CIRCLE); - - double x1 = GetHsvDisX(hsv1, r); - double y1 = GetHsvDisY(hsv1, r); - double z1 = GetHsvDisZ(hsv1, h); - - double x2 = GetHsvDisX(hsv2, r); - double y2 = GetHsvDisY(hsv2, r); - double z2 = GetHsvDisZ(hsv2, h); - - double dx = x1 - x2; - double dy = y1 - y2; - double dz = z1 - z2; - - return sqrt((dx * dx) + (dy * dy) + (dz * dz)); -} - -bool IsColorSimilar(const SecCompColor& color1, const SecCompColor& color2) -{ - HsvColor hsv1 = RgbToHsv(color1.argb.red, color1.argb.green, color1.argb.blue); - HsvColor hsv2 = RgbToHsv(color2.argb.red, color2.argb.green, color2.argb.blue); - - double distance = HsvDistance(hsv1, hsv2); - SC_LOG_DEBUG(LABEL, "Compare color %{public}x %{public}x distance %{public}f", - color1.value, color2.value, distance); - return (distance < MIN_HSV_DISTANCE); -} - -bool IsColorTransparent(const SecCompColor& color) -{ - SC_LOG_DEBUG(LABEL, "Color %{public}x alpha %{public}x", color.value, color.argb.alpha); - return color.argb.alpha < MAX_TRANSPARENT; -} -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS diff --git a/frameworks/enhance_adapter/include/sec_comp_enhance_adapter.h b/frameworks/enhance_adapter/include/sec_comp_enhance_adapter.h deleted file mode 100644 index faada7e..0000000 --- a/frameworks/enhance_adapter/include/sec_comp_enhance_adapter.h +++ /dev/null @@ -1,122 +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. - */ -#ifndef SECURITY_COMPONENT_ENHANCE_ADAPTER_H -#define SECURITY_COMPONENT_ENHANCE_ADAPTER_H - -#include -#include "iremote_object.h" -#include "nlohmann/json.hpp" -#include "sec_comp_base.h" -#include "sec_comp_info.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -enum EnhanceInterfaceType { - SEC_COMP_ENHANCE_INPUT_INTERFACE = 0, - SEC_COMP_ENHANCE_SRV_INTERFACE = 1, - SEC_COMP_ENHANCE_CLIENT_INTERFACE = 2, -}; - -// for multimodalinput to add enhance data to PointerEvent -class SecCompInputEnhanceInterface { -public: - // for multimodalinput to set enhance cfg which is from security component enhance service - virtual int32_t SetEnhanceCfg(uint8_t* cfg, uint32_t cfgLen) = 0; - - // for multimodalinput to get enhance data - virtual int32_t GetPointerEventEnhanceData(void* data, uint32_t dataLen, - uint8_t* enhanceData, uint32_t& enHancedataLen) = 0; -}; - -// for security component service to send command to enhance service -class SecCompSrvEnhanceInterface { - public: - // enable input enhance, then enhance service send config to multimodalinput - virtual int32_t EnableInputEnhance() = 0; - - // disable input enhance - virtual int32_t DisableInputEnhance() = 0; - - // send click event to enhance service for checking extra data validity - virtual int32_t CheckExtraInfo(const SecCompClickEvent& touchInfo) = 0; - - // send component info to enhance service for checking its validity - virtual int32_t CheckComponentInfoEnhnace(int32_t pid, std::shared_ptr& compInfo, - const nlohmann::json& jsonComponent) = 0; - - // get RemoteObject of enhance service to connect it - virtual sptr GetEnhanceRemoteObject() = 0; - - // start enhance service - virtual void StartEnhanceService() = 0; - - // exit enhance service - virtual void ExitEnhanceService() = 0; - - // notify process died - virtual void NotifyProcessDied(int32_t pid) = 0; -}; - -// for client -class SecCompClientEnhanceInterface { -public: - // preprocess component info which is send to security component service, e.g. RegisterSecurityComponent - virtual bool EnhanceDataPreprocess(const uintptr_t caller, std::string& componentInfo) = 0; - virtual bool EnhanceDataPreprocess(const uintptr_t caller, int32_t scId, std::string& componentInfo) = 0; - - // regiter scid to enhance client - virtual void RegisterScIdEnhance(const uintptr_t caller, int32_t scId) = 0; - // unregiter scid to enhance client - virtual void UnregisterScIdEnhance(const uintptr_t caller, int32_t scId) = 0; -}; - -class SecCompEnhanceAdapter final { -public: - static void InitEnhanceHandler(EnhanceInterfaceType type); - static int32_t SetEnhanceCfg(uint8_t* cfg, uint32_t cfgLen); - static int32_t GetPointerEventEnhanceData(void* data, uint32_t dataLen, - uint8_t* enhanceData, uint32_t& enHancedataLen); - - static int32_t CheckExtraInfo(const SecCompClickEvent& touchInfo); - static int32_t EnableInputEnhance(); - static int32_t DisableInputEnhance(); - static int32_t CheckComponentInfoEnhnace(int32_t pid, std::shared_ptr& compInfo, - const nlohmann::json& jsonComponent); - static sptr GetEnhanceRemoteObject(); - static void StartEnhanceService(); - static void ExistEnhanceService(); - static void NotifyProcessDied(int32_t pid); - - static bool EnhanceDataPreprocess(std::string& componentInfo); - static bool EnhanceDataPreprocess(int32_t scId, std::string& componentInfo); - static void RegisterScIdEnhance(int32_t scId); - static void UnregisterScIdEnhance(int32_t scId); - - static SecCompInputEnhanceInterface* inputHandler; - static bool isEnhanceInputHandlerInit; - - static SecCompSrvEnhanceInterface* srvHandler; - static bool isEnhanceSrvHandlerInit; - - static SecCompClientEnhanceInterface* clientHandler; - static bool isEnhanceClientHandlerInit; - - static std::mutex initMtx; -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // SECURITY_COMPONENT_ENHANCE_ADAPTER_H diff --git a/frameworks/enhance_adapter/src/sec_comp_enhance_adapter.cpp b/frameworks/enhance_adapter/src/sec_comp_enhance_adapter.cpp deleted file mode 100644 index 28d1aa9..0000000 --- a/frameworks/enhance_adapter/src/sec_comp_enhance_adapter.cpp +++ /dev/null @@ -1,235 +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 "sec_comp_enhance_adapter.h" - -#include -#include "sec_comp_err.h" -#include "sec_comp_log.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -namespace { -static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { - LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompEnhanceAdapter"}; - -#ifdef _ARM64_ -static const std::string LIB_PATH = "/system/lib64/"; -#else -static const std::string LIB_PATH = "/system/lib/"; -#endif -static const std::string ENHANCE_INPUT_INTERFACE_LIB = LIB_PATH + "libsec_comp_input_enhance.z.so"; -static const std::string ENHANCE_SRV_INTERFACE_LIB = LIB_PATH + "libsec_comp_service_enhance.z.so"; -static const std::string ENHANCE_CLIENT_INTERFACE_LIB = LIB_PATH + "libsec_comp_client_enhance.z.so"; -} - -SecCompInputEnhanceInterface* SecCompEnhanceAdapter::inputHandler = nullptr; -bool SecCompEnhanceAdapter::isEnhanceInputHandlerInit = false; - -SecCompSrvEnhanceInterface* SecCompEnhanceAdapter::srvHandler = nullptr; -bool SecCompEnhanceAdapter::isEnhanceSrvHandlerInit = false; - -SecCompClientEnhanceInterface* SecCompEnhanceAdapter::clientHandler = nullptr; -bool SecCompEnhanceAdapter::isEnhanceClientHandlerInit = false; - -std::mutex SecCompEnhanceAdapter::initMtx; - -void SecCompEnhanceAdapter::InitEnhanceHandler(EnhanceInterfaceType type) -{ - std::unique_lock lck(initMtx); - std::string libPath = ""; - switch (type) { - case SEC_COMP_ENHANCE_INPUT_INTERFACE: - libPath = ENHANCE_INPUT_INTERFACE_LIB; - isEnhanceInputHandlerInit = true; - break; - case SEC_COMP_ENHANCE_SRV_INTERFACE: - libPath = ENHANCE_SRV_INTERFACE_LIB; - isEnhanceSrvHandlerInit = true; - break; - case SEC_COMP_ENHANCE_CLIENT_INTERFACE: - libPath = ENHANCE_CLIENT_INTERFACE_LIB; - isEnhanceClientHandlerInit = true; - break; - default: - break; - } - if (dlopen(libPath.c_str(), RTLD_LAZY) == nullptr) { - SC_LOG_ERROR(LABEL, "init enhance lib %{public}s failed, error %{public}s", libPath.c_str(), dlerror()); - } -} - -int32_t SecCompEnhanceAdapter::SetEnhanceCfg(uint8_t* cfg, uint32_t cfgLen) -{ - if (!isEnhanceInputHandlerInit) { - InitEnhanceHandler(SEC_COMP_ENHANCE_INPUT_INTERFACE); - } - if (inputHandler != nullptr) { - return inputHandler->SetEnhanceCfg(cfg, cfgLen); - } - return SC_ENHANCE_ERROR_NOT_EXIST_ENHANCE; -} - -int32_t SecCompEnhanceAdapter::GetPointerEventEnhanceData(void* data, uint32_t dataLen, - uint8_t* enhanceData, uint32_t& enHancedataLen) -{ - if (!isEnhanceInputHandlerInit) { - InitEnhanceHandler(SEC_COMP_ENHANCE_INPUT_INTERFACE); - } - if (inputHandler != nullptr) { - return inputHandler->GetPointerEventEnhanceData(data, dataLen, enhanceData, enHancedataLen); - } - return SC_ENHANCE_ERROR_NOT_EXIST_ENHANCE; -} - -int32_t SecCompEnhanceAdapter::CheckExtraInfo(const SecCompClickEvent& touchInfo) -{ - if (!isEnhanceSrvHandlerInit) { - InitEnhanceHandler(SEC_COMP_ENHANCE_SRV_INTERFACE); - } - if (srvHandler != nullptr) { - return srvHandler->CheckExtraInfo(touchInfo); - } - return SC_ENHANCE_ERROR_NOT_EXIST_ENHANCE; -} - -bool SecCompEnhanceAdapter::EnhanceDataPreprocess(std::string& componentInfo) -{ - if (!isEnhanceClientHandlerInit) { - InitEnhanceHandler(SEC_COMP_ENHANCE_CLIENT_INTERFACE); - } - - uintptr_t enhanceCallerAddr = reinterpret_cast(__builtin_return_address(0)); - if (clientHandler != nullptr) { - return clientHandler->EnhanceDataPreprocess(enhanceCallerAddr, componentInfo); - } - return true; -} - -bool SecCompEnhanceAdapter::EnhanceDataPreprocess(int32_t scId, std::string& componentInfo) -{ - if (!isEnhanceClientHandlerInit) { - InitEnhanceHandler(SEC_COMP_ENHANCE_CLIENT_INTERFACE); - } - - uintptr_t enhanceCallerAddr = reinterpret_cast(__builtin_return_address(0)); - if (clientHandler != nullptr) { - return clientHandler->EnhanceDataPreprocess(enhanceCallerAddr, scId, componentInfo); - } - return true; -} - -void SecCompEnhanceAdapter::RegisterScIdEnhance(int32_t scId) -{ - if (!isEnhanceClientHandlerInit) { - InitEnhanceHandler(SEC_COMP_ENHANCE_CLIENT_INTERFACE); - } - - uintptr_t enhanceCallerAddr = reinterpret_cast(__builtin_return_address(0)); - if (clientHandler != nullptr) { - clientHandler->RegisterScIdEnhance(enhanceCallerAddr, scId); - } -} - -void SecCompEnhanceAdapter::UnregisterScIdEnhance(int32_t scId) -{ - if (!isEnhanceClientHandlerInit) { - InitEnhanceHandler(SEC_COMP_ENHANCE_CLIENT_INTERFACE); - } - - uintptr_t enhanceCallerAddr = reinterpret_cast(__builtin_return_address(0)); - if (clientHandler != nullptr) { - clientHandler->UnregisterScIdEnhance(enhanceCallerAddr, scId); - } -} - -int32_t SecCompEnhanceAdapter::EnableInputEnhance() -{ - if (!isEnhanceSrvHandlerInit) { - InitEnhanceHandler(SEC_COMP_ENHANCE_SRV_INTERFACE); - } - if (srvHandler != nullptr) { - return srvHandler->EnableInputEnhance(); - } - return SC_ENHANCE_ERROR_NOT_EXIST_ENHANCE; -} - -int32_t SecCompEnhanceAdapter::DisableInputEnhance() -{ - if (!isEnhanceSrvHandlerInit) { - InitEnhanceHandler(SEC_COMP_ENHANCE_SRV_INTERFACE); - } - if (srvHandler != nullptr) { - return srvHandler->DisableInputEnhance(); - } - return SC_ENHANCE_ERROR_NOT_EXIST_ENHANCE; -} - -void SecCompEnhanceAdapter::StartEnhanceService() -{ - if (!isEnhanceSrvHandlerInit) { - InitEnhanceHandler(SEC_COMP_ENHANCE_SRV_INTERFACE); - } - if (srvHandler != nullptr) { - srvHandler->StartEnhanceService(); - } -} - -void SecCompEnhanceAdapter::ExistEnhanceService() -{ - if (!isEnhanceSrvHandlerInit) { - InitEnhanceHandler(SEC_COMP_ENHANCE_SRV_INTERFACE); - } - if (srvHandler != nullptr) { - srvHandler->ExitEnhanceService(); - } -} - -void SecCompEnhanceAdapter::NotifyProcessDied(int32_t pid) -{ - if (!isEnhanceSrvHandlerInit) { - InitEnhanceHandler(SEC_COMP_ENHANCE_SRV_INTERFACE); - } - if (srvHandler != nullptr) { - srvHandler->NotifyProcessDied(pid); - } -} - -int32_t SecCompEnhanceAdapter::CheckComponentInfoEnhnace(int32_t pid, - std::shared_ptr& compInfo, const nlohmann::json& jsonComponent) -{ - if (!isEnhanceSrvHandlerInit) { - InitEnhanceHandler(SEC_COMP_ENHANCE_SRV_INTERFACE); - } - if (srvHandler != nullptr) { - return srvHandler->CheckComponentInfoEnhnace(pid, compInfo, jsonComponent); - } - return SC_OK; -} - -sptr SecCompEnhanceAdapter::GetEnhanceRemoteObject() -{ - if (!isEnhanceSrvHandlerInit) { - InitEnhanceHandler(SEC_COMP_ENHANCE_SRV_INTERFACE); - } - if (srvHandler != nullptr) { - auto service = srvHandler->GetEnhanceRemoteObject(); - return service; - } - return nullptr; -} -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS diff --git a/frameworks/security_component/include/sec_comp_click_event_parcel.h b/frameworks/security_component/include/sec_comp_click_event_parcel.h deleted file mode 100644 index ea39a20..0000000 --- a/frameworks/security_component/include/sec_comp_click_event_parcel.h +++ /dev/null @@ -1,38 +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. - */ -#ifndef SECURITY_COMPONENT_CLICK_INFO_PARCEL_H -#define SECURITY_COMPONENT_CLICK_INFO_PARCEL_H - -#include "parcel.h" -#include "sec_comp_info.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -struct SecCompClickEventParcel final : public Parcelable { - SecCompClickEventParcel() = default; - - ~SecCompClickEventParcel() override = default; - - bool Marshalling(Parcel& out) const override; - - static SecCompClickEventParcel* Unmarshalling(Parcel& in); - - SecCompClickEvent touchInfoParams_; -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // SECURITY_COMPONENT_CLICK_INFO_PARCEL_H diff --git a/frameworks/security_component/src/location_button.cpp b/frameworks/security_component/src/location_button.cpp deleted file mode 100644 index b62b9e9..0000000 --- a/frameworks/security_component/src/location_button.cpp +++ /dev/null @@ -1,53 +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 "location_button.h" - -#include -#include "sec_comp_log.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -namespace { -constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "LocationButton"}; -} - -bool LocationButton::IsParamValid() -{ - if ((text_ <= UNKNOWN_TEXT) || (static_cast(text_) >= LocationDesc::MAX_LABEL_TYPE) || - (icon_ <= UNKNOWN_ICON) || (static_cast(icon_) >= LocationIcon::MAX_ICON_TYPE)) { - return false; - } - - return true; -} - -bool LocationButton::CompareComponentBasicInfo(SecCompBase *other, bool isRectCheck) const -{ - if (!SecCompBase::CompareComponentBasicInfo(other, isRectCheck)) { - SC_LOG_ERROR(LABEL, "SecComp base not equal."); - return false; - } - LocationButton* otherLocationButton = reinterpret_cast(other); - if (otherLocationButton == nullptr) { - SC_LOG_ERROR(LABEL, "other is not location button."); - return false; - } - return (icon_ == otherLocationButton->icon_) && (text_ == otherLocationButton->text_) && - (bg_ == otherLocationButton->bg_); -} -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS diff --git a/frameworks/security_component/src/paste_button.cpp b/frameworks/security_component/src/paste_button.cpp deleted file mode 100644 index 41941dc..0000000 --- a/frameworks/security_component/src/paste_button.cpp +++ /dev/null @@ -1,53 +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 "paste_button.h" - -#include -#include "sec_comp_log.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -namespace { -constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "PasteButton"}; -} - -bool PasteButton::IsParamValid() -{ - if ((text_ <= UNKNOWN_TEXT) || (static_cast(text_) >= PasteDesc::MAX_LABEL_TYPE) || - (icon_ <= UNKNOWN_ICON) || (static_cast(icon_) >= PasteIcon::MAX_ICON_TYPE)) { - return false; - } - - return true; -} - -bool PasteButton::CompareComponentBasicInfo(SecCompBase *other, bool isRectCheck) const -{ - if (!SecCompBase::CompareComponentBasicInfo(other, isRectCheck)) { - SC_LOG_ERROR(LABEL, "SecComp base not equal."); - return false; - } - PasteButton* otherPasteButton = reinterpret_cast(other); - if (otherPasteButton == nullptr) { - SC_LOG_ERROR(LABEL, "other is not paste button."); - return false; - } - return (icon_ == otherPasteButton->icon_) && (text_ == otherPasteButton->text_) && - (bg_ == otherPasteButton->bg_); -} -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS diff --git a/frameworks/security_component/src/save_button.cpp b/frameworks/security_component/src/save_button.cpp deleted file mode 100644 index 22fc45c..0000000 --- a/frameworks/security_component/src/save_button.cpp +++ /dev/null @@ -1,53 +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 "save_button.h" - -#include -#include "sec_comp_log.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -namespace { -constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SaveButton"}; -} - -bool SaveButton::IsParamValid() -{ - if ((text_ <= UNKNOWN_TEXT) || (static_cast(text_) >= SaveDesc::MAX_LABEL_TYPE) || - (icon_ <= UNKNOWN_ICON) || (static_cast(icon_) >= SaveIcon::MAX_ICON_TYPE)) { - return false; - } - - return true; -} - -bool SaveButton::CompareComponentBasicInfo(SecCompBase *other, bool isRectCheck) const -{ - if (!SecCompBase::CompareComponentBasicInfo(other, isRectCheck)) { - SC_LOG_ERROR(LABEL, "SecComp base not equal."); - return false; - } - SaveButton* otherSaveButton = reinterpret_cast(other); - if (otherSaveButton == nullptr) { - SC_LOG_ERROR(LABEL, "other is not save button."); - return false; - } - return (icon_ == otherSaveButton->icon_) && (text_ == otherSaveButton->text_) && - (bg_ == otherSaveButton->bg_); -} -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS diff --git a/frameworks/security_component/src/sec_comp_base.cpp b/frameworks/security_component/src/sec_comp_base.cpp deleted file mode 100644 index 4c12e77..0000000 --- a/frameworks/security_component/src/sec_comp_base.cpp +++ /dev/null @@ -1,369 +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 "sec_comp_base.h" - -#include "sec_comp_err.h" -#include "sec_comp_log.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -namespace { -constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompBase"}; -} - -const std::string JsonTagConstants::JSON_RECT = "rect"; -const std::string JsonTagConstants::JSON_SC_TYPE = "type"; -const std::string JsonTagConstants::JSON_NODE_ID = "nodeId"; -const std::string JsonTagConstants::JSON_RECT_X = "x"; -const std::string JsonTagConstants::JSON_RECT_Y = "y"; -const std::string JsonTagConstants::JSON_RECT_WIDTH = "width"; -const std::string JsonTagConstants::JSON_RECT_HEIGHT = "height"; -const std::string JsonTagConstants::JSON_WINDOW_RECT = "windowRect"; -const std::string JsonTagConstants::JSON_SIZE_TAG = "size"; -const std::string JsonTagConstants::JSON_FONT_SIZE_TAG = "fontSize"; -const std::string JsonTagConstants::JSON_ICON_SIZE_TAG = "iconSize"; -const std::string JsonTagConstants::JSON_PADDING_SIZE_TAG = "paddingSize"; -const std::string JsonTagConstants::JSON_PADDING_LEFT_TAG = "left"; -const std::string JsonTagConstants::JSON_PADDING_TOP_TAG = "top"; -const std::string JsonTagConstants::JSON_PADDING_RIGHT_TAG = "right"; -const std::string JsonTagConstants::JSON_PADDING_BOTTOM_TAG = "bottom"; -const std::string JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG = "textIconSpace"; -const std::string JsonTagConstants::JSON_RECT_WIDTH_TAG = "width"; -const std::string JsonTagConstants::JSON_RECT_HEIGHT_TAG = "height"; -const std::string JsonTagConstants::JSON_COLORS_TAG = "colors"; -const std::string JsonTagConstants::JSON_FONT_COLOR_TAG = "fontColor"; -const std::string JsonTagConstants::JSON_ICON_COLOR_TAG = "iconColor"; -const std::string JsonTagConstants::JSON_BG_COLOR_TAG = "bgColor"; -const std::string JsonTagConstants::JSON_BORDER_TAG = "border"; -const std::string JsonTagConstants::JSON_BORDER_WIDTH_TAG = "borderWidth"; -const std::string JsonTagConstants::JSON_PARENT_TAG = "parent"; -const std::string JsonTagConstants::JSON_PARENT_EFFECT_TAG = "parentEffect"; -const std::string JsonTagConstants::JSON_STYLE_TAG = "style"; -const std::string JsonTagConstants::JSON_TEXT_TAG = "text"; -const std::string JsonTagConstants::JSON_ICON_TAG = "icon"; -const std::string JsonTagConstants::JSON_BG_TAG = "bg"; - -bool SecCompBase::ParseDimension(const nlohmann::json& json, const std::string& tag, DimensionT& res) -{ - if ((json.find(tag) == json.end()) || !json.at(tag).is_number_float()) { - SC_LOG_ERROR(LABEL, "json: %{public}s tag invalid.", tag.c_str()); - return false; - } - - res = json.at(tag).get(); - return true; -} - -bool SecCompBase::ParseColor(const nlohmann::json& json, const std::string& tag, SecCompColor& res) -{ - if ((json.find(tag) == json.end()) || !json.at(tag).is_number()) { - SC_LOG_ERROR(LABEL, "json: %{public}s tag invalid.", tag.c_str()); - return false; - } - - res.value = json.at(tag).get(); - return true; -} - -bool SecCompBase::ParseBool(const nlohmann::json& json, const std::string& tag, bool& res) -{ - if ((json.find(tag) == json.end()) || !json.at(tag).is_boolean()) { - SC_LOG_ERROR(LABEL, "json: %{public}s tag invalid.", tag.c_str()); - return false; - } - - res = json.at(tag).get(); - return true; -} - -bool SecCompBase::ParsePadding(const nlohmann::json& json, const std::string& tag, PaddingSize& res) -{ - if ((json.find(tag) == json.end()) || !json.at(tag).is_object()) { - SC_LOG_ERROR(LABEL, "json: %{public}s tag invalid.", tag.c_str()); - return false; - } - - auto jsonPadding = json.at(tag); - if (!ParseDimension(jsonPadding, JsonTagConstants::JSON_PADDING_TOP_TAG, res.top)) { - return false; - } - if (!ParseDimension(jsonPadding, JsonTagConstants::JSON_PADDING_RIGHT_TAG, res.right)) { - return false; - } - if (!ParseDimension(jsonPadding, JsonTagConstants::JSON_PADDING_BOTTOM_TAG, res.bottom)) { - return false; - } - if (!ParseDimension(jsonPadding, JsonTagConstants::JSON_PADDING_LEFT_TAG, res.left)) { - return false; - } - return true; -} - -bool SecCompBase::ParseColors(const nlohmann::json& json, const std::string& tag) -{ - if ((json.find(tag) == json.end()) || !json.at(tag).is_object()) { - SC_LOG_ERROR(LABEL, "json: %{public}s tag invalid.", tag.c_str()); - return false; - } - auto jsonColors = json.at(tag); - if (!ParseColor(jsonColors, JsonTagConstants::JSON_FONT_COLOR_TAG, fontColor_)) { - return false; - } - if (!ParseColor(jsonColors, JsonTagConstants::JSON_ICON_COLOR_TAG, iconColor_)) { - return false; - } - if (!ParseColor(jsonColors, JsonTagConstants::JSON_BG_COLOR_TAG, bgColor_)) { - return false; - } - return true; -} - -bool SecCompBase::ParseBorders(const nlohmann::json& json, const std::string& tag) -{ - if ((json.find(tag) == json.end()) || !json.at(tag).is_object()) { - SC_LOG_ERROR(LABEL, "json: %{public}s tag invalid.", tag.c_str()); - return false; - } - auto jsonBorder = json.at(tag); - return ParseDimension(jsonBorder, JsonTagConstants::JSON_BORDER_WIDTH_TAG, borderWidth_); -} - -bool SecCompBase::ParseSize(const nlohmann::json& json, const std::string& tag) -{ - if ((json.find(tag) == json.end()) || !json.at(tag).is_object()) { - SC_LOG_ERROR(LABEL, "json: %{public}s tag invalid.", tag.c_str()); - return false; - } - - auto jsonSize = json.at(tag); - if (!ParseDimension(jsonSize, JsonTagConstants::JSON_FONT_SIZE_TAG, fontSize_)) { - return false; - } - - if (!ParseDimension(jsonSize, JsonTagConstants::JSON_ICON_SIZE_TAG, iconSize_)) { - return false; - } - - if (!ParseDimension(jsonSize, JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, textIconSpace_)) { - return false; - } - - if (!ParsePadding(jsonSize, JsonTagConstants::JSON_PADDING_SIZE_TAG, padding_)) { - return false; - } - - return true; -} - -bool SecCompBase::ParseParent(const nlohmann::json& json, const std::string& tag) -{ - if ((json.find(tag) == json.end()) || !json.at(tag).is_object()) { - SC_LOG_ERROR(LABEL, "json: %{public}s tag invalid.", tag.c_str()); - return false; - } - auto jsonParent = json.at(tag); - return ParseBool(jsonParent, JsonTagConstants::JSON_PARENT_EFFECT_TAG, parentEffect_); -} - -bool SecCompBase::ParseRect(const nlohmann::json& json, const std::string& tag, SecCompRect& rect) -{ - if ((json.find(tag) == json.end()) || !json.at(tag).is_object()) { - SC_LOG_ERROR(LABEL, "json: %{public}s tag invalid.", tag.c_str()); - return false; - } - - auto jsonSize = json.at(tag); - if (!ParseDimension(jsonSize, JsonTagConstants::JSON_RECT_X, rect.x_)) { - return false; - } - - if (!ParseDimension(jsonSize, JsonTagConstants::JSON_RECT_Y, rect.y_)) { - return false; - } - - if (!ParseDimension(jsonSize, JsonTagConstants::JSON_RECT_WIDTH, rect.width_)) { - return false; - } - - if (!ParseDimension(jsonSize, JsonTagConstants::JSON_RECT_HEIGHT, rect.height_)) { - return false; - } - - return true; -} - -bool SecCompBase::FromJson(const nlohmann::json& jsonSrc) -{ - SC_LOG_DEBUG(LABEL, "Button info %{public}s.", jsonSrc.dump().c_str()); - if ((jsonSrc.find(JsonTagConstants::JSON_SC_TYPE) == jsonSrc.end()) || - !jsonSrc.at(JsonTagConstants::JSON_SC_TYPE).is_number()) { - SC_LOG_ERROR(LABEL, "json: %{public}s tag invalid.", JsonTagConstants::JSON_SC_TYPE.c_str()); - return false; - } - int32_t value = jsonSrc.at(JsonTagConstants::JSON_SC_TYPE).get(); - if ((value <= static_cast(SecCompType::UNKNOWN_SC_TYPE)) || - (value >= static_cast(SecCompType::MAX_SC_TYPE))) { - SC_LOG_ERROR(LABEL, "scType is invalid."); - return false; - } - type_ = static_cast(value); - - if ((jsonSrc.find(JsonTagConstants::JSON_NODE_ID) == jsonSrc.end()) || - !jsonSrc.at(JsonTagConstants::JSON_NODE_ID).is_number()) { - SC_LOG_ERROR(LABEL, "json: %{public}s tag invalid.", JsonTagConstants::JSON_NODE_ID.c_str()); - return false; - } - nodeId_ = jsonSrc.at(JsonTagConstants::JSON_NODE_ID).get(); - - if (!ParseRect(jsonSrc, JsonTagConstants::JSON_RECT, rect_)) { - return false; - } - if (!ParseRect(jsonSrc, JsonTagConstants::JSON_WINDOW_RECT, windowRect_)) { - return false; - } - if (!ParseSize(jsonSrc, JsonTagConstants::JSON_SIZE_TAG)) { - return false; - } - if (!ParseColors(jsonSrc, JsonTagConstants::JSON_COLORS_TAG)) { - return false; - } - if (!ParseBorders(jsonSrc, JsonTagConstants::JSON_BORDER_TAG)) { - return false; - } - if (!ParseParent(jsonSrc, JsonTagConstants::JSON_PARENT_TAG)) { - return false; - } - if (!ParseStyle(jsonSrc, JsonTagConstants::JSON_STYLE_TAG)) { - return false; - } - - return true; -} - -void SecCompBase::ToJson(nlohmann::json& jsonRes) const -{ - jsonRes[JsonTagConstants::JSON_SC_TYPE] = type_; - jsonRes[JsonTagConstants::JSON_NODE_ID] = nodeId_; - jsonRes[JsonTagConstants::JSON_RECT] = nlohmann::json { - {JsonTagConstants::JSON_RECT_X, rect_.x_}, - {JsonTagConstants::JSON_RECT_Y, rect_.y_}, - {JsonTagConstants::JSON_RECT_WIDTH, rect_.width_}, - {JsonTagConstants::JSON_RECT_HEIGHT, rect_.height_} - }; - jsonRes[JsonTagConstants::JSON_WINDOW_RECT] = nlohmann::json { - {JsonTagConstants::JSON_RECT_X, windowRect_.x_}, - {JsonTagConstants::JSON_RECT_Y, windowRect_.y_}, - {JsonTagConstants::JSON_RECT_WIDTH, windowRect_.width_}, - {JsonTagConstants::JSON_RECT_HEIGHT, windowRect_.height_} - }; - nlohmann::json jsonPadding = nlohmann::json { - { JsonTagConstants::JSON_PADDING_TOP_TAG, padding_.top }, - { JsonTagConstants::JSON_PADDING_RIGHT_TAG, padding_.right }, - { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, padding_.bottom }, - { JsonTagConstants::JSON_PADDING_LEFT_TAG, padding_.left }, - }; - - jsonRes[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_SIZE_TAG, fontSize_ }, - { JsonTagConstants::JSON_ICON_SIZE_TAG, iconSize_ }, - { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, textIconSpace_ }, - { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, - }; - - jsonRes[JsonTagConstants::JSON_COLORS_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_COLOR_TAG, fontColor_.value }, - { JsonTagConstants::JSON_ICON_COLOR_TAG, iconColor_.value }, - { JsonTagConstants::JSON_BG_COLOR_TAG, bgColor_.value } - }; - - jsonRes[JsonTagConstants::JSON_BORDER_TAG] = nlohmann::json { - { JsonTagConstants::JSON_BORDER_WIDTH_TAG, borderWidth_ }, - }; - jsonRes[JsonTagConstants::JSON_PARENT_TAG] = nlohmann::json { - { JsonTagConstants::JSON_PARENT_EFFECT_TAG, parentEffect_ }, - }; - - jsonRes[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_TEXT_TAG, text_ }, - { JsonTagConstants::JSON_ICON_TAG, icon_ }, - { JsonTagConstants::JSON_BG_TAG, bg_ }, - }; -} - -std::string SecCompBase::ToJsonStr() const -{ - nlohmann::json json; - ToJson(json); - return json.dump(); -} - -bool SecCompBase::CompareComponentBasicInfo(SecCompBase *other, bool isRectCheck) const -{ - if (other == nullptr) { - SC_LOG_ERROR(LABEL, "other is nullptr."); - return false; - } - - SecCompRect rect = other->rect_; - SecCompRect windowRect = other->windowRect_; - if (isRectCheck) { - rect = rect_; - windowRect = windowRect_; - } - - auto leftValue = std::tie(type_, fontSize_, iconSize_, textIconSpace_, padding_.top, padding_.right, - padding_.bottom, padding_.left, fontColor_.value, bgColor_.value, iconColor_.value, borderWidth_, - rect, windowRect); - auto rightValue = std::tie(other->type_, other->fontSize_, other->iconSize_, other->textIconSpace_, - other->padding_.top, other->padding_.right, other->padding_.bottom, other->padding_.left, - other->fontColor_.value, other->bgColor_.value, other->iconColor_.value, other->borderWidth_, - other->rect_, other->windowRect_); - - return (leftValue == rightValue); -} - -bool SecCompBase::ParseStyle(const nlohmann::json& json, const std::string& tag) -{ - if ((json.find(tag) == json.end()) || !json.at(tag).is_object()) { - SC_LOG_ERROR(LABEL, "json: %{public}s tag invalid.", tag.c_str()); - return false; - } - auto jsonStyle = json.at(tag); - if (!(jsonStyle.at(JsonTagConstants::JSON_TEXT_TAG).is_number() && - jsonStyle.at(JsonTagConstants::JSON_ICON_TAG).is_number() && - jsonStyle.at(JsonTagConstants::JSON_BG_TAG).is_number())) { - SC_LOG_ERROR(LABEL, "json: %{public}s tag invalid.", tag.c_str()); - return false; - } - text_ = jsonStyle.at(JsonTagConstants::JSON_TEXT_TAG).get(); - icon_ = jsonStyle.at(JsonTagConstants::JSON_ICON_TAG).get(); - if (!IsParamValid()) { - SC_LOG_ERROR(LABEL, "text or icon is invalid."); - return false; - } - - bg_ = static_cast(jsonStyle.at(JsonTagConstants::JSON_BG_TAG).get()); - if ((bg_ <= SecCompBackground::UNKNOWN_BG) || (bg_ >= SecCompBackground::MAX_BG_TYPE)) { - SC_LOG_ERROR(LABEL, "bg is invalid."); - return false; - } - - return true; -} -} // namespace base -} // namespace Security -} // namespace OHOS - diff --git a/frameworks/security_component/src/sec_comp_click_event_parcel.cpp b/frameworks/security_component/src/sec_comp_click_event_parcel.cpp deleted file mode 100644 index 55390c9..0000000 --- a/frameworks/security_component/src/sec_comp_click_event_parcel.cpp +++ /dev/null @@ -1,102 +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 "sec_comp_click_event_parcel.h" - -#include "sec_comp_log.h" -#include "securec.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -namespace { -static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { - LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompClickEventParcel"}; -} - -bool SecCompClickEventParcel::Marshalling(Parcel& out) const -{ - if (!(out.WriteDouble(this->touchInfoParams_.touchX)) || !(out.WriteDouble(this->touchInfoParams_.touchY))) { - SC_LOG_ERROR(LABEL, "Write touch xy pointer fail"); - return false; - } - - if (!(out.WriteUint64(this->touchInfoParams_.timestamp))) { - SC_LOG_ERROR(LABEL, "Write touch timestamp fail"); - return false; - } - - if (!(out.WriteUint32(this->touchInfoParams_.extraInfo.dataSize))) { - SC_LOG_ERROR(LABEL, "Write extraInfo dataSize fail"); - return false; - } - - if (this->touchInfoParams_.extraInfo.dataSize != 0 && - !(out.WriteBuffer(this->touchInfoParams_.extraInfo.data, this->touchInfoParams_.extraInfo.dataSize))) { - SC_LOG_ERROR(LABEL, "Write touch extraInfo data fail"); - return false; - } - - return true; -} - -SecCompClickEventParcel* SecCompClickEventParcel::Unmarshalling(Parcel& in) -{ - SecCompClickEventParcel* touchInfoParcel = new (std::nothrow) SecCompClickEventParcel(); - if (touchInfoParcel == nullptr) { - SC_LOG_ERROR(LABEL, "Alloc policy parcel fail"); - return nullptr; - } - - SecCompClickEvent touchInfo; - if (!in.ReadDouble(touchInfo.touchX) || !in.ReadDouble(touchInfo.touchY)) { - SC_LOG_ERROR(LABEL, "Read touch xy porinter fail"); - delete touchInfoParcel; - return nullptr; - } - - if (!in.ReadUint64(touchInfo.timestamp)) { - SC_LOG_ERROR(LABEL, "Read timestamp fail"); - delete touchInfoParcel; - return nullptr; - } - - if (!in.ReadUint32(touchInfo.extraInfo.dataSize)) { - SC_LOG_ERROR(LABEL, "Read extraInfo data size fail"); - delete touchInfoParcel; - return nullptr; - } - - if (touchInfo.extraInfo.dataSize == 0) { - touchInfoParcel->touchInfoParams_ = touchInfo; - return touchInfoParcel; - } else if (touchInfo.extraInfo.dataSize > MAX_EXTRA_SIZE) { - SC_LOG_ERROR(LABEL, "Read extraInfo data size invalid"); - delete touchInfoParcel; - return nullptr; - } - - touchInfo.extraInfo.data = const_cast(in.ReadBuffer(touchInfo.extraInfo.dataSize)); - if (touchInfo.extraInfo.data == nullptr) { - SC_LOG_ERROR(LABEL, "Read extraInfo data failed"); - delete touchInfoParcel; - return nullptr; - } - - touchInfoParcel->touchInfoParams_ = touchInfo; - return touchInfoParcel; -} -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS diff --git a/hisysevent.yaml b/hisysevent.yaml deleted file mode 100644 index 51ab79c..0000000 --- a/hisysevent.yaml +++ /dev/null @@ -1,94 +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. - -domain: SEC_COMPONENT - -CALLBACK_FAILED: - __BASE: {type: SECURITY, level: CRITICAL, desc: Failed to execute the callback} - CALLER_PID: {type: INT32, desc: caller pid} - CALLER_UID: {type: INT32, desc: caller uid} - CALL_SCENE: {type: STRING, desc: call scene} - REASON: {type: STRING, desc: callback execution failure cause} - SC_ID: {type: INT32, desc: security component id} - SC_TYPE: {type: STRING, desc: security component type} - -CALLER_CHECK_FAILED: - __BASE: {type: SECURITY, level: CRITICAL, desc: Illegal invocation} - CALLER_PID: {type: INT32, desc: caller pid} - CALLER_UID: {type: INT32, desc: caller uid} - CALL_SCENE: {type: STRING, desc: call scene} - -CHALLENGE_CHECK_FAILED: - __BASE: {type: SECURITY, level: CRITICAL, desc: Challenge value verification failed} - CALLER_PID: {type: INT32, desc: caller pid} - CALLER_UID: {type: INT32, desc: caller uid} - CALL_SCENE: {type: STRING, desc: call scene} - SC_ID: {type: INT32, desc: security component id} - SC_TYPE: {type: STRING, desc: security component type} - -CLICK_INFO_CHECK_FAILED: - __BASE: {type: SECURITY, level: CRITICAL, desc: Failed to verify the click event} - CALLER_PID: {type: INT32, desc: caller pid} - CALLER_UID: {type: INT32, desc: caller uid} - SC_ID: {type: INT32, desc: security component id} - SC_TYPE: {type: STRING, desc: security component type} - -COMPONENT_INFO_CHECK_FAILED: - __BASE: {type: SECURITY, level: CRITICAL, desc: Failed to verify the component information} - CALLER_PID: {type: INT32, desc: caller pid} - CALLER_UID: {type: INT32, desc: caller uid} - CALL_SCENE: {type: STRING, desc: call scene} - SC_ID: {type: INT32, desc: security component id} - SC_TYPE: {type: STRING, desc: security component type} - -INIT_FAILED: - __BASE: {type: FAULT, level: CRITICAL, desc: Failed to initialize the security component environment} - CALLER_PID: {type: INT32, desc: caller pid} - CALLER_UID: {type: INT32, desc: caller uid} - REASON: {type: STRING, desc: callback execution failure cause} - -REGISTER_SUCCESS: - __BASE: {type: BEHAVIOR, level: MINOR, desc: The security component is registered successfully} - CALLER_PID: {type: INT32, desc: caller pid} - CALLER_UID: {type: INT32, desc: caller uid} - SC_ID: {type: INT32, desc: security component id} - SC_TYPE: {type: STRING, desc: security component type} - -REPEAT_CALLBACK_REGISTER: - __BASE: {type: SECURITY, level: CRITICAL, desc: Repeated registration callback} - CALLER_PID: {type: INT32, desc: caller pid} - CALLER_UID: {type: INT32, desc: caller uid} - -SERVICE_INIT_SUCCESS: - __BASE: {type: BEHAVIOR, level: MINOR, desc: Security component service starts successfully} - PID: {type: INT32, desc: pid of the service process} - -TEMP_GRANT_FAILED: - __BASE: {type: FAULT, level: CRITICAL, desc: Security component authorization failed} - CALLER_PID: {type: INT32, desc: caller pid} - CALLER_UID: {type: INT32, desc: caller uid} - SC_ID: {type: INT32, desc: security component id} - SC_TYPE: {type: STRING, desc: security component type} - -TEMP_GRANT_SUCCESS: - __BASE: {type: BEHAVIOR, level: MINOR, desc: Security component authorization successfully} - CALLER_PID: {type: INT32, desc: caller pid} - CALLER_UID: {type: INT32, desc: caller uid} - SC_ID: {type: INT32, desc: security component id} - SC_TYPE: {type: STRING, desc: security component type} - -UNREGISTER_SUCCESS: - __BASE: {type: BEHAVIOR, level: MINOR, desc: Security component unregister} - CALLER_PID: {type: INT32, desc: caller pid} - CALLER_UID: {type: INT32, desc: caller uid} - SC_ID: {type: INT32, desc: security component id} diff --git a/interfaces/inner_api/enhance_kits/BUILD.gn b/interfaces/inner_api/enhance_kits/BUILD.gn deleted file mode 100644 index 03d5acf..0000000 --- a/interfaces/inner_api/enhance_kits/BUILD.gn +++ /dev/null @@ -1,57 +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("//build/ohos.gni") - -sec_comp_root_dir = "../../.." - -config("sec_comp_enhance_config") { - visibility = [ ":*" ] - include_dirs = [ - "include", - "${sec_comp_root_dir}/frameworks/common/include", - "${sec_comp_root_dir}/frameworks/enhance_adapter/include", - ] -} - -ohos_shared_library("libsecurity_component_enhance_sdk") { - subsystem_name = "security" - part_name = "security_component" - output_name = "libsecurity_component_enhance_sdk" - - public_configs = [ ":sec_comp_enhance_config" ] - - include_dirs = [ - "include", - "${sec_comp_root_dir}/frameworks/common/include", - "${sec_comp_root_dir}/frameworks/enhance_adapter/include", - ] - - sources = [ - "src/sec_comp_enhance_kit.cpp", - ] - - deps = [ - "${sec_comp_root_dir}/frameworks:libsecurity_component_enhance_adapter", - ] - - configs = [ "${sec_comp_root_dir}/config:coverage_flags" ] - - external_deps = [ - "c_utils:utils", - "hilog:libhilog", - "ipc:ipc_single" - ] - - cflags_cc = [ "-DHILOG_ENABLE" ] -} diff --git a/interfaces/inner_api/enhance_kits/include/sec_comp_enhance_kit.h b/interfaces/inner_api/enhance_kits/include/sec_comp_enhance_kit.h deleted file mode 100644 index 11f46ee..0000000 --- a/interfaces/inner_api/enhance_kits/include/sec_comp_enhance_kit.h +++ /dev/null @@ -1,32 +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. - */ -#ifndef SECURITY_COMPONENT_ENHANCE_KITS_H -#define SECURITY_COMPONENT_ENHANCE_KITS_H - -#include - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -struct SecCompEnhanceKit { - static void InitClientEnhance(); - static int32_t SetEnhanceCfg(uint8_t* cfg, uint32_t cfgLen); - static int32_t GetPointerEventEnhanceData(void* data, uint32_t dataLen, - uint8_t* enhanceData, uint32_t& enHancedataLen); -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // SECURITY_COMPONENT_ENHANCE_KITS_H diff --git a/interfaces/inner_api/enhance_kits/include/sec_comp_enhance_kit_c.h b/interfaces/inner_api/enhance_kits/include/sec_comp_enhance_kit_c.h deleted file mode 100644 index c7e0c6f..0000000 --- a/interfaces/inner_api/enhance_kits/include/sec_comp_enhance_kit_c.h +++ /dev/null @@ -1,21 +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. - */ -#ifndef SECURITY_COMPONENT_ENHANCE_KIT_C_H -#define SECURITY_COMPONENT_ENHANCE_KIT_C_H - -void InitSecCompClientEnhance(void); - -#endif // SECURITY_COMPONENT_ENHANCE_KIT_C_H - diff --git a/interfaces/inner_api/enhance_kits/src/sec_comp_enhance_kit.cpp b/interfaces/inner_api/enhance_kits/src/sec_comp_enhance_kit.cpp deleted file mode 100644 index 4b16511..0000000 --- a/interfaces/inner_api/enhance_kits/src/sec_comp_enhance_kit.cpp +++ /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. - */ - -#include "sec_comp_enhance_kit.h" - -#include "sec_comp_enhance_adapter.h" - -extern "C" void InitSecCompClientEnhance() -{ - OHOS::Security::SecurityComponent::SecCompEnhanceKit::InitClientEnhance(); -} - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -void SecCompEnhanceKit::InitClientEnhance(void) -{ - SecCompEnhanceAdapter::InitEnhanceHandler(SEC_COMP_ENHANCE_CLIENT_INTERFACE); -} - -int32_t SecCompEnhanceKit::SetEnhanceCfg(uint8_t* cfg, uint32_t cfgLen) -{ - return SecCompEnhanceAdapter::SetEnhanceCfg(cfg, cfgLen); -} - -int32_t SecCompEnhanceKit::GetPointerEventEnhanceData(void* data, uint32_t dataLen, - uint8_t* enhanceData, uint32_t& enHancedataLen) -{ - return SecCompEnhanceAdapter::GetPointerEventEnhanceData(data, dataLen, enhanceData, enHancedataLen); -} -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS diff --git a/interfaces/inner_api/enhance_kits/test/BUILD.gn b/interfaces/inner_api/enhance_kits/test/BUILD.gn deleted file mode 100644 index bf1409c..0000000 --- a/interfaces/inner_api/enhance_kits/test/BUILD.gn +++ /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. - -import("//build/test.gni") - -sec_comp_root_dir = "../../../.." - -ohos_unittest("sec_comp_enhance_sdk_test") { - subsystem_name = "security" - part_name = "security_component" - module_out_path = part_name + "/" + part_name - - include_dirs = [ "unittest/src" ] - - sources = [ "unittest/src/sec_comp_enhance_test.cpp" ] - - configs = [ "${sec_comp_root_dir}/config:coverage_flags" ] - cflags_cc = [ "-DHILOG_ENABLE" ] - - deps = [ - "${sec_comp_root_dir}/frameworks:libsecurity_component_enhance_adapter", - "${sec_comp_root_dir}/interfaces/inner_api/enhance_kits:libsecurity_component_enhance_sdk", - ] - - external_deps = [ - "c_utils:utils", - "hilog:libhilog", - "ipc:ipc_single", - ] - if (current_cpu == "arm64") { - defines = [ "_ARM64_" ] - } -} - -group("unittest") { - testonly = true - deps = [ ":sec_comp_enhance_sdk_test" ] -} diff --git a/interfaces/inner_api/enhance_kits/test/unittest/src/sec_comp_enhance_test.cpp b/interfaces/inner_api/enhance_kits/test/unittest/src/sec_comp_enhance_test.cpp deleted file mode 100644 index cb3c2ab..0000000 --- a/interfaces/inner_api/enhance_kits/test/unittest/src/sec_comp_enhance_test.cpp +++ /dev/null @@ -1,135 +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 "sec_comp_enhance_test.h" -#include "sec_comp_err.h" -#include "sec_comp_log.h" -#include - -using namespace testing::ext; -using namespace OHOS::Security::SecurityComponent; - -namespace { -static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { - LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompEnhanceTest"}; -static bool g_inputEnhanceExist = false; -static bool g_srvEnhanceExist = false; -static constexpr uint32_t SEC_COMP_ENHANCE_CFG_SIZE = 76; -#ifdef _ARM64_ -static const std::string LIB_PATH = "/system/lib64/"; -#else -static const std::string LIB_PATH = "/system/lib/"; -#endif -static const std::string ENHANCE_INPUT_INTERFACE_LIB = LIB_PATH + "libsec_comp_input_enhance.z.so"; -static const std::string ENHANCE_SRV_INTERFACE_LIB = LIB_PATH + "libsec_comp_service_enhance.z.so"; -static constexpr uint32_t MAX_HMAC_SIZE = 64; -} // namespace - -void SecCompEnhanceTest::SetUpTestCase() -{ - if (access(ENHANCE_INPUT_INTERFACE_LIB.c_str(), F_OK) == 0) { - g_inputEnhanceExist = true; - } - - if (access(ENHANCE_SRV_INTERFACE_LIB.c_str(), F_OK) == 0) { - g_srvEnhanceExist = true; - } - - SC_LOG_INFO(LABEL, "SetUpTestCase."); -} - -void SecCompEnhanceTest::TearDownTestCase() -{ - SC_LOG_INFO(LABEL, "TearDownTestCase."); -} - -void SecCompEnhanceTest::SetUp() -{ - SC_LOG_INFO(LABEL, "SetUp ok."); -} - -void SecCompEnhanceTest::TearDown() -{ - SC_LOG_INFO(LABEL, "TearDown."); -} - -/** - * @tc.name: SetEnhanceCfg001 - * @tc.desc: test SetEnhanceCfg - * @tc.type: FUNC - * @tc.require: AR000HO9IN - */ -HWTEST_F(SecCompEnhanceTest, SetEnhanceCfg001, TestSize.Level1) -{ - uint8_t cfgData[SEC_COMP_ENHANCE_CFG_SIZE] = { 0 }; - int32_t result = SecCompEnhanceKit::SetEnhanceCfg(cfgData, SEC_COMP_ENHANCE_CFG_SIZE); - if (g_inputEnhanceExist) { - EXPECT_EQ(result, SC_OK); - } else { - EXPECT_EQ(result, SC_ENHANCE_ERROR_NOT_EXIST_ENHANCE); - } -} - -/** - * @tc.name: GetPoniterEventEnhanceData001 - * @tc.desc: test GetPoniterEventEnhanceData - * @tc.type: FUNC - * @tc.require: AR000HO9IN - */ -HWTEST_F(SecCompEnhanceTest, GetPoniterEventEnhanceData001, TestSize.Level1) -{ - uint8_t originData[16] = { 0 }; - uint32_t dataLen = 16; - uint8_t* enhanceData = nullptr; - uint32_t enHancedataLen = MAX_HMAC_SIZE; - - int32_t result = SecCompEnhanceKit::GetPointerEventEnhanceData(originData, dataLen, enhanceData, enHancedataLen); - if (g_inputEnhanceExist) { - EXPECT_EQ(result, SC_SERVICE_ERROR_SERVICE_NOT_EXIST); - } else { - EXPECT_EQ(result, SC_ENHANCE_ERROR_NOT_EXIST_ENHANCE); - } -} - -/** - * @tc.name: EnableInputEnhance001 - * @tc.desc: test UnmarshallEnhanceCfg - * @tc.type: FUNC - * @tc.require: AR000HO9IN - */ -HWTEST_F(SecCompEnhanceTest, EnableInputEnhance001, TestSize.Level1) -{ - int32_t result = SecCompEnhanceAdapter::EnableInputEnhance(); - if (g_srvEnhanceExist) { - EXPECT_EQ(result, SC_OK); - } else { - EXPECT_EQ(result, SC_ENHANCE_ERROR_NOT_EXIST_ENHANCE); - } -} - -/** - * @tc.name: DisableInputEnhance001 - * @tc.desc: test DisableInputEnhance - * @tc.type: FUNC - * @tc.require: AR000HO9IN - */ -HWTEST_F(SecCompEnhanceTest, DisableInputEnhance001, TestSize.Level1) -{ - int32_t result = SecCompEnhanceAdapter::DisableInputEnhance(); - if (g_srvEnhanceExist) { - EXPECT_EQ(result, SC_OK); - } else { - EXPECT_EQ(result, SC_ENHANCE_ERROR_NOT_EXIST_ENHANCE); - } -} diff --git a/interfaces/inner_api/enhance_kits/test/unittest/src/sec_comp_enhance_test.h b/interfaces/inner_api/enhance_kits/test/unittest/src/sec_comp_enhance_test.h deleted file mode 100644 index deff0d4..0000000 --- a/interfaces/inner_api/enhance_kits/test/unittest/src/sec_comp_enhance_test.h +++ /dev/null @@ -1,38 +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. - */ -#ifndef SECURITY_COMPONENT_ENHANCE_KITS_TEST -#define SECURITY_COMPONENT_ENHANCE_KITS_TEST - -#include -#include "sec_comp_enhance_adapter.h" -#include "sec_comp_enhance_kit.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -class SecCompEnhanceTest : public testing::Test { -public: - static void SetUpTestCase(); - - static void TearDownTestCase(); - - void SetUp() override; - - void TearDown() override; -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // SECURITY_COMPONENT_ENHANCE_KITS_TEST \ No newline at end of file diff --git a/interfaces/inner_api/security_component/BUILD.gn b/interfaces/inner_api/security_component/BUILD.gn deleted file mode 100644 index a286b4c..0000000 --- a/interfaces/inner_api/security_component/BUILD.gn +++ /dev/null @@ -1,67 +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("//build/ohos.gni") - -sec_comp_root_dir = "../../.." - -config("sec_comp_config") { - visibility = [ ":*" ] - include_dirs = [ - "include", - "${sec_comp_root_dir}/frameworks/common/include", - "//third_party/json/include", - ] -} - -ohos_shared_library("libsecurity_component_sdk") { - subsystem_name = "security" - part_name = "security_component" - output_name = "libsecurity_component_sdk" - - public_configs = [ ":sec_comp_config" ] - - include_dirs = [ - "include", - "${sec_comp_root_dir}/frameworks/common/include", - "${sec_comp_root_dir}/frameworks/security_component/include", - ] - - sources = [ - "src/sec_comp_caller_authorization.cpp", - "src/sec_comp_client.cpp", - "src/sec_comp_death_recipient.cpp", - "src/sec_comp_kit.cpp", - "src/sec_comp_load_callback.cpp", - "src/sec_comp_proxy.cpp", - "src/sec_comp_ui_register.cpp" - ] - - deps = [ - "${sec_comp_root_dir}/frameworks:libsecurity_component_enhance_adapter", - "${sec_comp_root_dir}/frameworks:libsecurity_component_framework" - ] - - configs = [ "${sec_comp_root_dir}/config:coverage_flags" ] - - external_deps = [ - "access_token:libaccesstoken_sdk", - "c_utils:utils", - "hilog:libhilog", - "hisysevent:libhisysevent", - "ipc:ipc_core", - "samgr:samgr_proxy", - ] - - cflags_cc = [ "-DHILOG_ENABLE" ] -} diff --git a/interfaces/inner_api/security_component/include/i_sec_comp_probe.h b/interfaces/inner_api/security_component/include/i_sec_comp_probe.h deleted file mode 100644 index c83cd99..0000000 --- a/interfaces/inner_api/security_component/include/i_sec_comp_probe.h +++ /dev/null @@ -1,30 +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. - */ -#ifndef I_SECURITY_COMPONENT_PROPE_H -#define I_SECURITY_COMPONENT_PROPE_H - -#include - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -class ISecCompProbe { -public: - virtual int32_t GetComponentInfo(int32_t nodeId, std::string& componentInfo) = 0; -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // I_SECURITY_COMPONENT_PROPE_H diff --git a/interfaces/inner_api/security_component/include/i_sec_comp_service.h b/interfaces/inner_api/security_component/include/i_sec_comp_service.h deleted file mode 100644 index 0b6d2e7..0000000 --- a/interfaces/inner_api/security_component/include/i_sec_comp_service.h +++ /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. - */ -#ifndef I_SECURITY_COMPONENT_SERVICE_H -#define I_SECURITY_COMPONENT_SERVICE_H - -#include -#include "access_token.h" -#include "iremote_broker.h" -#include "sec_comp_info.h" -#include "security_component_service_ipc_interface_code.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -constexpr int32_t SA_ID_SECURITY_COMPONENT_SERVICE = 3506; - -class ISecCompService : public IRemoteBroker { -public: - DECLARE_INTERFACE_DESCRIPTOR(u"ohos.security.ISecCompService"); - - virtual int32_t RegisterSecurityComponent(SecCompType type, - const std::string& componentInfo, int32_t& scId) = 0; - virtual int32_t UpdateSecurityComponent(int32_t scId, const std::string& componentInfo) = 0; - virtual int32_t UnregisterSecurityComponent(int32_t scId) = 0; - virtual int32_t ReportSecurityComponentClickEvent(int32_t scId, const std::string& componentInfo, - const SecCompClickEvent& touchInfo, sptr callerToken) = 0; - virtual bool ReduceAfterVerifySavePermission(AccessToken::AccessTokenID tokenId) = 0; - virtual sptr GetEnhanceRemoteObject() = 0; -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // I_SECURITY_COMPONENT_SERVICE_H diff --git a/interfaces/inner_api/security_component/include/location_button.h b/interfaces/inner_api/security_component/include/location_button.h deleted file mode 100644 index 927189c..0000000 --- a/interfaces/inner_api/security_component/include/location_button.h +++ /dev/null @@ -1,57 +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. - */ -#ifndef I_SECURITY_COMPONENT_LOCATION_BUTTON_H -#define I_SECURITY_COMPONENT_LOCATION_BUTTON_H - -#include -#include "nlohmann/json.hpp" -#include "sec_comp_base.h" -#include "sec_comp_info.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -enum class LocationDesc : int32_t { - CURRENT_LOCATION = 0, - ADD_LOCATION = 1, - SELECT_LOCATION = 2, - SHARE_LOCATION = 3, - SEND_LOCATION = 4, - LOCATING = 5, - LOCATION = 6, - SEND_CURRENT_LOCATION = 7, - RELOCATION = 8, - PUNCH_IN = 9, - CURRENT_POSITION = 10, - MAX_LABEL_TYPE -}; - -enum class LocationIcon : int32_t { - FILLED_ICON = 0, - LINE_ICON = 1, - MAX_ICON_TYPE -}; - -class LocationButton : public SecCompBase { -public: - virtual bool IsParamValid() override; - virtual bool CompareComponentBasicInfo(SecCompBase *other, bool isRectCheck) const override; -private: - bool ParseStyle(const nlohmann::json& json, const std::string& tag); -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // I_SECURITY_COMPONENT_LOCATION_BUTTON_H diff --git a/interfaces/inner_api/security_component/include/paste_button.h b/interfaces/inner_api/security_component/include/paste_button.h deleted file mode 100644 index 241a316..0000000 --- a/interfaces/inner_api/security_component/include/paste_button.h +++ /dev/null @@ -1,46 +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. - */ -#ifndef SECURITY_COMPONENT_PASTE_BUTTON_H -#define SECURITY_COMPONENT_PASTE_BUTTON_H - -#include -#include "nlohmann/json.hpp" -#include "sec_comp_base.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -enum class PasteDesc : int32_t { - PASTE = 0, - MAX_LABEL_TYPE -}; - -enum class PasteIcon : int32_t { - FILLED_ICON = 0, - LINE_ICON = 1, - MAX_ICON_TYPE -}; - -class PasteButton : public SecCompBase { -public: - virtual bool IsParamValid() override; - virtual bool CompareComponentBasicInfo(SecCompBase *other, bool isRectCheck) const override; -private: - bool ParseStyle(const nlohmann::json& json, const std::string& tag); -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // SECURITY_COMPONENT_LOCATION_BUTTON_H diff --git a/interfaces/inner_api/security_component/include/save_button.h b/interfaces/inner_api/security_component/include/save_button.h deleted file mode 100644 index ea7b5f5..0000000 --- a/interfaces/inner_api/security_component/include/save_button.h +++ /dev/null @@ -1,54 +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. - */ -#ifndef I_SECURITY_COMPONENT_SAVE_BUTTON_H -#define I_SECURITY_COMPONENT_SAVE_BUTTON_H - -#include -#include "nlohmann/json.hpp" -#include "sec_comp_base.h" -#include "sec_comp_info.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -enum class SaveDesc : int32_t { - DOWNLOAD = 0, - DOWNLOAD_FILE = 1, - SAVE = 2, - SAVE_IMAGE = 3, - SAVE_FILE = 4, - DOWNLOAD_AND_SHARE = 5, - RECEIVE = 6, - CONTINUE_TO_RECEIVE = 7, - MAX_LABEL_TYPE -}; - -enum class SaveIcon : int32_t { - FILLED_ICON = 0, - LINE_ICON = 1, - MAX_ICON_TYPE -}; - -class SaveButton : public SecCompBase { -public: - virtual bool IsParamValid() override; - virtual bool CompareComponentBasicInfo(SecCompBase *other, bool isRectCheck) const override; -private: - bool ParseStyle(const nlohmann::json& json, const std::string& tag); -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // I_SECURITY_COMPONENT_SAVE_BUTTON_H diff --git a/interfaces/inner_api/security_component/include/sec_comp_base.h b/interfaces/inner_api/security_component/include/sec_comp_base.h deleted file mode 100644 index 7449a00..0000000 --- a/interfaces/inner_api/security_component/include/sec_comp_base.h +++ /dev/null @@ -1,139 +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. - */ -#ifndef SECURITY_COMPONENT_BASE_H -#define SECURITY_COMPONENT_BASE_H - -#include "nlohmann/json.hpp" -#include "sec_comp_info.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -constexpr int32_t UNKNOWN_TEXT = -2; -constexpr int32_t NO_TEXT = -1; -constexpr int32_t UNKNOWN_ICON = -2; -constexpr int32_t NO_ICON = -1; - -enum class SecCompBackground { - UNKNOWN_BG = -2, - NO_BG_TYPE = -1, - CAPSULE = 0, - CIRCLE = 1, - NORMAL = 2, - MAX_BG_TYPE -}; - -class JsonTagConstants final { -public: - static const std::string JSON_RECT; - static const std::string JSON_SC_TYPE; - static const std::string JSON_NODE_ID; - static const std::string JSON_RECT_X; - static const std::string JSON_RECT_Y; - static const std::string JSON_RECT_WIDTH; - static const std::string JSON_RECT_HEIGHT; - static const std::string JSON_WINDOW_RECT; - - static const std::string JSON_SIZE_TAG; - static const std::string JSON_FONT_SIZE_TAG; - static const std::string JSON_ICON_SIZE_TAG; - static const std::string JSON_PADDING_SIZE_TAG; - static const std::string JSON_PADDING_LEFT_TAG; - static const std::string JSON_PADDING_TOP_TAG; - static const std::string JSON_PADDING_RIGHT_TAG; - static const std::string JSON_PADDING_BOTTOM_TAG; - static const std::string JSON_TEXT_ICON_PADDING_TAG; - static const std::string JSON_RECT_WIDTH_TAG; - static const std::string JSON_RECT_HEIGHT_TAG; - static const std::string JSON_COLORS_TAG; - static const std::string JSON_FONT_COLOR_TAG; - static const std::string JSON_ICON_COLOR_TAG; - static const std::string JSON_BG_COLOR_TAG; - - static const std::string JSON_BORDER_TAG; - static const std::string JSON_BORDER_WIDTH_TAG; - static const std::string JSON_PARENT_TAG; - static const std::string JSON_PARENT_EFFECT_TAG; - - static const std::string JSON_STYLE_TAG; - static const std::string JSON_TEXT_TAG; - static const std::string JSON_ICON_TAG; - static const std::string JSON_BG_TAG; -}; - -class SecCompBase { -public: - SecCompBase() = default; - virtual ~SecCompBase() = default; - bool FromJson(const nlohmann::json& jsonSrc); - void ToJson(nlohmann::json& jsonRes) const; - std::string ToJsonStr(void) const; - virtual bool CompareComponentBasicInfo(SecCompBase *other, bool isRectCheck) const; - void SetValid(bool valid) - { - isValid_ = valid; - }; - - bool GetValid() - { - return isValid_; - }; - - // size - DimensionT fontSize_ = DEFAULT_DIMENSION; - DimensionT iconSize_ = DEFAULT_DIMENSION; - PaddingSize padding_; - DimensionT textIconSpace_ = DEFAULT_DIMENSION; - - // color - SecCompColor fontColor_; - SecCompColor iconColor_; - SecCompColor bgColor_; - - // border - DimensionT borderWidth_ = DEFAULT_DIMENSION; - - // parent effect - bool parentEffect_ = false; - - SecCompType type_ = UNKNOWN_SC_TYPE; - SecCompRect rect_; - SecCompRect windowRect_; - bool isValid_ = false; - - int32_t text_ = UNKNOWN_TEXT; - int32_t icon_ = UNKNOWN_ICON; - SecCompBackground bg_ = SecCompBackground::UNKNOWN_BG; - - int32_t nodeId_ = 0; -protected: - virtual bool IsParamValid() = 0; -private: - bool ParseDimension(const nlohmann::json& json, const std::string& tag, DimensionT& res); - bool ParseColor(const nlohmann::json& json, const std::string& tag, SecCompColor& res); - bool ParseBool(const nlohmann::json& json, const std::string& tag, bool& res); - bool ParsePadding(const nlohmann::json& json, const std::string& tag, PaddingSize& res); - bool ParseColors(const nlohmann::json& json, const std::string& tag); - bool ParseBorders(const nlohmann::json& json, const std::string& tag); - bool ParseSize(const nlohmann::json& json, const std::string& tag); - bool ParseParent(const nlohmann::json& json, const std::string& tag); - bool ParseRect(const nlohmann::json& json, const std::string& tag, SecCompRect& rect); - bool ParseStyle(const nlohmann::json& json, const std::string& tag); -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // SECURITY_COMPONENT_BASE_H - diff --git a/interfaces/inner_api/security_component/include/sec_comp_caller_authorization.h b/interfaces/inner_api/security_component/include/sec_comp_caller_authorization.h deleted file mode 100644 index d1564a0..0000000 --- a/interfaces/inner_api/security_component/include/sec_comp_caller_authorization.h +++ /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. - */ - -#ifndef INTERFACES_INNER_API_SECURITY_COMPONENT_CALLER_AYTHORIZATION_H -#define INTERFACES_INNER_API_SECURITY_COMPONENT_CALLER_AYTHORIZATION_H - -#include -#include -#include "nocopyable.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -class SecCompCallerAuthorization { -public: - static SecCompCallerAuthorization& GetInstance(); - virtual ~SecCompCallerAuthorization() = default; - void RegisterSecCompKitCaller(std::vector& callerList); - bool IsKitCaller(uintptr_t callerAddr); - -private: - SecCompCallerAuthorization() = default; - std::vector kitCallerList_; - bool isInit_ = false; - DISALLOW_COPY_AND_MOVE(SecCompCallerAuthorization); -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // INTERFACES_INNER_API_SECURITY_COMPONENT_CALLER_AYTHORIZATION_H - diff --git a/interfaces/inner_api/security_component/include/sec_comp_client.h b/interfaces/inner_api/security_component/include/sec_comp_client.h deleted file mode 100644 index 954fe11..0000000 --- a/interfaces/inner_api/security_component/include/sec_comp_client.h +++ /dev/null @@ -1,68 +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. - */ - -#ifndef SECURITY_COMPONENT_CLIENT_H -#define SECURITY_COMPONENT_CLIENT_H - -#include -#include -#include -#include "i_sec_comp_service.h" -#include "sec_comp_death_recipient.h" -#include "sec_comp_err.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -class SecCompClient final { -public: - static SecCompClient& GetInstance(); - - int32_t RegisterSecurityComponent(SecCompType type, const std::string& componentInfo, int32_t& scId); - int32_t UpdateSecurityComponent(int32_t scId, const std::string& componentInfo); - int32_t UnregisterSecurityComponent(int32_t scId); - int32_t ReportSecurityComponentClickEvent(int32_t scId, - const std::string& componentInfo, const SecCompClickEvent& touchInfo, sptr callerToken); - bool ReduceAfterVerifySavePermission(AccessToken::AccessTokenID tokenId); - sptr GetEnhanceRemoteObject(bool doLoadSa); - - void FinishStartSASuccess(const sptr& remoteObject); - void FinishStartSAFail(); - void OnRemoteDiedHandle(); - -private: - SecCompClient(); - virtual ~SecCompClient(); - DISALLOW_COPY_AND_MOVE(SecCompClient); - - bool TryToGetSecCompSa(); - bool StartLoadSecCompSa(); - void WaitForSecCompSa(); - void GetSecCompSa(); - void LoadSecCompSa(); - sptr GetProxy(bool doLoadSa); - void GetProxyFromRemoteObject(const sptr& remoteObject); - - std::mutex cvLock_; - bool readyFlag_ = false; - std::condition_variable secComCon_; - std::mutex proxyMutex_; - sptr proxy_ = nullptr; - sptr serviceDeathObserver_ = nullptr; -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // SECURITY_COMPONENT_CLIENT_H diff --git a/interfaces/inner_api/security_component/include/sec_comp_death_recipient.h b/interfaces/inner_api/security_component/include/sec_comp_death_recipient.h deleted file mode 100644 index 4a18525..0000000 --- a/interfaces/inner_api/security_component/include/sec_comp_death_recipient.h +++ /dev/null @@ -1,32 +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. - */ -#ifndef SECURITY_COMPONENT_DEATH_RECIPIENT_H -#define SECURITY_COMPONENT_DEATH_RECIPIENT_H - -#include "iremote_object.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -class SecCompDeathRecipient : public IRemoteObject::DeathRecipient { -public: - SecCompDeathRecipient() {} - virtual ~SecCompDeathRecipient() = default; - void OnRemoteDied(const wptr& object) override; -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // SECURITY_COMPONENT_DEATH_RECIPIENT_H diff --git a/interfaces/inner_api/security_component/include/sec_comp_info.h b/interfaces/inner_api/security_component/include/sec_comp_info.h deleted file mode 100644 index d02ebb2..0000000 --- a/interfaces/inner_api/security_component/include/sec_comp_info.h +++ /dev/null @@ -1,130 +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. - */ - -#ifndef SECURITY_COMPONENT_INFO_H -#define SECURITY_COMPONENT_INFO_H - -#include - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -static constexpr int32_t INVALID_SC_ID = -1; -using DimensionT = double; // unit is vp -static constexpr DimensionT DEFAULT_DIMENSION = 0.0; -static constexpr DimensionT MIN_FONT_SIZE = 12.0; -static constexpr DimensionT MIN_ICON_SIZE = 12.0; -static constexpr DimensionT MIN_PADDING_SIZE = 0.0; -static constexpr DimensionT MIN_PADDING_WITHOUT_BG = 4.0; -static constexpr uint32_t MAX_EXTRA_SIZE = 0x1000; - -struct PaddingSize { - DimensionT top = DEFAULT_DIMENSION; - DimensionT right = DEFAULT_DIMENSION; - DimensionT bottom = DEFAULT_DIMENSION; - DimensionT left = DEFAULT_DIMENSION; -}; - -enum SecCompType { - UNKNOWN_SC_TYPE = 0, - LOCATION_COMPONENT, - PASTE_COMPONENT, - SAVE_COMPONENT, - MAX_SC_TYPE -}; - -union SecCompColor { - struct { - uint8_t blue; - uint8_t green; - uint8_t red; - uint8_t alpha; - } argb; - uint32_t value; -}; - -inline bool IsComponentTypeValid(int32_t type) -{ - return (type > UNKNOWN_SC_TYPE && type < MAX_SC_TYPE); -} - -inline bool GreatOrEqual(double left, double right) -{ - constexpr double epsilon = -0.001; - return (left - right) > epsilon; -} - -inline bool GreatNotEqual(double left, double right) -{ - constexpr double epsilon = 0.001; - return (left - right) > epsilon; -} - -inline bool IsEqual(double left, double right) -{ - constexpr double epsilon = 0.001; - if (left > right) { - return (left - right) < epsilon; - } else if (right > left) { - return (right - left) < epsilon; - } else { - return true; - } -} - -class SecCompRect { -public: - SecCompRect() = default; - ~SecCompRect() = default; - - bool IsInRect(double x, double y) const - { - return (GreatOrEqual(x, x_) && GreatOrEqual((x_ + width_), x) && - GreatOrEqual(y, y_) && GreatOrEqual((y_ + height_), y)); - }; - - bool operator==(const SecCompRect& other) const - { - return (IsEqual(x_, other.x_)) && (IsEqual(y_, other.y_)) && - (IsEqual(width_, other.width_)) && (IsEqual(height_, other.height_)); - } - - DimensionT x_ = 0.0; - DimensionT y_ = 0.0; - DimensionT width_ = 0.0; - DimensionT height_ = 0.0; -}; - -struct ExtraInfo { - uint32_t dataSize; - uint8_t* data; -}; - -struct SecCompClickEvent { - double touchX; - double touchY; - uint64_t timestamp; - ExtraInfo extraInfo; -}; - -struct SecCompPointEvent { - double touchX; - double touchY; - uint64_t timestamp; -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // SECURITY_COMPONENT_INFO_H diff --git a/interfaces/inner_api/security_component/include/sec_comp_kit.h b/interfaces/inner_api/security_component/include/sec_comp_kit.h deleted file mode 100644 index 80c20c2..0000000 --- a/interfaces/inner_api/security_component/include/sec_comp_kit.h +++ /dev/null @@ -1,40 +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. - */ -#ifndef INTERFACES_INNER_API_SECURITY_COMPONENT_KIT_H -#define INTERFACES_INNER_API_SECURITY_COMPONENT_KIT_H - -#include -#include "accesstoken_kit.h" -#include "iremote_object.h" -#include "sec_comp_info.h" -#include "sec_comp_ui_register.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -class SecCompKit { -public: - static int32_t RegisterSecurityComponent(SecCompType type, std::string& componentInfo, int32_t& scId); - static int32_t UpdateSecurityComponent(int32_t scId, std::string& componentInfo); - static int32_t UnregisterSecurityComponent(int32_t scId); - static int32_t ReportSecurityComponentClickEvent(int32_t scId, - std::string& componentInfo, const SecCompClickEvent& touchInfo, sptr callerToken = nullptr); - static bool ReduceAfterVerifySavePermission(AccessToken::AccessTokenID tokenId); - static sptr GetEnhanceRemoteObject(bool isLoad); -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // INTERFACES_INNER_API_SECURITY_COMPONENT_KIT_H diff --git a/interfaces/inner_api/security_component/include/sec_comp_load_callback.h b/interfaces/inner_api/security_component/include/sec_comp_load_callback.h deleted file mode 100644 index 5513896..0000000 --- a/interfaces/inner_api/security_component/include/sec_comp_load_callback.h +++ /dev/null @@ -1,33 +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. - */ -#ifndef SECURITY_COMPONENT_LOAD_CALLBACK_H -#define SECURITY_COMPONENT_LOAD_CALLBACK_H - -#include "system_ability_load_callback_stub.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -class SecCompLoadCallback : public SystemAbilityLoadCallbackStub { -public: - explicit SecCompLoadCallback(); - - void OnLoadSystemAbilitySuccess(int32_t systemAbilityId, const sptr& remoteObject); - void OnLoadSystemAbilityFail(int32_t systemAbilityId); -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // SECURITY_COMPONENT_LOAD_CALLBACK_H diff --git a/interfaces/inner_api/security_component/include/sec_comp_proxy.h b/interfaces/inner_api/security_component/include/sec_comp_proxy.h deleted file mode 100644 index 729877b..0000000 --- a/interfaces/inner_api/security_component/include/sec_comp_proxy.h +++ /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. - */ -#ifndef SECURITY_COMPONENT_PROXY_H -#define SECURITY_COMPONENT_PROXY_H - -#include -#include "i_sec_comp_service.h" -#include "iremote_proxy.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -class SecCompProxy : public IRemoteProxy { -public: - explicit SecCompProxy(const sptr& impl); - ~SecCompProxy() override; - int32_t RegisterSecurityComponent(SecCompType type, const std::string& componentInfo, int32_t& scId) override; - int32_t UpdateSecurityComponent(int32_t scId, const std::string& componentInfo) override; - int32_t UnregisterSecurityComponent(int32_t scId) override; - int32_t ReportSecurityComponentClickEvent(int32_t scId, - const std::string& componentInfo, const SecCompClickEvent& touchInfo, sptr callerToken) override; - bool ReduceAfterVerifySavePermission(AccessToken::AccessTokenID tokenId) override; - sptr GetEnhanceRemoteObject() override; - -private: - static inline BrokerDelegator delegator_; -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // SECURITY_COMPONENT_PROXY_H diff --git a/interfaces/inner_api/security_component/include/sec_comp_ui_register.h b/interfaces/inner_api/security_component/include/sec_comp_ui_register.h deleted file mode 100644 index b415bb1..0000000 --- a/interfaces/inner_api/security_component/include/sec_comp_ui_register.h +++ /dev/null @@ -1,33 +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. - */ -#ifndef INTERFACES_INNER_API_SECURITY_COMPONENT_UI_REGISTER_H -#define INTERFACES_INNER_API_SECURITY_COMPONENT_UI_REGISTER_H - -#include "i_sec_comp_probe.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -class SecCompUiRegister { -public: - SecCompUiRegister(std::vector& callerList, ISecCompProbe* probe); - virtual ~SecCompUiRegister() = default; - static ISecCompProbe* callbackProbe; -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // INTERFACES_INNER_API_SECURITY_COMPONENT_UI_REGISTER_H - diff --git a/interfaces/inner_api/security_component/include/security_component_service_ipc_interface_code.h b/interfaces/inner_api/security_component/include/security_component_service_ipc_interface_code.h deleted file mode 100644 index a873e90..0000000 --- a/interfaces/inner_api/security_component/include/security_component_service_ipc_interface_code.h +++ /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. - */ - -#ifndef SECURITY_COMPONENT_IPC_INTERFACE_CODE_H -#define SECURITY_COMPONENT_IPC_INTERFACE_CODE_H - -/* SAID: 3506 */ -namespace OHOS { -namespace Security { -namespace SecurityComponent { -enum SecurityComponentServiceInterfaceCode { - REGISTER_SECURITY_COMPONENT = 0, - UPDATE_SECURITY_COMPONENT = 1, - UNREGISTER_SECURITY_COMPONENT = 2, - REPORT_SECURITY_COMPONENT_CLICK_EVENT = 3, - GET_SECURITY_COMPONENT_ENHANCE_OBJECT = 4, - VERIFY_TEMP_SAVE_PERMISSION = 5, -}; - -enum EnhanceInterfaceCode { - REGISTER_CHECK_CALLBACK = 0, -}; - -enum EnhanceCallbackCheckCode { - GET_CALLER_SECURITY_COMPONENT_INFO = 0, -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // SECURITY_COMPONENT_IPC_INTERFACE_CODE_H - diff --git a/interfaces/inner_api/security_component/src/sec_comp_caller_authorization.cpp b/interfaces/inner_api/security_component/src/sec_comp_caller_authorization.cpp deleted file mode 100644 index b98be28..0000000 --- a/interfaces/inner_api/security_component/src/sec_comp_caller_authorization.cpp +++ /dev/null @@ -1,67 +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 "sec_comp_caller_authorization.h" - -#include "sec_comp_log.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -namespace { -static constexpr int32_t MAX_FUNC_ASM_SIZE = 0x250; -static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { - LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompCallerAuthorization"}; -static constexpr size_t MAX_CALLER_SIZE = 10; -} - -void SecCompCallerAuthorization::RegisterSecCompKitCaller(std::vector& callerList) -{ - if (isInit_) { - SC_LOG_ERROR(LABEL, "can not init repeatly"); - return; - } - - isInit_ = true; - if ((callerList.size() == 0) || (callerList.size() > MAX_CALLER_SIZE)) { - SC_LOG_ERROR(LABEL, "caller size is invalid"); - return; - } - - kitCallerList_ = callerList; -} - -bool SecCompCallerAuthorization::IsKitCaller(uintptr_t callerAddr) -{ - if (!isInit_) { - SC_LOG_INFO(LABEL, "caller authorization has not init"); - return true; - } - for (size_t i = 0; i < kitCallerList_.size(); i++) { - if ((callerAddr > kitCallerList_[i]) && (callerAddr < kitCallerList_[i] + MAX_FUNC_ASM_SIZE)) { - return true; - } - } - return false; -} - -SecCompCallerAuthorization& SecCompCallerAuthorization::GetInstance() -{ - static SecCompCallerAuthorization instance; - return instance; -} -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS - diff --git a/interfaces/inner_api/security_component/src/sec_comp_client.cpp b/interfaces/inner_api/security_component/src/sec_comp_client.cpp deleted file mode 100644 index 0e20cee..0000000 --- a/interfaces/inner_api/security_component/src/sec_comp_client.cpp +++ /dev/null @@ -1,258 +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 "sec_comp_client.h" - -#include "iservice_registry.h" -#include "sec_comp_load_callback.h" -#include "sec_comp_log.h" -#include "sec_comp_proxy.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -namespace { -static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompClient"}; -} // namespace - -SecCompClient& SecCompClient::GetInstance() -{ - static SecCompClient instance; - return instance; -} - -SecCompClient::SecCompClient() -{} - -SecCompClient::~SecCompClient() -{ - if (proxy_ == nullptr) { - return; - } - auto remoteObj = proxy_->AsObject(); - if (remoteObj == nullptr) { - return; - } - if (serviceDeathObserver_ != nullptr) { - remoteObj->RemoveDeathRecipient(serviceDeathObserver_); - } -} - -int32_t SecCompClient::RegisterSecurityComponent(SecCompType type, - const std::string& componentInfo, int32_t& scId) -{ - auto proxy = GetProxy(true); - if (proxy == nullptr) { - SC_LOG_ERROR(LABEL, "Proxy is null"); - return SC_SERVICE_ERROR_VALUE_INVALID; - } - - return proxy->RegisterSecurityComponent(type, componentInfo, scId); -} - -int32_t SecCompClient::UpdateSecurityComponent(int32_t scId, const std::string& componentInfo) -{ - auto proxy = GetProxy(true); - if (proxy == nullptr) { - SC_LOG_ERROR(LABEL, "Proxy is null"); - return SC_SERVICE_ERROR_VALUE_INVALID; - } - - return proxy->UpdateSecurityComponent(scId, componentInfo); -} - -int32_t SecCompClient::UnregisterSecurityComponent(int32_t scId) -{ - auto proxy = GetProxy(true); - if (proxy == nullptr) { - SC_LOG_ERROR(LABEL, "Proxy is null"); - return SC_SERVICE_ERROR_VALUE_INVALID; - } - - return proxy->UnregisterSecurityComponent(scId); -} - -int32_t SecCompClient::ReportSecurityComponentClickEvent(int32_t scId, - const std::string& componentInfo, const SecCompClickEvent& touchInfo, sptr callerToken) -{ - auto proxy = GetProxy(true); - if (proxy == nullptr) { - SC_LOG_ERROR(LABEL, "Proxy is null"); - return SC_SERVICE_ERROR_VALUE_INVALID; - } - - return proxy->ReportSecurityComponentClickEvent(scId, componentInfo, touchInfo, callerToken); -} - -bool SecCompClient::ReduceAfterVerifySavePermission(AccessToken::AccessTokenID tokenId) -{ - auto proxy = GetProxy(false); - if (proxy == nullptr) { - SC_LOG_ERROR(LABEL, "Proxy is null"); - return false; - } - - return proxy->ReduceAfterVerifySavePermission(tokenId); -} - -sptr SecCompClient::GetEnhanceRemoteObject(bool doLoadSa) -{ - auto proxy = GetProxy(doLoadSa); - if (proxy == nullptr) { - return nullptr; - } - - return proxy->GetEnhanceRemoteObject(); -} - -bool SecCompClient::StartLoadSecCompSa() -{ - { - std::unique_lock lock(cvLock_); - readyFlag_ = false; - } - auto sam = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); - if (sam == nullptr) { - SC_LOG_ERROR(LABEL, "GetSystemAbilityManager return null"); - return false; - } - sptr ptrSecCompLoadCallback = - new (std::nothrow) SecCompLoadCallback(); - if (ptrSecCompLoadCallback == nullptr) { - SC_LOG_ERROR(LABEL, "New ptrSecCompLoadCallback fail."); - return false; - } - - int32_t result = sam->LoadSystemAbility(SA_ID_SECURITY_COMPONENT_SERVICE, - ptrSecCompLoadCallback); - if (result != SC_OK) { - SC_LOG_ERROR(LABEL, "LoadSystemAbility %{public}d failed", SA_ID_SECURITY_COMPONENT_SERVICE); - return false; - } - SC_LOG_INFO(LABEL, "Notify samgr load sa %{public}d, waiting for service start", SA_ID_SECURITY_COMPONENT_SERVICE); - return true; -} - -bool SecCompClient::TryToGetSecCompSa() -{ - auto sam = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); - if (sam == nullptr) { - SC_LOG_ERROR(LABEL, "GetSystemAbilityManager return null"); - return false; - } - - auto secCompSa = sam->CheckSystemAbility(SA_ID_SECURITY_COMPONENT_SERVICE); - if (secCompSa == nullptr) { - SC_LOG_INFO(LABEL, "Service is not start."); - return false; - } - GetProxyFromRemoteObject(secCompSa); - return true; -} - -void SecCompClient::WaitForSecCompSa() -{ - // wait_for release lock and block until time out(1s) or match the condition with notice - std::unique_lock lock(cvLock_); - auto waitStatus = secComCon_.wait_for( - lock, std::chrono::milliseconds(SA_ID_SECURITY_COMPONENT_SERVICE), [this]() { return readyFlag_; }); - if (!waitStatus) { - // time out or loadcallback fail - SC_LOG_ERROR(LABEL, "security component load sa timeout"); - return; - } -} - -void SecCompClient::FinishStartSASuccess(const sptr& remoteObject) -{ - GetProxyFromRemoteObject(remoteObject); - // get lock which wait_for release and send a notice so that wait_for can out of block - std::unique_lock lock(cvLock_); - readyFlag_ = true; - secComCon_.notify_one(); -} - -void SecCompClient::FinishStartSAFail() -{ - SC_LOG_ERROR(LABEL, "get security component sa failed."); - // get lock which wait_for release and send a notice - std::unique_lock lock(cvLock_); - readyFlag_ = true; - secComCon_.notify_one(); -} - -void SecCompClient::LoadSecCompSa() -{ - if (!StartLoadSecCompSa()) { - return; - } - WaitForSecCompSa(); -} - -void SecCompClient::OnRemoteDiedHandle() -{ - SC_LOG_ERROR(LABEL, "Remote service died"); - std::unique_lock lock(proxyMutex_); - proxy_ = nullptr; - serviceDeathObserver_ = nullptr; - { - std::unique_lock lock1(cvLock_); - readyFlag_ = false; - } -} - -void SecCompClient::GetProxyFromRemoteObject(const sptr& remoteObject) -{ - if (remoteObject == nullptr) { - return; - } - - sptr serviceDeathObserver = new (std::nothrow) SecCompDeathRecipient(); - if (serviceDeathObserver == nullptr) { - SC_LOG_ERROR(LABEL, "Alloc service death observer fail"); - return; - } - - if (!remoteObject->AddDeathRecipient(serviceDeathObserver)) { - SC_LOG_ERROR(LABEL, "Add service death observer fail"); - return; - } - - auto proxy = iface_cast(remoteObject); - if (proxy == nullptr) { - SC_LOG_ERROR(LABEL, "iface_cast get null"); - return; - } - proxy_ = proxy; - serviceDeathObserver_ = serviceDeathObserver; - SC_LOG_INFO(LABEL, "GetSystemAbility %{public}d success", SA_ID_SECURITY_COMPONENT_SERVICE); - return; -} - -sptr SecCompClient::GetProxy(bool doLoadSa) -{ - std::unique_lock lock(proxyMutex_); - if (proxy_ != nullptr) { - return proxy_; - } - if (TryToGetSecCompSa() || !doLoadSa) { - return proxy_; - } - - LoadSecCompSa(); - return proxy_; -} -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS diff --git a/interfaces/inner_api/security_component/src/sec_comp_death_recipient.cpp b/interfaces/inner_api/security_component/src/sec_comp_death_recipient.cpp deleted file mode 100644 index bbdf7fc..0000000 --- a/interfaces/inner_api/security_component/src/sec_comp_death_recipient.cpp +++ /dev/null @@ -1,28 +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 "sec_comp_death_recipient.h" - -#include "sec_comp_client.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -void SecCompDeathRecipient::OnRemoteDied(const wptr& object) -{ - SecCompClient::GetInstance().OnRemoteDiedHandle(); -} -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS diff --git a/interfaces/inner_api/security_component/src/sec_comp_kit.cpp b/interfaces/inner_api/security_component/src/sec_comp_kit.cpp deleted file mode 100644 index 05b7bd2..0000000 --- a/interfaces/inner_api/security_component/src/sec_comp_kit.cpp +++ /dev/null @@ -1,138 +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 "sec_comp_kit.h" - -#include "hisysevent.h" -#include "ipc_skeleton.h" -#include "sec_comp_caller_authorization.h" -#include "sec_comp_client.h" -#include "sec_comp_enhance_adapter.h" -#include "sec_comp_log.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -namespace { -static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompKit"}; -} // namespace - -int32_t SecCompKit::RegisterSecurityComponent(SecCompType type, - std::string& componentInfo, int32_t& scId) -{ - if (!SecCompCallerAuthorization::GetInstance().IsKitCaller( - reinterpret_cast(__builtin_return_address(0)))) { - SC_LOG_ERROR(LABEL, "register security component fail, caller invalid"); - HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::SEC_COMPONENT, "CALLER_CHECK_FAILED", - HiviewDFX::HiSysEvent::EventType::SECURITY, "CALLER_UID", IPCSkeleton::GetCallingUid(), - "CALLER_PID", IPCSkeleton::GetCallingPid(), "CALL_SCENE", "REGITSTER"); - return SC_SERVICE_ERROR_CALLER_INVALID; - } - - if (!SecCompEnhanceAdapter::EnhanceDataPreprocess(componentInfo)) { - SC_LOG_ERROR(LABEL, "Preprocess security component fail"); - return SC_ENHANCE_ERROR_VALUE_INVALID; - } - - int32_t res = SecCompClient::GetInstance().RegisterSecurityComponent(type, componentInfo, scId); - if (res != SC_OK) { - SC_LOG_ERROR(LABEL, "register security component fail, error: %{public}d", res); - return res; - } - SecCompEnhanceAdapter::RegisterScIdEnhance(scId); - HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::SEC_COMPONENT, "REGISTER_SUCCESS", - HiviewDFX::HiSysEvent::EventType::BEHAVIOR, "CALLER_UID", IPCSkeleton::GetCallingUid(), - "CALLER_PID", IPCSkeleton::GetCallingPid(), "SC_ID", scId, "SC_TYPE", type); - return res; -} - -int32_t SecCompKit::UpdateSecurityComponent(int32_t scId, std::string& componentInfo) -{ - if (!SecCompCallerAuthorization::GetInstance().IsKitCaller( - reinterpret_cast(__builtin_return_address(0)))) { - SC_LOG_ERROR(LABEL, "update security component fail, caller invalid"); - HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::SEC_COMPONENT, "CALLER_CHECK_FAILED", - HiviewDFX::HiSysEvent::EventType::SECURITY, "CALLER_UID", IPCSkeleton::GetCallingUid(), - "CALLER_PID", IPCSkeleton::GetCallingPid(), "CALL_SCENE", "UPDATE"); - return SC_SERVICE_ERROR_CALLER_INVALID; - } - - if (!SecCompEnhanceAdapter::EnhanceDataPreprocess(scId, componentInfo)) { - SC_LOG_ERROR(LABEL, "Preprocess security component fail"); - return SC_ENHANCE_ERROR_VALUE_INVALID; - } - - int32_t res = SecCompClient::GetInstance().UpdateSecurityComponent(scId, componentInfo); - if (res != SC_OK) { - SC_LOG_ERROR(LABEL, "update security component fail, error: %{public}d", res); - } - return res; -} - -int32_t SecCompKit::UnregisterSecurityComponent(int32_t scId) -{ - int32_t res = SecCompClient::GetInstance().UnregisterSecurityComponent(scId); - SecCompEnhanceAdapter::UnregisterScIdEnhance(scId); - if (res != SC_OK) { - SC_LOG_ERROR(LABEL, "unregister security component fail, error: %{public}d", res); - return res; - } - HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::SEC_COMPONENT, "UNREGISTER_SUCCESS", - HiviewDFX::HiSysEvent::EventType::BEHAVIOR, "CALLER_UID", IPCSkeleton::GetCallingUid(), - "CALLER_PID", IPCSkeleton::GetCallingPid(), "SC_ID", scId); - return res; -} - -int32_t SecCompKit::ReportSecurityComponentClickEvent(int32_t scId, - std::string& componentInfo, const SecCompClickEvent& touchInfo, sptr callerToken) -{ - if (!SecCompCallerAuthorization::GetInstance().IsKitCaller( - reinterpret_cast(__builtin_return_address(0)))) { - SC_LOG_ERROR(LABEL, "report click event fail, caller invalid"); - HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::SEC_COMPONENT, "CALLER_CHECK_FAILED", - HiviewDFX::HiSysEvent::EventType::SECURITY, "CALLER_UID", IPCSkeleton::GetCallingUid(), - "CALLER_PID", IPCSkeleton::GetCallingPid(), "CALL_SCENE", "CLICK"); - return SC_SERVICE_ERROR_CALLER_INVALID; - } - - if (!SecCompEnhanceAdapter::EnhanceDataPreprocess(scId, componentInfo)) { - SC_LOG_ERROR(LABEL, "Preprocess security component fail"); - return SC_ENHANCE_ERROR_VALUE_INVALID; - } - - int32_t res = - SecCompClient::GetInstance().ReportSecurityComponentClickEvent(scId, componentInfo, touchInfo, callerToken); - if (res != SC_OK) { - SC_LOG_ERROR(LABEL, "report click event fail, error: %{public}d", res); - } - return res; -} - -bool SecCompKit::ReduceAfterVerifySavePermission(AccessToken::AccessTokenID tokenId) -{ - bool res = - SecCompClient::GetInstance().ReduceAfterVerifySavePermission(tokenId); - if (!res) { - SC_LOG_ERROR(LABEL, "verify temp save permission, error: %{public}d", res); - } - return res; -} - -sptr SecCompKit::GetEnhanceRemoteObject(bool isLoad) -{ - return SecCompClient::GetInstance().GetEnhanceRemoteObject(isLoad); -} -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS diff --git a/interfaces/inner_api/security_component/src/sec_comp_load_callback.cpp b/interfaces/inner_api/security_component/src/sec_comp_load_callback.cpp deleted file mode 100644 index 8fd9f26..0000000 --- a/interfaces/inner_api/security_component/src/sec_comp_load_callback.cpp +++ /dev/null @@ -1,61 +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 "sec_comp_load_callback.h" - -#include "i_sec_comp_service.h" -#include "sec_comp_client.h" -#include "sec_comp_log.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -namespace { -static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompClient"}; -} // namespace -SecCompLoadCallback::SecCompLoadCallback() {} - -void SecCompLoadCallback::OnLoadSystemAbilitySuccess( - int32_t systemAbilityId, const sptr& remoteObject) -{ - if (systemAbilityId != SA_ID_SECURITY_COMPONENT_SERVICE) { - SC_LOG_ERROR(LABEL, "start systemabilityId is not security_component!"); - return; - } - - if (remoteObject == nullptr) { - SC_LOG_ERROR(LABEL, "remoteObject is null."); - SecCompClient::GetInstance().FinishStartSAFail(); - return; - } - - SC_LOG_INFO(LABEL, "Start systemAbilityId: %{public}d success!", systemAbilityId); - - SecCompClient::GetInstance().FinishStartSASuccess(remoteObject); -} - -void SecCompLoadCallback::OnLoadSystemAbilityFail(int32_t systemAbilityId) -{ - if (systemAbilityId != SA_ID_SECURITY_COMPONENT_SERVICE) { - SC_LOG_ERROR(LABEL, "start systemabilityId is not security_component!"); - return; - } - - SC_LOG_ERROR(LABEL, "Start systemAbilityId: %{public}d failed.", systemAbilityId); - - SecCompClient::GetInstance().FinishStartSAFail(); -} -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS diff --git a/interfaces/inner_api/security_component/src/sec_comp_proxy.cpp b/interfaces/inner_api/security_component/src/sec_comp_proxy.cpp deleted file mode 100644 index 3d8e205..0000000 --- a/interfaces/inner_api/security_component/src/sec_comp_proxy.cpp +++ /dev/null @@ -1,274 +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 "sec_comp_proxy.h" - -#include "sec_comp_click_event_parcel.h" -#include "sec_comp_err.h" -#include "sec_comp_log.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -namespace { -static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompProxy"}; -} - -SecCompProxy::SecCompProxy(const sptr& impl) : IRemoteProxy(impl) -{} - -SecCompProxy::~SecCompProxy() -{} - -int32_t SecCompProxy::RegisterSecurityComponent(SecCompType type, - const std::string& componentInfo, int32_t& scId) -{ - MessageParcel data; - if (!data.WriteInterfaceToken(SecCompProxy::GetDescriptor())) { - SC_LOG_ERROR(LABEL, "Write descriptor fail"); - return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; - } - - if (!data.WriteUint32(type)) { - SC_LOG_ERROR(LABEL, "Write Uint32 fail"); - return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; - } - if (!data.WriteString(componentInfo)) { - SC_LOG_ERROR(LABEL, "Write string fail"); - return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; - } - - MessageParcel reply; - MessageOption option(MessageOption::TF_SYNC); - sptr remote = Remote(); - if (remote == nullptr) { - SC_LOG_ERROR(LABEL, "Remote service is null"); - return SC_SERVICE_ERROR_IPC_REQUEST_FAIL; - } - int32_t requestResult = remote->SendRequest( - static_cast(SecurityComponentServiceInterfaceCode::REGISTER_SECURITY_COMPONENT), - data, reply, option); - if (requestResult != SC_OK) { - SC_LOG_ERROR(LABEL, "Request fail, result: %{public}d", requestResult); - return requestResult; - } - int32_t res; - if (!reply.ReadInt32(res)) { - SC_LOG_ERROR(LABEL, "Read result int32 fail"); - return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; - } - - if (!reply.ReadInt32(scId)) { - SC_LOG_ERROR(LABEL, "Read scId int32 fail"); - return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; - } - return res; -} - -int32_t SecCompProxy::UpdateSecurityComponent(int32_t scId, const std::string& componentInfo) -{ - MessageParcel data; - if (!data.WriteInterfaceToken(SecCompProxy::GetDescriptor())) { - SC_LOG_ERROR(LABEL, "Write descriptor fail"); - return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; - } - - if (!data.WriteInt32(scId)) { - SC_LOG_ERROR(LABEL, "Write Int32 fail"); - return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; - } - if (!data.WriteString(componentInfo)) { - SC_LOG_ERROR(LABEL, "Write string fail"); - return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; - } - - MessageParcel reply; - MessageOption option(MessageOption::TF_SYNC); - sptr remote = Remote(); - if (remote == nullptr) { - SC_LOG_ERROR(LABEL, "Remote service is null"); - return SC_SERVICE_ERROR_IPC_REQUEST_FAIL; - } - int32_t requestResult = remote->SendRequest( - static_cast(SecurityComponentServiceInterfaceCode::UPDATE_SECURITY_COMPONENT), data, reply, option); - if (requestResult != SC_OK) { - SC_LOG_ERROR(LABEL, "Request fail, result: %{public}d", requestResult); - return requestResult; - } - int32_t res; - if (!reply.ReadInt32(res)) { - SC_LOG_ERROR(LABEL, "Read result int32 fail"); - return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; - } - return res; -} - -int32_t SecCompProxy::UnregisterSecurityComponent(int32_t scId) -{ - MessageParcel data; - if (!data.WriteInterfaceToken(SecCompProxy::GetDescriptor())) { - SC_LOG_ERROR(LABEL, "Write descriptor fail"); - return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; - } - - if (!data.WriteInt32(scId)) { - SC_LOG_ERROR(LABEL, "Write Int32 fail"); - return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; - } - - MessageParcel reply; - MessageOption option(MessageOption::TF_SYNC); - sptr remote = Remote(); - if (remote == nullptr) { - SC_LOG_ERROR(LABEL, "Remote service is null"); - return SC_SERVICE_ERROR_IPC_REQUEST_FAIL; - } - int32_t requestResult = remote->SendRequest( - static_cast(SecurityComponentServiceInterfaceCode::UNREGISTER_SECURITY_COMPONENT), - data, reply, option); - if (requestResult != SC_OK) { - SC_LOG_ERROR(LABEL, "Request fail, result: %{public}d", requestResult); - return requestResult; - } - int32_t res; - if (!reply.ReadInt32(res)) { - SC_LOG_ERROR(LABEL, "Read int32 fail"); - return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; - } - return res; -} - -int32_t SecCompProxy::ReportSecurityComponentClickEvent(int32_t scId, - const std::string& componentInfo, const SecCompClickEvent& touchInfo, sptr callerToken) -{ - MessageParcel data; - if (!data.WriteInterfaceToken(SecCompProxy::GetDescriptor())) { - SC_LOG_ERROR(LABEL, "Write descriptor fail"); - return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; - } - - if (!data.WriteInt32(scId)) { - SC_LOG_ERROR(LABEL, "Write Uint32 fail"); - return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; - } - - if (!data.WriteString(componentInfo)) { - SC_LOG_ERROR(LABEL, "Write string fail"); - return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; - } - - sptr parcel = new (std::nothrow) SecCompClickEventParcel(); - if (parcel == nullptr) { - SC_LOG_ERROR(LABEL, "New click event parcel failed"); - return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; - } - parcel->touchInfoParams_ = touchInfo; - if (!data.WriteParcelable(parcel)) { - SC_LOG_ERROR(LABEL, "Write touchInfo fail"); - return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; - } - - if ((callerToken != nullptr) && !data.WriteRemoteObject(callerToken)) { - SC_LOG_ERROR(LABEL, "Write caller token fail"); - return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; - } - - MessageParcel reply; - MessageOption option(MessageOption::TF_SYNC); - sptr remote = Remote(); - if (remote == nullptr) { - SC_LOG_ERROR(LABEL, "Remote service is null"); - return SC_SERVICE_ERROR_IPC_REQUEST_FAIL; - } - int32_t requestResult = remote->SendRequest( - static_cast(SecurityComponentServiceInterfaceCode::REPORT_SECURITY_COMPONENT_CLICK_EVENT), - data, reply, option); - if (requestResult != SC_OK) { - SC_LOG_ERROR(LABEL, "Request fail, result: %{public}d", requestResult); - return requestResult; - } - int32_t res; - if (!reply.ReadInt32(res)) { - SC_LOG_ERROR(LABEL, "Read int32 fail"); - return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; - } - return res; -} - -bool SecCompProxy::ReduceAfterVerifySavePermission(AccessToken::AccessTokenID tokenId) -{ - MessageParcel data; - if (!data.WriteInterfaceToken(SecCompProxy::GetDescriptor())) { - SC_LOG_ERROR(LABEL, "Write descriptor fail"); - return false; - } - - if (!data.WriteUint32(tokenId)) { - SC_LOG_ERROR(LABEL, "Write Uint32 fail"); - return false; - } - - MessageParcel reply; - MessageOption option(MessageOption::TF_SYNC); - sptr remote = Remote(); - if (remote == nullptr) { - SC_LOG_ERROR(LABEL, "Remote service is null"); - return false; - } - int32_t requestResult = remote->SendRequest( - static_cast(SecurityComponentServiceInterfaceCode::VERIFY_TEMP_SAVE_PERMISSION), - data, reply, option); - if (requestResult != SC_OK) { - SC_LOG_ERROR(LABEL, "Request fail, result: %{public}d", requestResult); - return false; - } - bool res; - if (!reply.ReadBool(res)) { - SC_LOG_ERROR(LABEL, "Read bool fail"); - return false; - } - return res; -} - -sptr SecCompProxy::GetEnhanceRemoteObject() -{ - MessageParcel data; - if (!data.WriteInterfaceToken(SecCompProxy::GetDescriptor())) { - SC_LOG_ERROR(LABEL, "Write descriptor fail"); - return nullptr; - } - - MessageParcel reply; - MessageOption option(MessageOption::TF_SYNC); - sptr remote = Remote(); - if (remote == nullptr) { - SC_LOG_ERROR(LABEL, "Remote service is null"); - return nullptr; - } - int32_t requestResult = remote->SendRequest( - static_cast(SecurityComponentServiceInterfaceCode::GET_SECURITY_COMPONENT_ENHANCE_OBJECT), - data, reply, option); - if (requestResult != SC_OK) { - SC_LOG_ERROR(LABEL, "Request fail, result: %{public}d", requestResult); - return nullptr; - } - sptr callback = reply.ReadRemoteObject(); - if (callback == nullptr) { - SC_LOG_ERROR(LABEL, "Read remote object fail"); - } - return callback; -} -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS diff --git a/interfaces/inner_api/security_component/src/sec_comp_ui_register.cpp b/interfaces/inner_api/security_component/src/sec_comp_ui_register.cpp deleted file mode 100644 index a94215f..0000000 --- a/interfaces/inner_api/security_component/src/sec_comp_ui_register.cpp +++ /dev/null @@ -1,39 +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 "sec_comp_ui_register.h" - -#include "sec_comp_caller_authorization.h" -#include "sec_comp_log.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -namespace { -static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { - LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompUiRegister"}; -} // namespace - -ISecCompProbe* SecCompUiRegister::callbackProbe = nullptr; - -SecCompUiRegister::SecCompUiRegister(std::vector& callerList, ISecCompProbe* probe) -{ - SC_LOG_INFO(LABEL, "Init"); - SecCompCallerAuthorization::GetInstance().RegisterSecCompKitCaller(callerList); - callbackProbe = probe; -} -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS - diff --git a/interfaces/inner_api/security_component/test/BUILD.gn b/interfaces/inner_api/security_component/test/BUILD.gn deleted file mode 100644 index 0aabcdc..0000000 --- a/interfaces/inner_api/security_component/test/BUILD.gn +++ /dev/null @@ -1,191 +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("//build/test.gni") - -sec_comp_root_dir = "../../../.." - -ohos_unittest("sec_comp_sdk_test") { - subsystem_name = "security" - part_name = "security_component" - module_out_path = part_name + "/" + part_name - - include_dirs = [ - "${sec_comp_root_dir}/frameworks/common/include", - "${sec_comp_root_dir}/frameworks/security_component/include", - "${sec_comp_root_dir}/interfaces/inner_api/security_component/include", - ] - - sources = [ - "unittest/src/location_button_test.cpp", - "unittest/src/paste_button_test.cpp", - "unittest/src/save_button_test.cpp", - "unittest/src/sec_comp_kit_test.cpp", - ] - configs = [ "${sec_comp_root_dir}/config:coverage_flags" ] - cflags_cc = [ "-DHILOG_ENABLE" ] - - deps = [ - "${sec_comp_root_dir}/frameworks:libsecurity_component_framework", - "${sec_comp_root_dir}/interfaces/inner_api/security_component:libsecurity_component_sdk", - ] - - external_deps = [ - "access_token:libaccesstoken_sdk", - "c_utils:utils", - "hilog:libhilog", - "hisysevent:libhisysevent", - "ipc:ipc_core", - ] -} - -ohos_unittest("sec_comp_register_test") { - subsystem_name = "security" - part_name = "security_component" - module_out_path = part_name + "/" + part_name - - include_dirs = [ - "${sec_comp_root_dir}/frameworks/common/include", - "${sec_comp_root_dir}/frameworks/security_component/include", - "${sec_comp_root_dir}/interfaces/inner_api/security_component/include", - ] - - sources = [ - "unittest/src/location_button_sample_build.cpp", - "unittest/src/sec_comp_register_callback_test.cpp", - ] - configs = [ "${sec_comp_root_dir}/config:coverage_flags" ] - cflags_cc = [ "-DHILOG_ENABLE" ] - - deps = [ - "${sec_comp_root_dir}/frameworks:libsecurity_component_framework", - "${sec_comp_root_dir}/interfaces/inner_api/security_component:libsecurity_component_sdk", - ] - - external_deps = [ - "access_token:libaccesstoken_sdk", - "c_utils:utils", - "hilog:libhilog", - "hisysevent:libhisysevent", - "ipc:ipc_core", - ] -} - -ohos_unittest("sec_comp_report_click_without_hmac_test") { - subsystem_name = "security" - part_name = "security_component" - module_out_path = part_name + "/" + part_name - - include_dirs = [ - "${sec_comp_root_dir}/frameworks/common/include", - "${sec_comp_root_dir}/frameworks/security_component/include", - "${sec_comp_root_dir}/interfaces/inner_api/security_component/include", - ] - - sources = [ - "unittest/src/location_button_sample_build.cpp", - "unittest/src/sec_comp_report_click_without_hmac_test.cpp", - ] - configs = [ "${sec_comp_root_dir}/config:coverage_flags" ] - cflags_cc = [ "-DHILOG_ENABLE" ] - - deps = [ - "${sec_comp_root_dir}/frameworks:libsecurity_component_framework", - "${sec_comp_root_dir}/interfaces/inner_api/security_component:libsecurity_component_sdk", - ] - - external_deps = [ - "access_token:libaccesstoken_sdk", - "c_utils:utils", - "hilog:libhilog", - "hisysevent:libhisysevent", - "ipc:ipc_core", - ] -} - -ohos_unittest("sec_comp_register_without_callback_test") { - subsystem_name = "security" - part_name = "security_component" - module_out_path = part_name + "/" + part_name - - include_dirs = [ - "${sec_comp_root_dir}/frameworks/common/include", - "${sec_comp_root_dir}/frameworks/security_component/include", - "${sec_comp_root_dir}/interfaces/inner_api/security_component/include", - ] - - sources = [ - "unittest/src/location_button_sample_build.cpp", - "unittest/src/sec_comp_register_without_callback_test.cpp", - ] - configs = [ "${sec_comp_root_dir}/config:coverage_flags" ] - cflags_cc = [ "-DHILOG_ENABLE" ] - - deps = [ - "${sec_comp_root_dir}/frameworks:libsecurity_component_framework", - "${sec_comp_root_dir}/interfaces/inner_api/security_component:libsecurity_component_sdk", - ] - - external_deps = [ - "access_token:libaccesstoken_sdk", - "c_utils:utils", - "hilog:libhilog", - "hisysevent:libhisysevent", - "ipc:ipc_core", - ] -} - -ohos_unittest("sec_comp_register_challenge_test") { - subsystem_name = "security" - part_name = "security_component" - module_out_path = part_name + "/" + part_name - - include_dirs = [ - "${sec_comp_root_dir}/frameworks/common/include", - "${sec_comp_root_dir}/frameworks/enhance_adapter/include", - "${sec_comp_root_dir}/frameworks/security_component/include", - "${sec_comp_root_dir}/interfaces/inner_api/security_component/include", - ] - - sources = [ - "unittest/src/location_button_sample_build.cpp", - "unittest/src/sec_comp_register_challenge_test.cpp", - ] - configs = [ "${sec_comp_root_dir}/config:coverage_flags" ] - cflags_cc = [ "-DHILOG_ENABLE" ] - - deps = [ - "${sec_comp_root_dir}/frameworks:libsecurity_component_enhance_adapter", - "${sec_comp_root_dir}/frameworks:libsecurity_component_framework", - "${sec_comp_root_dir}/interfaces/inner_api/security_component:libsecurity_component_sdk", - ] - - external_deps = [ - "access_token:libaccesstoken_sdk", - "c_utils:utils", - "hilog:libhilog", - "hisysevent:libhisysevent", - "ipc:ipc_core", - ] -} - -group("unittest") { - testonly = true - deps = [ - ":sec_comp_sdk_test", - ":sec_comp_register_challenge_test", - ":sec_comp_register_test", - ":sec_comp_register_without_callback_test", - ":sec_comp_report_click_without_hmac_test" - ] -} diff --git a/interfaces/inner_api/security_component/test/unittest/src/location_button_sample_build.cpp b/interfaces/inner_api/security_component/test/unittest/src/location_button_sample_build.cpp deleted file mode 100644 index 6cdb68d..0000000 --- a/interfaces/inner_api/security_component/test/unittest/src/location_button_sample_build.cpp +++ /dev/null @@ -1,78 +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 "location_button_sample_build.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -static const std::string WRONG_TYPE = "wrongType"; -static constexpr float TEST_SIZE = 100.0; -static constexpr double TEST_COORDINATE = 100.0; -static constexpr double TEST_DIMENSION = 100.0; -static constexpr uint32_t TEST_COLOR_YELLOW = 0xffffff00; -static constexpr uint32_t TEST_COLOR_RED = 0xffff0000; -static constexpr uint32_t TEST_COLOR_BLUE = 0xff0000ff; - -void LocationButtonSampleBuild::BuildLocationComponentInfo(nlohmann::json& jsonComponent) -{ - jsonComponent[JsonTagConstants::JSON_SC_TYPE] = LOCATION_COMPONENT; - jsonComponent[JsonTagConstants::JSON_RECT] = nlohmann::json { - {JsonTagConstants::JSON_RECT_X, TEST_COORDINATE }, - {JsonTagConstants::JSON_RECT_Y, TEST_COORDINATE }, - {JsonTagConstants::JSON_RECT_WIDTH, TEST_COORDINATE }, - {JsonTagConstants::JSON_RECT_HEIGHT, TEST_COORDINATE } - }; - jsonComponent[JsonTagConstants::JSON_NODE_ID] = 0; - jsonComponent[JsonTagConstants::JSON_WINDOW_RECT] = nlohmann::json { - {JsonTagConstants::JSON_RECT_X, TEST_COORDINATE }, - {JsonTagConstants::JSON_RECT_Y, TEST_COORDINATE }, - {JsonTagConstants::JSON_RECT_WIDTH, TEST_COORDINATE }, - {JsonTagConstants::JSON_RECT_HEIGHT, TEST_COORDINATE } - }; - nlohmann::json jsonPadding = nlohmann::json { - { JsonTagConstants::JSON_PADDING_TOP_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_RIGHT_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_LEFT_TAG, TEST_DIMENSION }, - }; - - jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, - }; - - jsonComponent[JsonTagConstants::JSON_COLORS_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_COLOR_TAG, TEST_COLOR_RED }, - { JsonTagConstants::JSON_ICON_COLOR_TAG, TEST_COLOR_BLUE }, - { JsonTagConstants::JSON_BG_COLOR_TAG, TEST_COLOR_YELLOW } - }; - - jsonComponent[JsonTagConstants::JSON_BORDER_TAG] = nlohmann::json { - { JsonTagConstants::JSON_BORDER_WIDTH_TAG, TEST_SIZE }, - }; - jsonComponent[JsonTagConstants::JSON_PARENT_TAG] = nlohmann::json { - { JsonTagConstants::JSON_PARENT_EFFECT_TAG, false }, - }; - jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_TEXT_TAG, LocationDesc::SELECT_LOCATION }, - { JsonTagConstants::JSON_ICON_TAG, LocationIcon::LINE_ICON }, - { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, - }; -} -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS diff --git a/interfaces/inner_api/security_component/test/unittest/src/location_button_sample_build.h b/interfaces/inner_api/security_component/test/unittest/src/location_button_sample_build.h deleted file mode 100644 index 9bde892..0000000 --- a/interfaces/inner_api/security_component/test/unittest/src/location_button_sample_build.h +++ /dev/null @@ -1,31 +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. - */ - -#ifndef LOCATION_BUTTON_SAMPLE_BUILD_H -#define LOCATION_BUTTON_SAMPLE_BUILD_H -#include "location_button.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { - -class LocationButtonSampleBuild { -public: - static void BuildLocationComponentInfo(nlohmann::json& jsonComponent); -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // LOCATION_BUTTON_SAMPLE_BUILD_H diff --git a/interfaces/inner_api/security_component/test/unittest/src/location_button_test.cpp b/interfaces/inner_api/security_component/test/unittest/src/location_button_test.cpp deleted file mode 100644 index ef7503a..0000000 --- a/interfaces/inner_api/security_component/test/unittest/src/location_button_test.cpp +++ /dev/null @@ -1,607 +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 "location_button_test.h" -#include -#include "sec_comp_log.h" -#include "sec_comp_err.h" - -using namespace testing::ext; -using namespace OHOS; -using namespace OHOS::Security::SecurityComponent; - -namespace { -static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { - LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "LocationButtonTest"}; - -static const std::string WRONG_TYPE = "wrongType"; -static constexpr float TEST_SIZE = 100.0; -static constexpr double TEST_COORDINATE = 100.0; -static constexpr double TEST_DIMENSION = 100.0; -static constexpr uint32_t TEST_COLOR_YELLOW = 0x7ffff00; -static constexpr uint32_t TEST_COLOR_RED = 0xff0000; -static constexpr uint32_t TEST_COLOR_BLUE = 0x0000ff; -static constexpr uint32_t TEST_DIFF_COLOR = 0; - -static void BuildLocationComponentInfo(nlohmann::json& jsonComponent) -{ - jsonComponent[JsonTagConstants::JSON_SC_TYPE] = LOCATION_COMPONENT; - jsonComponent[JsonTagConstants::JSON_RECT] = nlohmann::json { - {JsonTagConstants::JSON_RECT_X, TEST_COORDINATE }, - {JsonTagConstants::JSON_RECT_Y, TEST_COORDINATE }, - {JsonTagConstants::JSON_RECT_WIDTH, TEST_COORDINATE }, - {JsonTagConstants::JSON_RECT_HEIGHT, TEST_COORDINATE } - }; - jsonComponent[JsonTagConstants::JSON_NODE_ID] = 0; - jsonComponent[JsonTagConstants::JSON_WINDOW_RECT] = nlohmann::json { - {JsonTagConstants::JSON_RECT_X, TEST_COORDINATE }, - {JsonTagConstants::JSON_RECT_Y, TEST_COORDINATE }, - {JsonTagConstants::JSON_RECT_WIDTH, TEST_COORDINATE }, - {JsonTagConstants::JSON_RECT_HEIGHT, TEST_COORDINATE } - }; - nlohmann::json jsonPadding = nlohmann::json { - { JsonTagConstants::JSON_PADDING_TOP_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_RIGHT_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_LEFT_TAG, TEST_DIMENSION }, - }; - - jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, - }; - - jsonComponent[JsonTagConstants::JSON_COLORS_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_COLOR_TAG, TEST_COLOR_RED }, - { JsonTagConstants::JSON_ICON_COLOR_TAG, TEST_COLOR_BLUE }, - { JsonTagConstants::JSON_BG_COLOR_TAG, TEST_COLOR_YELLOW } - }; - - jsonComponent[JsonTagConstants::JSON_BORDER_TAG] = nlohmann::json { - { JsonTagConstants::JSON_BORDER_WIDTH_TAG, TEST_SIZE }, - }; - jsonComponent[JsonTagConstants::JSON_PARENT_TAG] = nlohmann::json { - { JsonTagConstants::JSON_PARENT_EFFECT_TAG, false }, - }; - jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_TEXT_TAG, LocationDesc::SELECT_LOCATION }, - { JsonTagConstants::JSON_ICON_TAG, LocationIcon::LINE_ICON }, - { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, - }; -} -} - -void LocationButtonTest::SetUpTestCase() -{} - -void LocationButtonTest::TearDownTestCase() -{} - -void LocationButtonTest::SetUp() -{ - SC_LOG_INFO(LABEL, "setup"); -} - -void LocationButtonTest::TearDown() -{} - -/** - * @tc.name: FromJson001 - * @tc.desc: Test LocationButton from json success - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(LocationButtonTest, FromJson001, TestSize.Level1) -{ - nlohmann::json jsonComponent; - BuildLocationComponentInfo(jsonComponent); - LocationButton comp; - ASSERT_TRUE(comp.FromJson(jsonComponent)); -} - -/** - * @tc.name: FromJson002 - * @tc.desc: Test empty LocationButton from json - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(LocationButtonTest, FromJson002, TestSize.Level1) -{ - nlohmann::json jsonComponent; - LocationButton comp; - ASSERT_FALSE(comp.FromJson(jsonComponent)); -} - -/** - * @tc.name: FromJson003 - * @tc.desc: Test location button from wrong type json - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(LocationButtonTest, FromJson003, TestSize.Level1) -{ - nlohmann::json jsonComponent; - BuildLocationComponentInfo(jsonComponent); - LocationButton comp; - ASSERT_TRUE(comp.FromJson(jsonComponent)); - - jsonComponent[JsonTagConstants::JSON_SC_TYPE] = WRONG_TYPE; - ASSERT_FALSE(comp.FromJson(jsonComponent)); - - jsonComponent[JsonTagConstants::JSON_SC_TYPE] = 0; - ASSERT_FALSE(comp.FromJson(jsonComponent)); -} - -/** - * @tc.name: FromJson004 - * @tc.desc: Test location button from wrong rect json - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(LocationButtonTest, FromJson004, TestSize.Level1) -{ - nlohmann::json jsonComponent; - LocationButton comp; - jsonComponent[JsonTagConstants::JSON_SC_TYPE] = LOCATION_COMPONENT; - nlohmann::json wrongJson = nlohmann::json::parse("{", nullptr, false); - jsonComponent[JsonTagConstants::JSON_RECT] = wrongJson; - ASSERT_FALSE(comp.FromJson(jsonComponent)); - - BuildLocationComponentInfo(jsonComponent); - ASSERT_TRUE(comp.FromJson(jsonComponent)); - - jsonComponent[JsonTagConstants::JSON_RECT] = nlohmann::json { - {JsonTagConstants::JSON_RECT_X, WRONG_TYPE}, - {JsonTagConstants::JSON_RECT_Y, TEST_COORDINATE}, - {JsonTagConstants::JSON_RECT_WIDTH, TEST_COORDINATE}, - {JsonTagConstants::JSON_RECT_HEIGHT, TEST_COORDINATE} - }; - ASSERT_FALSE(comp.FromJson(jsonComponent)); - - jsonComponent[JsonTagConstants::JSON_RECT] = nlohmann::json { - {JsonTagConstants::JSON_RECT_X, TEST_COORDINATE}, - {JsonTagConstants::JSON_RECT_Y, WRONG_TYPE}, - {JsonTagConstants::JSON_RECT_WIDTH, TEST_COORDINATE}, - {JsonTagConstants::JSON_RECT_HEIGHT, TEST_COORDINATE} - }; - ASSERT_FALSE(comp.FromJson(jsonComponent)); - - jsonComponent[JsonTagConstants::JSON_RECT] = nlohmann::json { - {JsonTagConstants::JSON_RECT_X, TEST_COORDINATE}, - {JsonTagConstants::JSON_RECT_Y, TEST_COORDINATE}, - {JsonTagConstants::JSON_RECT_WIDTH, WRONG_TYPE}, - {JsonTagConstants::JSON_RECT_HEIGHT, TEST_COORDINATE} - }; - ASSERT_FALSE(comp.FromJson(jsonComponent)); - - jsonComponent[JsonTagConstants::JSON_RECT] = nlohmann::json { - {JsonTagConstants::JSON_RECT_X, TEST_COORDINATE}, - {JsonTagConstants::JSON_RECT_Y, TEST_COORDINATE}, - {JsonTagConstants::JSON_RECT_WIDTH, TEST_COORDINATE}, - {JsonTagConstants::JSON_RECT_HEIGHT, WRONG_TYPE} - }; - ASSERT_FALSE(comp.FromJson(jsonComponent)); -} - -/** - * @tc.name: FromJson005 - * @tc.desc: Test location button from wrong size json - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(LocationButtonTest, FromJson005, TestSize.Level1) -{ - nlohmann::json jsonComponent; - LocationButton comp; - BuildLocationComponentInfo(jsonComponent); - ASSERT_TRUE(comp.FromJson(jsonComponent)); - - nlohmann::json jsonPadding = nlohmann::json { - { JsonTagConstants::JSON_PADDING_TOP_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_RIGHT_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_LEFT_TAG, TEST_DIMENSION }, - }; - - jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_SIZE_TAG, WRONG_TYPE }, - { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, - }; - ASSERT_FALSE(comp.FromJson(jsonComponent)); - - jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_ICON_SIZE_TAG, WRONG_TYPE }, - { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, - }; - ASSERT_FALSE(comp.FromJson(jsonComponent)); - - jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, WRONG_TYPE }, - { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, - }; - ASSERT_FALSE(comp.FromJson(jsonComponent)); -} - -/** - * @tc.name: FromJson006 - * @tc.desc: Test location button from wrong size json - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(LocationButtonTest, FromJson006, TestSize.Level1) -{ - nlohmann::json jsonComponent; - LocationButton comp; - BuildLocationComponentInfo(jsonComponent); - ASSERT_TRUE(comp.FromJson(jsonComponent)); - - nlohmann::json jsonPadding = nlohmann::json { - { JsonTagConstants::JSON_PADDING_TOP_TAG, WRONG_TYPE }, - { JsonTagConstants::JSON_PADDING_RIGHT_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_LEFT_TAG, TEST_DIMENSION }, - }; - jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, - }; - ASSERT_FALSE(comp.FromJson(jsonComponent)); - - jsonPadding = nlohmann::json { - { JsonTagConstants::JSON_PADDING_TOP_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_RIGHT_TAG, WRONG_TYPE }, - { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_LEFT_TAG, TEST_DIMENSION }, - }; - jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, - }; - ASSERT_FALSE(comp.FromJson(jsonComponent)); -} - -/** - * @tc.name: FromJson007 - * @tc.desc: Test location button from wrong size json - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(LocationButtonTest, FromJson007, TestSize.Level1) -{ - nlohmann::json jsonComponent; - LocationButton comp; - BuildLocationComponentInfo(jsonComponent); - ASSERT_TRUE(comp.FromJson(jsonComponent)); - - nlohmann::json jsonPadding = nlohmann::json { - { JsonTagConstants::JSON_PADDING_TOP_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_RIGHT_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, WRONG_TYPE }, - { JsonTagConstants::JSON_PADDING_LEFT_TAG, TEST_DIMENSION }, - }; - jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, - }; - ASSERT_FALSE(comp.FromJson(jsonComponent)); - - jsonPadding = nlohmann::json { - { JsonTagConstants::JSON_PADDING_TOP_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_RIGHT_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_LEFT_TAG, WRONG_TYPE }, - }; - jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, - }; - ASSERT_FALSE(comp.FromJson(jsonComponent)); -} - -/** - * @tc.name: FromJson008 - * @tc.desc: Test location button from wrong border and parent json - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(LocationButtonTest, FromJson008, TestSize.Level1) -{ - nlohmann::json jsonComponent; - LocationButton comp; - BuildLocationComponentInfo(jsonComponent); - ASSERT_TRUE(comp.FromJson(jsonComponent)); - - jsonComponent[JsonTagConstants::JSON_BORDER_TAG] = nlohmann::json { - { JsonTagConstants::JSON_BORDER_WIDTH_TAG, WRONG_TYPE }, - }; - ASSERT_FALSE(comp.FromJson(jsonComponent)); - - BuildLocationComponentInfo(jsonComponent); - jsonComponent[JsonTagConstants::JSON_PARENT_TAG] = nlohmann::json { - { JsonTagConstants::JSON_PARENT_EFFECT_TAG, WRONG_TYPE }, - }; - ASSERT_FALSE(comp.FromJson(jsonComponent)); -} - -/** - * @tc.name: FromJson009 - * @tc.desc: Test location button from wrong type params json - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(LocationButtonTest, FromJson009, TestSize.Level1) -{ - nlohmann::json jsonComponent; - BuildLocationComponentInfo(jsonComponent); - LocationButton button; - ASSERT_TRUE(button.FromJson(jsonComponent)); - - jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_TEXT_TAG, WRONG_TYPE }, - { JsonTagConstants::JSON_ICON_TAG, LocationIcon::LINE_ICON }, - { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, - }; - ASSERT_FALSE(button.FromJson(jsonComponent)); - - jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_TEXT_TAG, LocationDesc::SELECT_LOCATION }, - { JsonTagConstants::JSON_ICON_TAG, WRONG_TYPE }, - { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, - }; - ASSERT_FALSE(button.FromJson(jsonComponent)); - - jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_TEXT_TAG, LocationDesc::SELECT_LOCATION }, - { JsonTagConstants::JSON_ICON_TAG, LocationIcon::LINE_ICON }, - { JsonTagConstants::JSON_BG_TAG, WRONG_TYPE }, - }; - ASSERT_FALSE(button.FromJson(jsonComponent)); -} - -/** - * @tc.name: FromJson010 - * @tc.desc: Test location button from wrong type params json - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(LocationButtonTest, FromJson010, TestSize.Level1) -{ - nlohmann::json jsonComponent; - BuildLocationComponentInfo(jsonComponent); - LocationButton button; - ASSERT_TRUE(button.FromJson(jsonComponent)); - - jsonComponent[JsonTagConstants::JSON_COLORS_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_COLOR_TAG, WRONG_TYPE }, - { JsonTagConstants::JSON_ICON_COLOR_TAG, TEST_COLOR_BLUE }, - { JsonTagConstants::JSON_BG_COLOR_TAG, TEST_COLOR_YELLOW } - }; - ASSERT_FALSE(button.FromJson(jsonComponent)); - - jsonComponent[JsonTagConstants::JSON_COLORS_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_COLOR_TAG, TEST_COLOR_RED }, - { JsonTagConstants::JSON_ICON_COLOR_TAG, WRONG_TYPE }, - { JsonTagConstants::JSON_BG_COLOR_TAG, TEST_COLOR_YELLOW } - }; - ASSERT_FALSE(button.FromJson(jsonComponent)); - - jsonComponent[JsonTagConstants::JSON_COLORS_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_COLOR_TAG, TEST_COLOR_RED }, - { JsonTagConstants::JSON_ICON_COLOR_TAG, TEST_COLOR_BLUE }, - { JsonTagConstants::JSON_BG_COLOR_TAG, WRONG_TYPE } - }; - ASSERT_FALSE(button.FromJson(jsonComponent)); -} - -/** - * @tc.name: FromJson011 - * @tc.desc: Test location button from wrong value params json - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(LocationButtonTest, FromJson011, TestSize.Level1) -{ -nlohmann::json jsonComponent; - BuildLocationComponentInfo(jsonComponent); - LocationButton button; - - ASSERT_TRUE(button.FromJson(jsonComponent)); - - jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_TEXT_TAG, UNKNOWN_TEXT }, - { JsonTagConstants::JSON_ICON_TAG, LocationIcon::LINE_ICON }, - { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, - }; - ASSERT_FALSE(button.FromJson(jsonComponent)); - - jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_TEXT_TAG, LocationDesc::SELECT_LOCATION }, - { JsonTagConstants::JSON_ICON_TAG, UNKNOWN_ICON }, - { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, - }; - ASSERT_FALSE(button.FromJson(jsonComponent)); - - jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_TEXT_TAG, LocationDesc::SELECT_LOCATION }, - { JsonTagConstants::JSON_ICON_TAG, LocationIcon::LINE_ICON }, - { JsonTagConstants::JSON_BG_TAG, SecCompBackground::UNKNOWN_BG }, - }; - ASSERT_FALSE(button.FromJson(jsonComponent)); - - jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_TEXT_TAG, LocationDesc::MAX_LABEL_TYPE }, - { JsonTagConstants::JSON_ICON_TAG, LocationIcon::LINE_ICON }, - { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, - }; - ASSERT_FALSE(button.FromJson(jsonComponent)); - - jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_TEXT_TAG, LocationDesc::SELECT_LOCATION }, - { JsonTagConstants::JSON_ICON_TAG, LocationIcon::MAX_ICON_TYPE }, - { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, - }; - ASSERT_FALSE(button.FromJson(jsonComponent)); - - jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_TEXT_TAG, LocationDesc::SELECT_LOCATION }, - { JsonTagConstants::JSON_ICON_TAG, LocationIcon::LINE_ICON }, - { JsonTagConstants::JSON_BG_TAG, SecCompBackground::MAX_BG_TYPE }, - }; - ASSERT_FALSE(button.FromJson(jsonComponent)); -} - -/** - * @tc.name: ToJsonStr001 - * @tc.desc: Test ToJsonStr normal branch - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(LocationButtonTest, ToJsonStr001, TestSize.Level1) -{ - nlohmann::json jsonComponent; - BuildLocationComponentInfo(jsonComponent); - LocationButton button; - - ASSERT_TRUE(button.FromJson(jsonComponent)); - ASSERT_EQ(jsonComponent.dump(), button.ToJsonStr()); -} - -/** - * @tc.name: CompareComponentBasicInfo001 - * @tc.desc: Test CompareComponentBasicInfo other is null - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(LocationButtonTest, CompareComponentBasicInfo001, TestSize.Level1) -{ - nlohmann::json jsonComponent; - BuildLocationComponentInfo(jsonComponent); - LocationButton button; - - ASSERT_FALSE(button.CompareComponentBasicInfo(nullptr, true)); -} - -/** - * @tc.name: CompareLocationButton001 - * @tc.desc: Test compare location button - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(LocationButtonTest, CompareLocationButton001, TestSize.Level1) -{ - LocationButton button1; - LocationButton button2; - - nlohmann::json jsonComponent; - BuildLocationComponentInfo(jsonComponent); - - ASSERT_TRUE(button1.FromJson(jsonComponent)); - ASSERT_TRUE(button2.FromJson(jsonComponent)); - ASSERT_TRUE(button1.CompareComponentBasicInfo(&button2, true)); - - button1.text_ = UNKNOWN_TEXT; - ASSERT_FALSE(button1.CompareComponentBasicInfo(&button2, true)); - button1.text_ = static_cast(LocationDesc::SELECT_LOCATION); - - button1.icon_ = UNKNOWN_ICON; - ASSERT_FALSE(button1.CompareComponentBasicInfo(&button2, true)); - button1.icon_ = static_cast(LocationIcon::LINE_ICON); - - button1.bg_ = SecCompBackground::UNKNOWN_BG; - ASSERT_FALSE(button1.CompareComponentBasicInfo(&button2, true)); - button1.bg_ = SecCompBackground::CIRCLE; - - ASSERT_TRUE(button1.CompareComponentBasicInfo(&button2, true)); -} - -/** - * @tc.name: CompareLocationButton002 - * @tc.desc: Test LocationButton compare - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(LocationButtonTest, CompareLocationButton002, TestSize.Level1) -{ - nlohmann::json jsonComponent; - LocationButton comp1; - BuildLocationComponentInfo(jsonComponent); - ASSERT_TRUE(comp1.FromJson(jsonComponent)); - LocationButton comp2 = comp1; - - comp1.type_ = SAVE_COMPONENT; - ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); - comp1.type_ = LOCATION_COMPONENT; - - comp1.fontSize_ = DEFAULT_DIMENSION; - ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); - comp1.fontSize_ = TEST_SIZE; - - comp1.iconSize_ = DEFAULT_DIMENSION; - ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); - comp1.iconSize_ = TEST_SIZE; - - comp1.padding_.top = DEFAULT_DIMENSION; - ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); - comp1.padding_.top = TEST_DIMENSION; - - comp1.padding_.right = DEFAULT_DIMENSION; - ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); - comp1.padding_.right = TEST_DIMENSION; - - comp1.padding_.bottom = DEFAULT_DIMENSION; - ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); - comp1.padding_.bottom = TEST_DIMENSION; - - comp1.padding_.left = DEFAULT_DIMENSION; - ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); - comp1.padding_.left = TEST_DIMENSION; - - comp1.textIconSpace_ = DEFAULT_DIMENSION; - ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); - comp1.textIconSpace_ = TEST_SIZE; - - comp1.borderWidth_ = DEFAULT_DIMENSION; - ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); - comp1.borderWidth_ = TEST_SIZE; - - comp1.fontColor_.value = TEST_DIFF_COLOR; - ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); - comp1.fontColor_.value = TEST_COLOR_RED; - - comp1.bgColor_.value = TEST_DIFF_COLOR; - ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); - comp1.bgColor_.value = TEST_COLOR_YELLOW; - - comp1.iconColor_.value = TEST_DIFF_COLOR; - ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); - comp1.iconColor_.value = TEST_COLOR_BLUE; - - ASSERT_TRUE(comp1.CompareComponentBasicInfo(&comp2, true)); -} diff --git a/interfaces/inner_api/security_component/test/unittest/src/location_button_test.h b/interfaces/inner_api/security_component/test/unittest/src/location_button_test.h deleted file mode 100644 index 7324bd7..0000000 --- a/interfaces/inner_api/security_component/test/unittest/src/location_button_test.h +++ /dev/null @@ -1,38 +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. - */ - -#ifndef SEC_COMP_LOCATION_BUTTON_TEST_H -#define SEC_COMP_LOCATION_BUTTON_TEST_H - -#include -#include "location_button.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -class LocationButtonTest : public testing::Test { -public: - static void SetUpTestCase(); - - static void TearDownTestCase(); - - void SetUp(); - - void TearDown(); -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // SEC_COMP_LOCATION_BUTTON_TEST_H diff --git a/interfaces/inner_api/security_component/test/unittest/src/paste_button_test.cpp b/interfaces/inner_api/security_component/test/unittest/src/paste_button_test.cpp deleted file mode 100644 index 625c4ac..0000000 --- a/interfaces/inner_api/security_component/test/unittest/src/paste_button_test.cpp +++ /dev/null @@ -1,254 +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 "paste_button_test.h" -#include -#include "sec_comp_err.h" -#include "sec_comp_log.h" - -using namespace testing::ext; -using namespace OHOS; -using namespace OHOS::Security::SecurityComponent; - -namespace { -static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { - LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "PasteButtonTest"}; - -static const std::string WRONG_TYPE = "wrongType"; -static constexpr float TEST_SIZE = 100.0; -static constexpr double TEST_COORDINATE = 100.0; -static constexpr double TEST_DIMENSION = 100.0; -static constexpr uint32_t TEST_COLOR_YELLOW = 0x7ffff00; -static constexpr uint32_t TEST_COLOR_RED = 0xff0000; -static constexpr uint32_t TEST_COLOR_BLUE = 0x0000ff; -static constexpr uint32_t TEST_DIFF_COLOR = 0; - -static void BuildPasteComponentInfo(nlohmann::json& jsonComponent) -{ - jsonComponent[JsonTagConstants::JSON_SC_TYPE] = PASTE_COMPONENT; - jsonComponent[JsonTagConstants::JSON_NODE_ID] = 0; - jsonComponent[JsonTagConstants::JSON_RECT] = nlohmann::json { - {JsonTagConstants::JSON_RECT_X, TEST_COORDINATE }, - {JsonTagConstants::JSON_RECT_Y, TEST_COORDINATE }, - {JsonTagConstants::JSON_RECT_WIDTH, TEST_COORDINATE }, - {JsonTagConstants::JSON_RECT_HEIGHT, TEST_COORDINATE } - }; - jsonComponent[JsonTagConstants::JSON_WINDOW_RECT] = nlohmann::json { - {JsonTagConstants::JSON_RECT_X, TEST_COORDINATE }, - {JsonTagConstants::JSON_RECT_Y, TEST_COORDINATE }, - {JsonTagConstants::JSON_RECT_WIDTH, TEST_COORDINATE }, - {JsonTagConstants::JSON_RECT_HEIGHT, TEST_COORDINATE } - }; - nlohmann::json jsonPadding = nlohmann::json { - { JsonTagConstants::JSON_PADDING_TOP_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_RIGHT_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_LEFT_TAG, TEST_DIMENSION }, - }; - - jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, - }; - - jsonComponent[JsonTagConstants::JSON_COLORS_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_COLOR_TAG, TEST_COLOR_RED }, - { JsonTagConstants::JSON_ICON_COLOR_TAG, TEST_COLOR_BLUE }, - { JsonTagConstants::JSON_BG_COLOR_TAG, TEST_COLOR_YELLOW } - }; - - jsonComponent[JsonTagConstants::JSON_BORDER_TAG] = nlohmann::json { - { JsonTagConstants::JSON_BORDER_WIDTH_TAG, TEST_SIZE }, - }; - jsonComponent[JsonTagConstants::JSON_PARENT_TAG] = nlohmann::json { - { JsonTagConstants::JSON_PARENT_EFFECT_TAG, false }, - }; - jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_TEXT_TAG, PasteDesc::PASTE }, - { JsonTagConstants::JSON_ICON_TAG, PasteIcon::LINE_ICON }, - { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, - }; -} -} - -void PasteButtonTest::SetUpTestCase() -{} - -void PasteButtonTest::TearDownTestCase() -{} - -void PasteButtonTest::SetUp() -{ - SC_LOG_INFO(LABEL, "setup"); -} - -void PasteButtonTest::TearDown() -{} - -/** - * @tc.name: IsParamValid001 - * @tc.desc: Test paste button from wrong value params json - * @tc.type: FUNC - * @tc.require: AR000HO9JB - */ -HWTEST_F(PasteButtonTest, FromJson010, TestSize.Level1) -{ -nlohmann::json jsonComponent; - BuildPasteComponentInfo(jsonComponent); - PasteButton button; - - ASSERT_TRUE(button.FromJson(jsonComponent)); - - jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_TEXT_TAG, UNKNOWN_TEXT }, - { JsonTagConstants::JSON_ICON_TAG, PasteIcon::LINE_ICON }, - { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, - }; - ASSERT_FALSE(button.FromJson(jsonComponent)); - - jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_TEXT_TAG, PasteDesc::PASTE}, - { JsonTagConstants::JSON_ICON_TAG, UNKNOWN_ICON }, - { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, - }; - ASSERT_FALSE(button.FromJson(jsonComponent)); - - jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_TEXT_TAG, PasteDesc::PASTE }, - { JsonTagConstants::JSON_ICON_TAG, PasteIcon::LINE_ICON }, - { JsonTagConstants::JSON_BG_TAG, SecCompBackground::UNKNOWN_BG }, - }; - ASSERT_FALSE(button.FromJson(jsonComponent)); - - jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_TEXT_TAG, PasteDesc::MAX_LABEL_TYPE }, - { JsonTagConstants::JSON_ICON_TAG, PasteIcon::LINE_ICON }, - { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, - }; - ASSERT_FALSE(button.FromJson(jsonComponent)); - - jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_TEXT_TAG, PasteDesc::PASTE }, - { JsonTagConstants::JSON_ICON_TAG, PasteIcon::MAX_ICON_TYPE }, - { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, - }; - ASSERT_FALSE(button.FromJson(jsonComponent)); - - jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_TEXT_TAG, PasteDesc::PASTE }, - { JsonTagConstants::JSON_ICON_TAG, PasteIcon::LINE_ICON }, - { JsonTagConstants::JSON_BG_TAG, SecCompBackground::MAX_BG_TYPE }, - }; - ASSERT_FALSE(button.FromJson(jsonComponent)); -} - -/** - * @tc.name: ComparePasteButton001 - * @tc.desc: Test compare paste button - * @tc.type: FUNC - * @tc.require: AR000HO9JB - */ -HWTEST_F(PasteButtonTest, ComparePasteButton001, TestSize.Level1) -{ - PasteButton button1; - PasteButton button2; - - nlohmann::json jsonComponent; - BuildPasteComponentInfo(jsonComponent); - - ASSERT_TRUE(button1.FromJson(jsonComponent)); - ASSERT_TRUE(button2.FromJson(jsonComponent)); - ASSERT_TRUE(button1.CompareComponentBasicInfo(&button2, true)); - - button1.text_ = UNKNOWN_TEXT; - ASSERT_FALSE(button1.CompareComponentBasicInfo(&button2, true)); - button1.text_ = static_cast(PasteDesc::PASTE); - - button1.icon_ = UNKNOWN_ICON; - ASSERT_FALSE(button1.CompareComponentBasicInfo(&button2, true)); - button1.icon_ = static_cast(PasteIcon::LINE_ICON); - - button1.bg_ = SecCompBackground::UNKNOWN_BG; - ASSERT_FALSE(button1.CompareComponentBasicInfo(&button2, true)); - button1.bg_ = SecCompBackground::CIRCLE; - - ASSERT_TRUE(button1.CompareComponentBasicInfo(&button2, true)); -} - -/** - * @tc.name: ComparePasteButton002 - * @tc.desc: Test PasteButton compare - * @tc.type: FUNC - * @tc.require: AR000HO9JB - */ -HWTEST_F(PasteButtonTest, ComparePasteButton002, TestSize.Level1) -{ - nlohmann::json jsonComponent; - PasteButton comp1; - BuildPasteComponentInfo(jsonComponent); - ASSERT_TRUE(comp1.FromJson(jsonComponent)); - PasteButton comp2 = comp1; - - comp1.type_ = LOCATION_COMPONENT; - ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); - comp1.type_ = PASTE_COMPONENT; - - comp1.fontSize_ = DEFAULT_DIMENSION; - ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); - comp1.fontSize_ = TEST_SIZE; - - comp1.iconSize_ = DEFAULT_DIMENSION; - ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); - comp1.iconSize_ = TEST_SIZE; - - comp1.padding_.top = DEFAULT_DIMENSION; - ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); - comp1.padding_.top = TEST_DIMENSION; - - comp1.padding_.right = DEFAULT_DIMENSION; - ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); - comp1.padding_.right = TEST_DIMENSION; - - comp1.padding_.bottom = DEFAULT_DIMENSION; - ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); - comp1.padding_.bottom = TEST_DIMENSION; - - comp1.padding_.left = DEFAULT_DIMENSION; - ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); - comp1.padding_.left = TEST_DIMENSION; - - comp1.textIconSpace_ = DEFAULT_DIMENSION; - ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); - comp1.textIconSpace_ = TEST_SIZE; - - comp1.borderWidth_ = DEFAULT_DIMENSION; - ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); - comp1.borderWidth_ = TEST_SIZE; - - comp1.fontColor_.value = TEST_DIFF_COLOR; - ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); - comp1.fontColor_.value = TEST_COLOR_RED; - - comp1.bgColor_.value = TEST_DIFF_COLOR; - ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); - comp1.bgColor_.value = TEST_COLOR_YELLOW; - - comp1.iconColor_.value = TEST_DIFF_COLOR; - ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); - comp1.iconColor_.value = TEST_COLOR_BLUE; - - ASSERT_TRUE(comp1.CompareComponentBasicInfo(&comp2, true)); -} \ No newline at end of file diff --git a/interfaces/inner_api/security_component/test/unittest/src/paste_button_test.h b/interfaces/inner_api/security_component/test/unittest/src/paste_button_test.h deleted file mode 100644 index 6e73d91..0000000 --- a/interfaces/inner_api/security_component/test/unittest/src/paste_button_test.h +++ /dev/null @@ -1,38 +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. - */ - -#ifndef SEC_COMP_PASTE_BUTTON_TEST_H -#define SEC_COMP_PASTE_BUTTON_TEST_H - -#include -#include "paste_button.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -class PasteButtonTest : public testing::Test { -public: - static void SetUpTestCase(); - - static void TearDownTestCase(); - - void SetUp(); - - void TearDown(); -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // SEC_COMP_PASTE_BUTTON_TEST_H diff --git a/interfaces/inner_api/security_component/test/unittest/src/save_button_test.cpp b/interfaces/inner_api/security_component/test/unittest/src/save_button_test.cpp deleted file mode 100644 index 8771c78..0000000 --- a/interfaces/inner_api/security_component/test/unittest/src/save_button_test.cpp +++ /dev/null @@ -1,253 +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 "save_button_test.h" -#include -#include "sec_comp_log.h" -#include "sec_comp_err.h" - -using namespace testing::ext; -using namespace OHOS; -using namespace OHOS::Security::SecurityComponent; - -namespace { -static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { - LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SaveButtonTest"}; - -static constexpr float TEST_SIZE = 100.0; -static constexpr double TEST_COORDINATE = 100.0; -static constexpr double TEST_DIMENSION = 100.0; -static constexpr uint32_t TEST_COLOR_YELLOW = 0x7ffff00; -static constexpr uint32_t TEST_COLOR_RED = 0xff0000; -static constexpr uint32_t TEST_COLOR_BLUE = 0x0000ff; -static constexpr uint32_t TEST_DIFF_COLOR = 0; - -static void BuildSaveComponentInfo(nlohmann::json& jsonComponent) -{ - jsonComponent[JsonTagConstants::JSON_SC_TYPE] = SAVE_COMPONENT; - jsonComponent[JsonTagConstants::JSON_NODE_ID] = 0; - jsonComponent[JsonTagConstants::JSON_RECT] = nlohmann::json { - {JsonTagConstants::JSON_RECT_X, TEST_COORDINATE }, - {JsonTagConstants::JSON_RECT_Y, TEST_COORDINATE }, - {JsonTagConstants::JSON_RECT_WIDTH, TEST_COORDINATE }, - {JsonTagConstants::JSON_RECT_HEIGHT, TEST_COORDINATE } - }; - jsonComponent[JsonTagConstants::JSON_WINDOW_RECT] = nlohmann::json { - {JsonTagConstants::JSON_RECT_X, TEST_COORDINATE }, - {JsonTagConstants::JSON_RECT_Y, TEST_COORDINATE }, - {JsonTagConstants::JSON_RECT_WIDTH, TEST_COORDINATE }, - {JsonTagConstants::JSON_RECT_HEIGHT, TEST_COORDINATE } - }; - nlohmann::json jsonPadding = nlohmann::json { - { JsonTagConstants::JSON_PADDING_TOP_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_RIGHT_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_LEFT_TAG, TEST_DIMENSION }, - }; - - jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, - }; - - jsonComponent[JsonTagConstants::JSON_COLORS_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_COLOR_TAG, TEST_COLOR_RED }, - { JsonTagConstants::JSON_ICON_COLOR_TAG, TEST_COLOR_BLUE }, - { JsonTagConstants::JSON_BG_COLOR_TAG, TEST_COLOR_YELLOW } - }; - - jsonComponent[JsonTagConstants::JSON_BORDER_TAG] = nlohmann::json { - { JsonTagConstants::JSON_BORDER_WIDTH_TAG, TEST_SIZE }, - }; - jsonComponent[JsonTagConstants::JSON_PARENT_TAG] = nlohmann::json { - { JsonTagConstants::JSON_PARENT_EFFECT_TAG, false }, - }; - jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_TEXT_TAG, SaveDesc::DOWNLOAD }, - { JsonTagConstants::JSON_ICON_TAG, SaveIcon::LINE_ICON }, - { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, - }; -} -} - -void SaveButtonTest::SetUpTestCase() -{} - -void SaveButtonTest::TearDownTestCase() -{} - -void SaveButtonTest::SetUp() -{ - SC_LOG_INFO(LABEL, "setup"); -} - -void SaveButtonTest::TearDown() -{} - -/** - * @tc.name: IsParamValid001 - * @tc.desc: Test save button from wrong value params json - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SaveButtonTest, FromJson010, TestSize.Level1) -{ -nlohmann::json jsonComponent; - BuildSaveComponentInfo(jsonComponent); - SaveButton button; - - ASSERT_TRUE(button.FromJson(jsonComponent)); - - jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_TEXT_TAG, UNKNOWN_TEXT }, - { JsonTagConstants::JSON_ICON_TAG, SaveIcon::LINE_ICON }, - { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, - }; - ASSERT_FALSE(button.FromJson(jsonComponent)); - - jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_TEXT_TAG, SaveDesc::DOWNLOAD}, - { JsonTagConstants::JSON_ICON_TAG, UNKNOWN_ICON }, - { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, - }; - ASSERT_FALSE(button.FromJson(jsonComponent)); - - jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_TEXT_TAG, SaveDesc::DOWNLOAD }, - { JsonTagConstants::JSON_ICON_TAG, SaveIcon::LINE_ICON }, - { JsonTagConstants::JSON_BG_TAG, SecCompBackground::UNKNOWN_BG }, - }; - ASSERT_FALSE(button.FromJson(jsonComponent)); - - jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_TEXT_TAG, SaveDesc::MAX_LABEL_TYPE }, - { JsonTagConstants::JSON_ICON_TAG, SaveIcon::LINE_ICON }, - { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, - }; - ASSERT_FALSE(button.FromJson(jsonComponent)); - - jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_TEXT_TAG, SaveDesc::DOWNLOAD }, - { JsonTagConstants::JSON_ICON_TAG, SaveIcon::MAX_ICON_TYPE }, - { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, - }; - ASSERT_FALSE(button.FromJson(jsonComponent)); - - jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_TEXT_TAG, SaveDesc::DOWNLOAD }, - { JsonTagConstants::JSON_ICON_TAG, SaveIcon::LINE_ICON }, - { JsonTagConstants::JSON_BG_TAG, SecCompBackground::MAX_BG_TYPE }, - }; - ASSERT_FALSE(button.FromJson(jsonComponent)); -} - -/** - * @tc.name: CompareSaveButton001 - * @tc.desc: Test compare save button - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SaveButtonTest, CompareSaveButton001, TestSize.Level1) -{ - SaveButton button1; - SaveButton button2; - - nlohmann::json jsonComponent; - BuildSaveComponentInfo(jsonComponent); - - ASSERT_TRUE(button1.FromJson(jsonComponent)); - ASSERT_TRUE(button2.FromJson(jsonComponent)); - ASSERT_TRUE(button1.CompareComponentBasicInfo(&button2, true)); - - button1.text_ = UNKNOWN_TEXT; - ASSERT_FALSE(button1.CompareComponentBasicInfo(&button2, true)); - button1.text_ = static_cast(SaveDesc::DOWNLOAD); - - button1.icon_ = UNKNOWN_ICON; - ASSERT_FALSE(button1.CompareComponentBasicInfo(&button2, true)); - button1.icon_ = static_cast(SaveIcon::LINE_ICON); - - button1.bg_ = SecCompBackground::UNKNOWN_BG; - ASSERT_FALSE(button1.CompareComponentBasicInfo(&button2, true)); - button1.bg_ = SecCompBackground::CIRCLE; - - ASSERT_TRUE(button1.CompareComponentBasicInfo(&button2, true)); -} - -/** - * @tc.name: CompareSaveButton002 - * @tc.desc: Test SaveButton compare - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SaveButtonTest, CompareSaveButton002, TestSize.Level1) -{ - nlohmann::json jsonComponent; - SaveButton comp1; - BuildSaveComponentInfo(jsonComponent); - ASSERT_TRUE(comp1.FromJson(jsonComponent)); - SaveButton comp2 = comp1; - - comp1.type_ = PASTE_COMPONENT; - ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); - comp1.type_ = SAVE_COMPONENT; - - comp1.fontSize_ = DEFAULT_DIMENSION; - ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); - comp1.fontSize_ = TEST_SIZE; - - comp1.iconSize_ = DEFAULT_DIMENSION; - ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); - comp1.iconSize_ = TEST_SIZE; - - comp1.padding_.top = DEFAULT_DIMENSION; - ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); - comp1.padding_.top = TEST_DIMENSION; - - comp1.padding_.right = DEFAULT_DIMENSION; - ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); - comp1.padding_.right = TEST_DIMENSION; - - comp1.padding_.bottom = DEFAULT_DIMENSION; - ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); - comp1.padding_.bottom = TEST_DIMENSION; - - comp1.padding_.left = DEFAULT_DIMENSION; - ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); - comp1.padding_.left = TEST_DIMENSION; - - comp1.textIconSpace_ = DEFAULT_DIMENSION; - ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); - comp1.textIconSpace_ = TEST_SIZE; - - comp1.borderWidth_ = DEFAULT_DIMENSION; - ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); - comp1.borderWidth_ = TEST_SIZE; - - comp1.fontColor_.value = TEST_DIFF_COLOR; - ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); - comp1.fontColor_.value = TEST_COLOR_RED; - - comp1.bgColor_.value = TEST_DIFF_COLOR; - ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); - comp1.bgColor_.value = TEST_COLOR_YELLOW; - - comp1.iconColor_.value = TEST_DIFF_COLOR; - ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); - comp1.iconColor_.value = TEST_COLOR_BLUE; - - ASSERT_TRUE(comp1.CompareComponentBasicInfo(&comp2, true)); -} \ No newline at end of file diff --git a/interfaces/inner_api/security_component/test/unittest/src/save_button_test.h b/interfaces/inner_api/security_component/test/unittest/src/save_button_test.h deleted file mode 100644 index 34c9f6a..0000000 --- a/interfaces/inner_api/security_component/test/unittest/src/save_button_test.h +++ /dev/null @@ -1,38 +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. - */ - -#ifndef SEC_COMP_SAVE_BUTTON_TEST_H -#define SEC_COMP_SAVE_BUTTON_TEST_H - -#include -#include "save_button.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -class SaveButtonTest : public testing::Test { -public: - static void SetUpTestCase(); - - static void TearDownTestCase(); - - void SetUp(); - - void TearDown(); -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // SEC_COMP_SAVE_BUTTON_TEST_H diff --git a/interfaces/inner_api/security_component/test/unittest/src/sec_comp_kit_test.cpp b/interfaces/inner_api/security_component/test/unittest/src/sec_comp_kit_test.cpp deleted file mode 100644 index c43a610..0000000 --- a/interfaces/inner_api/security_component/test/unittest/src/sec_comp_kit_test.cpp +++ /dev/null @@ -1,177 +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 "sec_comp_kit_test.h" -#include "location_button.h" -#define private public -#include "sec_comp_caller_authorization.h" -#undef private -#include "sec_comp_err.h" -#include "sec_comp_info.h" -#include "sec_comp_log.h" -#include "sec_comp_tool.h" - -using namespace testing::ext; -using namespace OHOS::Security::SecurityComponent; - -namespace { -static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { - LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompKitTest"}; -static constexpr float TEST_SIZE = 100.0; -static constexpr double TEST_COORDINATE = 100.0; -static constexpr double TEST_DIMENSION = 100.0; -static constexpr uint32_t TEST_COLOR = 0xffffffff; -static constexpr size_t MAX_CALLER_SIZE = 10; - -static void TestInCallerNotCheckList() -{ - int32_t scId = -1; - struct SecCompClickEvent touch; - std::string emptyStr = ""; - int registerRes = SecCompKit::RegisterSecurityComponent(LOCATION_COMPONENT, emptyStr, scId); - int updateRes = SecCompKit::UpdateSecurityComponent(scId, emptyStr); - int reportRes = SecCompKit::ReportSecurityComponentClickEvent(scId, emptyStr, touch, nullptr); - - EXPECT_EQ(registerRes, SC_SERVICE_ERROR_CALLER_INVALID); - EXPECT_EQ(updateRes, SC_SERVICE_ERROR_CALLER_INVALID); - EXPECT_EQ(reportRes, SC_SERVICE_ERROR_CALLER_INVALID); -} - -static void TestInCallerCheckList() -{ - int32_t scId = -1; - struct SecCompClickEvent touch; - std::string emptyStr = ""; - int registerRes = SecCompKit::RegisterSecurityComponent(LOCATION_COMPONENT, emptyStr, scId); - int updateRes = SecCompKit::UpdateSecurityComponent(scId, emptyStr); - int reportRes = SecCompKit::ReportSecurityComponentClickEvent(scId, emptyStr, touch, nullptr); - - EXPECT_NE(registerRes, SC_SERVICE_ERROR_CALLER_INVALID); - EXPECT_NE(updateRes, SC_SERVICE_ERROR_CALLER_INVALID); - EXPECT_NE(reportRes, SC_SERVICE_ERROR_CALLER_INVALID); -} -} // namespace - -void SecCompKitTest::SetUpTestCase() -{ - SC_LOG_INFO(LABEL, "SetUpTestCase."); -} - -void SecCompKitTest::TearDownTestCase() -{ - SC_LOG_INFO(LABEL, "TearDownTestCase."); -} - -void SecCompKitTest::SetUp() -{ - SC_LOG_INFO(LABEL, "SetUp ok."); -} - -void SecCompKitTest::TearDown() -{ - SC_LOG_INFO(LABEL, "TearDown."); -} - -/** - * @tc.name: ExceptCall001 - * @tc.desc: do kit except call. - * @tc.type: FUNC - * @tc.require: AR000HO9IN - */ -HWTEST_F(SecCompKitTest, ExceptCall001, TestSize.Level1) -{ - LocationButton comp; - comp.fontSize_ = TEST_SIZE; - comp.iconSize_ = TEST_SIZE; - comp.padding_.top = TEST_DIMENSION; - comp.padding_.right = TEST_DIMENSION; - comp.padding_.bottom = TEST_DIMENSION; - comp.padding_.left = TEST_DIMENSION; - comp.textIconSpace_ = TEST_SIZE; - comp.bgColor_.value = TEST_COLOR; - comp.fontColor_.value = TEST_COLOR; - comp.iconColor_.value = TEST_COLOR; - comp.borderWidth_ = TEST_SIZE; - comp.parentEffect_ = true; - comp.type_ = LOCATION_COMPONENT; - comp.rect_.x_ = TEST_COORDINATE; - comp.rect_.y_ = TEST_COORDINATE; - comp.rect_.width_ = TEST_COORDINATE; - comp.rect_.height_ = TEST_COORDINATE; - - nlohmann::json jsonRes; - comp.ToJson(jsonRes); - int32_t scId = -1; - std::string jsonStr = jsonRes.dump(); - ASSERT_NE(SC_OK, SecCompKit::RegisterSecurityComponent(LOCATION_COMPONENT, jsonStr, scId)); - ASSERT_EQ(-1, scId); - ASSERT_NE(SC_OK, SecCompKit::UpdateSecurityComponent(scId, jsonStr)); - - struct SecCompClickEvent touch = { - .touchX = TEST_COORDINATE, - .touchY = TEST_COORDINATE, - .timestamp = static_cast(std::chrono::high_resolution_clock::now().time_since_epoch().count()) - }; - EXPECT_NE(SC_OK, SecCompKit::ReportSecurityComponentClickEvent(scId, jsonStr, touch, nullptr)); - EXPECT_NE(SC_OK, SecCompKit::UnregisterSecurityComponent(scId)); -} - -/** - * @tc.name: ExceptCall001 - * @tc.desc: test caller check. - * @tc.type: FUNC - * @tc.require: AR000HO9JS - */ -HWTEST_F(SecCompKitTest, TestCallerCheck001, TestSize.Level1) -{ - std::vector callerList = { - reinterpret_cast(TestInCallerCheckList), - }; - SecCompUiRegister registerCallback(callerList, nullptr); - TestInCallerCheckList(); - TestInCallerNotCheckList(); - - // prohibit init caller list repeately - std::vector callerList1 = { - reinterpret_cast(TestInCallerNotCheckList), - }; - SecCompUiRegister registerCallback1(callerList1, nullptr); - TestInCallerNotCheckList(); - SecCompCallerAuthorization::GetInstance().kitCallerList_.clear(); - SecCompCallerAuthorization::GetInstance().isInit_ = false; -} - -/** - * @tc.name: ExceptCall002 - * @tc.desc: test invalid caller register. - * @tc.type: FUNC - * @tc.require: AR000HO9JS - */ -HWTEST_F(SecCompKitTest, TestCallerCheck002, TestSize.Level1) -{ - std::vector callerList; - SecCompUiRegister registerCallback(callerList, nullptr); - TestInCallerNotCheckList(); - SecCompCallerAuthorization::GetInstance().kitCallerList_.clear(); - SecCompCallerAuthorization::GetInstance().isInit_ = false; - - for (size_t i = 0; i < MAX_CALLER_SIZE + 1; i++) { - callerList.emplace_back(reinterpret_cast(TestInCallerNotCheckList)); - } - SecCompUiRegister registerCallback2(callerList, nullptr); - TestInCallerNotCheckList(); - SecCompCallerAuthorization::GetInstance().kitCallerList_.clear(); - SecCompCallerAuthorization::GetInstance().isInit_ = false; -} - diff --git a/interfaces/inner_api/security_component/test/unittest/src/sec_comp_kit_test.h b/interfaces/inner_api/security_component/test/unittest/src/sec_comp_kit_test.h deleted file mode 100644 index 3bd1241..0000000 --- a/interfaces/inner_api/security_component/test/unittest/src/sec_comp_kit_test.h +++ /dev/null @@ -1,37 +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. - */ -#ifndef SECURITY_COMPONENT_KIT_TEST -#define SECURITY_COMPONENT_KIT_TEST - -#include -#include "sec_comp_kit.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -class SecCompKitTest : public testing::Test { -public: - static void SetUpTestCase(); - - static void TearDownTestCase(); - - void SetUp() override; - - void TearDown() override; -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // SECURITY_COMPONENT_KIT_TEST \ No newline at end of file diff --git a/interfaces/inner_api/security_component/test/unittest/src/sec_comp_register_callback_test.cpp b/interfaces/inner_api/security_component/test/unittest/src/sec_comp_register_callback_test.cpp deleted file mode 100644 index e907048..0000000 --- a/interfaces/inner_api/security_component/test/unittest/src/sec_comp_register_callback_test.cpp +++ /dev/null @@ -1,153 +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 "i_sec_comp_probe.h" -#include "location_button.h" -#include "location_button_sample_build.h" -#define private public -#include "sec_comp_caller_authorization.h" -#undef private -#include "sec_comp_err.h" -#include "sec_comp_info.h" -#include "sec_comp_kit.h" -#include "sec_comp_log.h" -#include "sec_comp_tool.h" -#include "sec_comp_ui_register.h" - -using namespace testing::ext; -using namespace OHOS::Security::SecurityComponent; - -namespace { -static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { - LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompRegisterCallbackTest"}; - -class MockUiSecCompProbe : public ISecCompProbe { -public: - int32_t GetComponentInfo(int32_t nodeId, std::string& componentInfo) override - { - componentInfo = mockComponentInfo; - return mockRes; - } - std::string mockComponentInfo; - int32_t mockRes; -}; - -static MockUiSecCompProbe g_probe; -static void InitUiRegister() -{ - std::vector callerList; - SecCompUiRegister registerCallback(callerList, &g_probe); - SecCompCallerAuthorization::GetInstance().kitCallerList_.clear(); - SecCompCallerAuthorization::GetInstance().isInit_ = false; -} -} // namespace - -class SecCompRegisterCallbackTest : public testing::Test { -public: - static void SetUpTestCase(); - - static void TearDownTestCase(); - - void SetUp() override; - - void TearDown() override; -}; - -void SecCompRegisterCallbackTest::SetUpTestCase() -{ - InitUiRegister(); - SC_LOG_INFO(LABEL, "SecCompRegisterCallbackTest."); -} - -void SecCompRegisterCallbackTest::TearDownTestCase() -{ - SC_LOG_INFO(LABEL, "SecCompRegisterCallbackTest."); -} - -void SecCompRegisterCallbackTest::SetUp() -{ - SC_LOG_INFO(LABEL, "SetUp ok."); -} - -void SecCompRegisterCallbackTest::TearDown() -{ - SC_LOG_INFO(LABEL, "TearDown."); -} - -/** - * @tc.name: Register001 - * @tc.desc: test register security component success. - * @tc.type: FUNC - * @tc.require: AR000HO9JM - */ -HWTEST_F(SecCompRegisterCallbackTest, Register001, TestSize.Level1) -{ - SC_LOG_INFO(LABEL, "Register001."); - nlohmann::json jsonRes; - LocationButtonSampleBuild::BuildLocationComponentInfo(jsonRes); - std::string locationInfo = jsonRes.dump(); - g_probe.mockComponentInfo = locationInfo; - g_probe.mockRes = 0; - - int32_t scId; - ASSERT_EQ(SC_OK, SecCompKit::RegisterSecurityComponent(LOCATION_COMPONENT, locationInfo, scId)); - ASSERT_NE(-1, scId); - - EXPECT_EQ(SC_OK, SecCompKit::UnregisterSecurityComponent(scId)); -} - -/** - * @tc.name: Register002 - * @tc.desc: test register callback failed. - * @tc.type: FUNC - * @tc.require: AR000HO9JM - */ -HWTEST_F(SecCompRegisterCallbackTest, Register002, TestSize.Level1) -{ - SC_LOG_INFO(LABEL, "Register002."); - - nlohmann::json jsonRes; - LocationButtonSampleBuild::BuildLocationComponentInfo(jsonRes); - std::string locationInfo = jsonRes.dump(); - g_probe.mockComponentInfo = locationInfo; - g_probe.mockRes = -1; - - int32_t scId; - ASSERT_EQ(SC_ENHANCE_ERROR_CALLBACK_OPER_FAIL, - SecCompKit::RegisterSecurityComponent(LOCATION_COMPONENT, locationInfo, scId)); - ASSERT_EQ(-1, scId); -} - -/** - * @tc.name: Register003 - * @tc.desc: test register in MaliciousAppList. - * @tc.type: FUNC - * @tc.require: AR000HO9JM - */ -HWTEST_F(SecCompRegisterCallbackTest, Register003, TestSize.Level1) -{ - SC_LOG_INFO(LABEL, "Register003."); - - nlohmann::json jsonRes; - LocationButtonSampleBuild::BuildLocationComponentInfo(jsonRes); - std::string locationInfo = jsonRes.dump(); - g_probe.mockComponentInfo = locationInfo; - g_probe.mockRes = 0; - - int32_t scId; - ASSERT_EQ(SC_OK, SecCompKit::RegisterSecurityComponent(LOCATION_COMPONENT, locationInfo, scId)); -} - diff --git a/interfaces/inner_api/security_component/test/unittest/src/sec_comp_register_challenge_test.cpp b/interfaces/inner_api/security_component/test/unittest/src/sec_comp_register_challenge_test.cpp deleted file mode 100644 index c7e0273..0000000 --- a/interfaces/inner_api/security_component/test/unittest/src/sec_comp_register_challenge_test.cpp +++ /dev/null @@ -1,111 +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 "i_sec_comp_probe.h" -#include "location_button.h" -#include "location_button_sample_build.h" -#define private public -#include "sec_comp_caller_authorization.h" -#undef private -#include "sec_comp_client.h" -#include "sec_comp_enhance_adapter.h" -#include "sec_comp_err.h" -#include "sec_comp_info.h" -#include "sec_comp_kit.h" -#include "sec_comp_log.h" -#include "sec_comp_tool.h" -#include "sec_comp_ui_register.h" - -using namespace testing::ext; -using namespace OHOS::Security::SecurityComponent; - -namespace { -static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { - LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompRegisterChallengeTest"}; - -class MockUiSecCompProbe : public ISecCompProbe { -public: - int32_t GetComponentInfo(int32_t nodeId, std::string& componentInfo) override - { - componentInfo = mockComponentInfo; - return mockRes; - } - std::string mockComponentInfo; - int32_t mockRes; -}; - -static MockUiSecCompProbe g_probe; - -static void InitUiRegister() -{ - std::vector callerList; - SecCompUiRegister registerCallback(callerList, &g_probe); - SecCompCallerAuthorization::GetInstance().kitCallerList_.clear(); - SecCompCallerAuthorization::GetInstance().isInit_ = false; -} -} // namespace - -class SecCompRegisterChallengeTest : public testing::Test { -public: - static void SetUpTestCase(); - - static void TearDownTestCase(); - - void SetUp() override; - - void TearDown() override; -}; - -void SecCompRegisterChallengeTest::SetUpTestCase() -{ - InitUiRegister(); - SC_LOG_INFO(LABEL, "SecCompRegisterChallengeTest."); -} - -void SecCompRegisterChallengeTest::TearDownTestCase() -{ - SC_LOG_INFO(LABEL, "SecCompRegisterChallengeTest."); -} - -void SecCompRegisterChallengeTest::SetUp() -{ - SC_LOG_INFO(LABEL, "SetUp ok."); -} - -void SecCompRegisterChallengeTest::TearDown() -{ - SC_LOG_INFO(LABEL, "TearDown."); -} - -/** - * @tc.name: RegisterWithoutPreprocess001 - * @tc.desc: test register without preprocess - * @tc.type: FUNC - * @tc.require: AR000HO9JM - */ -HWTEST_F(SecCompRegisterChallengeTest, RegisterWithoutPreprocess001, TestSize.Level1) -{ - nlohmann::json jsonRes; - LocationButtonSampleBuild::BuildLocationComponentInfo(jsonRes); - std::string locationInfo = jsonRes.dump(); - - SecCompEnhanceAdapter::InitEnhanceHandler(SEC_COMP_ENHANCE_CLIENT_INTERFACE); - int32_t scId; - ASSERT_EQ(SC_ENHANCE_ERROR_CHALLENGE_CHECK_FAIL, - SecCompClient::GetInstance().RegisterSecurityComponent(LOCATION_COMPONENT, locationInfo, scId)); - ASSERT_EQ(-1, scId); -} - diff --git a/interfaces/inner_api/security_component/test/unittest/src/sec_comp_register_without_callback_test.cpp b/interfaces/inner_api/security_component/test/unittest/src/sec_comp_register_without_callback_test.cpp deleted file mode 100644 index 8c835ca..0000000 --- a/interfaces/inner_api/security_component/test/unittest/src/sec_comp_register_without_callback_test.cpp +++ /dev/null @@ -1,112 +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 "i_sec_comp_probe.h" -#include "location_button.h" -#include "location_button_sample_build.h" -#define private public -#include "sec_comp_caller_authorization.h" -#undef private -#include "sec_comp_err.h" -#include "sec_comp_info.h" -#include "sec_comp_kit.h" -#include "sec_comp_log.h" -#include "sec_comp_tool.h" -#include "sec_comp_ui_register.h" - -using namespace testing::ext; -using namespace OHOS::Security::SecurityComponent; - -namespace { -static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { - LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompRegisterWithoutCallbackTest"}; - -static void InitUiRegister() -{ - std::vector callerList; - SecCompUiRegister registerCallback(callerList, nullptr); - SecCompCallerAuthorization::GetInstance().kitCallerList_.clear(); - SecCompCallerAuthorization::GetInstance().isInit_ = false; -} -} // namespace - -class SecCompRegisterWithoutCallbackTest : public testing::Test { -public: - static void SetUpTestCase(); - - static void TearDownTestCase(); - - void SetUp() override; - - void TearDown() override; -}; - -void SecCompRegisterWithoutCallbackTest::SetUpTestCase() -{ - InitUiRegister(); - SC_LOG_INFO(LABEL, "SecCompRegisterWithoutCallbackTest."); -} - -void SecCompRegisterWithoutCallbackTest::TearDownTestCase() -{ - SC_LOG_INFO(LABEL, "SecCompRegisterWithoutCallbackTest."); -} - -void SecCompRegisterWithoutCallbackTest::SetUp() -{ - SC_LOG_INFO(LABEL, "SetUp ok."); -} - -void SecCompRegisterWithoutCallbackTest::TearDown() -{ - SC_LOG_INFO(LABEL, "TearDown."); -} - -/** - * @tc.name: RegisterWithoutCallback001 - * @tc.desc: test register without callback - * @tc.type: FUNC - * @tc.require: AR000HO9JM - */ -HWTEST_F(SecCompRegisterWithoutCallbackTest, RegisterWithoutCallback001, TestSize.Level1) -{ - nlohmann::json jsonRes; - LocationButtonSampleBuild::BuildLocationComponentInfo(jsonRes); - std::string locationInfo = jsonRes.dump(); - - int32_t scId; - ASSERT_EQ(SC_ENHANCE_ERROR_CALLBACK_NOT_EXIST, - SecCompKit::RegisterSecurityComponent(LOCATION_COMPONENT, locationInfo, scId)); - ASSERT_EQ(-1, scId); -} - -/** - * @tc.name: RegisterWithoutCallback002 - * @tc.desc: test register in MaliciousAppList. - * @tc.type: FUNC - * @tc.require: AR000HO9JM - */ -HWTEST_F(SecCompRegisterWithoutCallbackTest, RegisterWithoutCallback002, TestSize.Level1) -{ - nlohmann::json jsonRes; - LocationButtonSampleBuild::BuildLocationComponentInfo(jsonRes); - std::string locationInfo = jsonRes.dump(); - - int32_t scId; - ASSERT_EQ(SC_ENHANCE_ERROR_CALLBACK_NOT_EXIST, - SecCompKit::RegisterSecurityComponent(LOCATION_COMPONENT, locationInfo, scId)); - ASSERT_EQ(-1, scId); -} diff --git a/interfaces/inner_api/security_component/test/unittest/src/sec_comp_report_click_without_hmac_test.cpp b/interfaces/inner_api/security_component/test/unittest/src/sec_comp_report_click_without_hmac_test.cpp deleted file mode 100644 index 7c59fb2..0000000 --- a/interfaces/inner_api/security_component/test/unittest/src/sec_comp_report_click_without_hmac_test.cpp +++ /dev/null @@ -1,116 +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 "i_sec_comp_probe.h" -#include "location_button.h" -#include "location_button_sample_build.h" -#define private public -#include "sec_comp_caller_authorization.h" -#undef private -#include "sec_comp_err.h" -#include "sec_comp_info.h" -#include "sec_comp_kit.h" -#include "sec_comp_log.h" -#include "sec_comp_tool.h" -#include "sec_comp_ui_register.h" - -using namespace testing::ext; -using namespace OHOS::Security::SecurityComponent; - -namespace { -static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { - LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompReportClickWithoutHmacTest"}; -static constexpr double TEST_COORDINATE = 100.0; - -class MockUiSecCompProbe : public ISecCompProbe { -public: - int32_t GetComponentInfo(int32_t nodeId, std::string& componentInfo) override - { - componentInfo = mockComponentInfo; - return mockRes; - } - std::string mockComponentInfo; - int32_t mockRes; -}; - -static MockUiSecCompProbe g_probe; -static void InitUiRegister() -{ - std::vector callerList; - SecCompUiRegister registerCallback(callerList, &g_probe); - SecCompCallerAuthorization::GetInstance().kitCallerList_.clear(); - SecCompCallerAuthorization::GetInstance().isInit_ = false; -} -} // namespace - -class SecCompReportClickWithoutHmacTest : public testing::Test { -public: - static void SetUpTestCase(); - - static void TearDownTestCase(); - - void SetUp() override; - - void TearDown() override; -}; - -void SecCompReportClickWithoutHmacTest::SetUpTestCase() -{ - InitUiRegister(); - SC_LOG_INFO(LABEL, "SecCompReportClickWithoutHmacTest."); -} - -void SecCompReportClickWithoutHmacTest::TearDownTestCase() -{ - SC_LOG_INFO(LABEL, "SecCompReportClickWithoutHmacTest."); -} - -void SecCompReportClickWithoutHmacTest::SetUp() -{ - SC_LOG_INFO(LABEL, "SetUp ok."); -} - -void SecCompReportClickWithoutHmacTest::TearDown() -{ - SC_LOG_INFO(LABEL, "TearDown."); -} - -/** - * @tc.name: ReportClickWithoutHmac001 - * @tc.desc: test report click event without hmac data - * @tc.type: FUNC - * @tc.require: AR000HO9JM - */ -HWTEST_F(SecCompReportClickWithoutHmacTest, ReportClickWithoutHmac001, TestSize.Level1) -{ - nlohmann::json jsonRes; - LocationButtonSampleBuild::BuildLocationComponentInfo(jsonRes); - std::string locationInfo = jsonRes.dump(); - g_probe.mockComponentInfo = locationInfo; - g_probe.mockRes = 0; - - int32_t scId; - ASSERT_EQ(SC_OK, SecCompKit::RegisterSecurityComponent(LOCATION_COMPONENT, locationInfo, scId)); - ASSERT_NE(-1, scId); - - struct SecCompClickEvent touch = { - .touchX = TEST_COORDINATE, - .touchY = TEST_COORDINATE, - .timestamp = static_cast(std::chrono::high_resolution_clock::now().time_since_epoch().count()) - }; - EXPECT_EQ(SC_SERVICE_ERROR_CLICK_EVENT_INVALID, - SecCompKit::ReportSecurityComponentClickEvent(scId, locationInfo, touch, nullptr)); -} diff --git a/security_component.gni b/security_component.gni deleted file mode 100644 index f92bdb1..0000000 --- a/security_component.gni +++ /dev/null @@ -1,14 +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. - -sec_comp_dir = "//base/security/security_component" diff --git a/services/security_component_service/sa/BUILD.gn b/services/security_component_service/sa/BUILD.gn deleted file mode 100644 index 4cc4ace..0000000 --- a/services/security_component_service/sa/BUILD.gn +++ /dev/null @@ -1,91 +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("//build/ohos.gni") - -sec_comp_root_dir = "../../.." - -config("security_component_service_config") { - include_dirs = [ - "sa_main", - "${sec_comp_root_dir}/frameworks/common/include", - "${sec_comp_root_dir}/frameworks/enhance_adapter/include", - "${sec_comp_root_dir}/frameworks/security_component/include", - "${sec_comp_root_dir}/interfaces/inner_api/security_component/include", - ] -} - -ohos_prebuilt_etc("security_component_service.rc") { - source = "security_component_service.cfg" - relative_install_dir = "init" - subsystem_name = "security" - part_name = "security_component" -} - -ohos_shared_library("security_component_service") { - subsystem_name = "security" - part_name = "security_component" - - include_dirs = [ - "sa_main", - "${sec_comp_root_dir}/frameworks/common/include", - "${sec_comp_root_dir}/frameworks/enhance_adapter/include", - "${sec_comp_root_dir}/frameworks/security_component/include", - "${sec_comp_root_dir}/interfaces/inner_api/security_component/include", - ] - - sources = [ - "sa_main/app_mgr_death_recipient.cpp", - "sa_main/app_state_observer.cpp", - "sa_main/delay_exit_task.cpp", - "sa_main/first_use_dialog.cpp", - "sa_main/sec_comp_entity.cpp", - "sa_main/sec_comp_info_helper.cpp", - "sa_main/sec_comp_manager.cpp", - "sa_main/sec_comp_perm_manager.cpp", - "sa_main/sec_comp_service.cpp", - "sa_main/sec_comp_stub.cpp", - "sa_main/sec_event_handler.cpp", - ] - - cflags_cc = [ "-DHILOG_ENABLE" ] - cflags = [ "-DHILOG_ENABLE" ] - - deps = [ - ":security_component_service.rc", - "${sec_comp_root_dir}/frameworks:libsecurity_component_enhance_adapter", - "${sec_comp_root_dir}/frameworks:libsecurity_component_framework", - ] - - configs = [ "${sec_comp_root_dir}/config:coverage_flags" ] - public_configs = [ ":security_component_service_config" ] - - external_deps = [ - "ability_base:base", - "ability_base:want", - "ability_runtime:ability_manager", - "ability_runtime:app_manager", - "ability_runtime:runtime", - "access_token:libaccesstoken_sdk", - "c_utils:utils", - "eventhandler:libeventhandler", - "graphic_2d:librender_service_client", - "hilog:libhilog", - "hisysevent:libhisysevent", - "hitrace:hitrace_meter", - "ipc:ipc_core", - "safwk:system_ability_fwk", - "samgr:samgr_proxy", - "window_manager:libdm", - ] -} diff --git a/services/security_component_service/sa/sa_main/app_mgr_death_recipient.cpp b/services/security_component_service/sa/sa_main/app_mgr_death_recipient.cpp deleted file mode 100644 index 7e37725..0000000 --- a/services/security_component_service/sa/sa_main/app_mgr_death_recipient.cpp +++ /dev/null @@ -1,28 +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 "app_mgr_death_recipient.h" -#include "sec_comp_manager.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -void AppMgrDeathRecipient::OnRemoteDied(const wptr& object) -{ - SecCompManager::GetInstance().ExitWhenAppMgrDied(); -} -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS - diff --git a/services/security_component_service/sa/sa_main/app_mgr_death_recipient.h b/services/security_component_service/sa/sa_main/app_mgr_death_recipient.h deleted file mode 100644 index d4dc41c..0000000 --- a/services/security_component_service/sa/sa_main/app_mgr_death_recipient.h +++ /dev/null @@ -1,33 +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. - */ -#ifndef APP_MGR_DEATH_RECIPIENT_H -#define APP_MGR_DEATH_RECIPIENT_H - -#include "iremote_object.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -class AppMgrDeathRecipient : public IRemoteObject::DeathRecipient { -public: - AppMgrDeathRecipient() {} - virtual ~AppMgrDeathRecipient() = default; - void OnRemoteDied(const wptr& object) override; -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // APP_MGR_DEATH_RECIPIENT_H - diff --git a/services/security_component_service/sa/sa_main/app_state_observer.cpp b/services/security_component_service/sa/sa_main/app_state_observer.cpp deleted file mode 100644 index be4fa4e..0000000 --- a/services/security_component_service/sa/sa_main/app_state_observer.cpp +++ /dev/null @@ -1,129 +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 "app_state_observer.h" - -#include "sec_comp_log.h" -#include "sec_comp_manager.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -namespace { -constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "AppStateObserver"}; -} - -AppStateObserver::AppStateObserver() -{ -} - -AppStateObserver::~AppStateObserver() -{ -} - -bool AppStateObserver::IsProcessForeground(int32_t pid, int32_t uid) -{ - Utils::UniqueReadGuard infoGuard(this->fgProcLock_); - for (auto iter = foregrandProcList_.begin(); iter != foregrandProcList_.end(); ++iter) { - if (pid == iter->pid) { - return true; - } - - if ((iter->pid == -1) && (uid == iter->uid)) { - iter->pid = pid; - return true; - } - } - return false; -} - -void AppStateObserver::AddProcessToForegroundSet(int32_t pid, const SecCompProcessData& data) -{ - Utils::UniqueWriteGuard infoGuard(this->fgProcLock_); - for (auto iter = foregrandProcList_.begin(); iter != foregrandProcList_.end(); ++iter) { - if (pid == -1) { - if (iter->uid == data.uid) { - SC_LOG_INFO(LABEL, "uid %{public}d is already in foreground", data.uid); - return; - } - } else if (pid == iter->pid) { - SC_LOG_INFO(LABEL, "pid %{public}d is already in foreground", pid); - return; - } - } - foregrandProcList_.emplace_back(data); -} - -void AppStateObserver::AddProcessToForegroundSet(const AppExecFwk::AppStateData& stateData) -{ - SecCompProcessData proc = { - .bundleName = stateData.bundleName, - .pid = stateData.pid, - .uid = stateData.uid - }; - AddProcessToForegroundSet(stateData.pid, proc); -} - -void AppStateObserver::AddProcessToForegroundSet(const AppExecFwk::ProcessData &processData) -{ - SecCompProcessData proc = { - .bundleName = processData.bundleName, - .pid = processData.pid, - .uid = processData.uid - }; - AddProcessToForegroundSet(processData.pid, proc); -} - -void AppStateObserver::RemoveProcessFromForegroundSet(const AppExecFwk::ProcessData &processData) -{ - Utils::UniqueWriteGuard infoGuard(this->fgProcLock_); - for (auto iter = foregrandProcList_.begin(); iter != foregrandProcList_.end(); ++iter) { - if (processData.pid == iter->pid) { - foregrandProcList_.erase(iter); - return; - } - } -} - -void AppStateObserver::OnProcessStateChanged(const AppExecFwk::ProcessData &processData) -{ - if (processData.state == AppExecFwk::AppProcessState::APP_STATE_FOREGROUND) { - AddProcessToForegroundSet(processData); - SecCompManager::GetInstance().NotifyProcessForeground(processData.pid); - } else if (processData.state == AppExecFwk::AppProcessState::APP_STATE_BACKGROUND) { - RemoveProcessFromForegroundSet(processData); - SecCompManager::GetInstance().NotifyProcessBackground(processData.pid); - } -} - -void AppStateObserver::OnProcessDied(const AppExecFwk::ProcessData& processData) -{ - SC_LOG_INFO(LABEL, "OnProcessDied die %{public}s pid %{public}d", - processData.bundleName.c_str(), processData.pid); - RemoveProcessFromForegroundSet(processData); - SecCompManager::GetInstance().NotifyProcessDied(processData.pid); -} - -void AppStateObserver::DumpProcess(std::string& dumpStr) -{ - Utils::UniqueWriteGuard infoGuard(this->fgProcLock_); - for (auto iter = foregrandProcList_.begin(); iter != foregrandProcList_.end(); ++iter) { - dumpStr.append("uid:" + std::to_string(iter->uid) + ", pid:" + std::to_string(iter->pid)); - dumpStr.append(", procName:" + iter->bundleName + "\n"); - } -} -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS - diff --git a/services/security_component_service/sa/sa_main/app_state_observer.h b/services/security_component_service/sa/sa_main/app_state_observer.h deleted file mode 100644 index 56998a0..0000000 --- a/services/security_component_service/sa/sa_main/app_state_observer.h +++ /dev/null @@ -1,57 +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. - */ -#ifndef SECURITY_COMPONENT_SA_APP_STATE_OBSERVER_APP_STATE_OBSERVER_H -#define SECURITY_COMPONENT_SA_APP_STATE_OBSERVER_APP_STATE_OBSERVER_H - -#include -#include -#include "app_mgr_interface.h" -#include "application_state_observer_stub.h" -#include "iremote_object.h" -#include "rwlock.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -struct SecCompProcessData { - std::string bundleName; - int32_t pid = -1; - int32_t uid = -1; -}; - -class AppStateObserver : public AppExecFwk::ApplicationStateObserverStub { -public: - explicit AppStateObserver(); - virtual ~AppStateObserver(); - - void OnProcessStateChanged(const AppExecFwk::ProcessData& processData) override; - void OnProcessDied(const AppExecFwk::ProcessData& processData) override; - bool IsProcessForeground(int32_t pid, int32_t uid); - void AddProcessToForegroundSet(int32_t pid, const SecCompProcessData& data); - void AddProcessToForegroundSet(const AppExecFwk::ProcessData& processData); - void AddProcessToForegroundSet(const AppExecFwk::AppStateData& stateData); - void DumpProcess(std::string& dumpStr); - -private: - void RemoveProcessFromForegroundSet(const AppExecFwk::ProcessData& processData); - std::vector foregrandProcList_; - OHOS::Utils::RWLock fgProcLock_; -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS - -#endif // SECURITY_COMPONENT_SA_APP_STATE_OBSERVER_APP_STATE_OBSERVER_H - diff --git a/services/security_component_service/sa/sa_main/delay_exit_task.cpp b/services/security_component_service/sa/sa_main/delay_exit_task.cpp deleted file mode 100644 index 5d78873..0000000 --- a/services/security_component_service/sa/sa_main/delay_exit_task.cpp +++ /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. - */ -#include "delay_exit_task.h" - -#include "sec_comp_log.h" -#include "sec_comp_manager.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -namespace { -constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "DelayExitTask"}; -static const std::string DELAY_EXIT_TASK = "DelayExitTask"; -static const int32_t DELAY_EXIT_MILLISECONDS = 30 * 1000; // 30s -} - -DelayExitTask::DelayExitTask() -{ -} - -DelayExitTask& DelayExitTask::GetInstance() -{ - static DelayExitTask instance; - return instance; -} - -void DelayExitTask::Init(const std::shared_ptr& secHandler) -{ - secHandler_ = secHandler; -} - -void DelayExitTask::Start() -{ - if (secHandler_ == nullptr) { - SC_LOG_ERROR(LABEL, "fail to get EventHandler"); - return; - } - - std::function delayed = ([]() { - SecCompManager::GetInstance().ExitSaProcess(); - }); - - SC_LOG_INFO(LABEL, "Delay exit service after %{public}d ms", DELAY_EXIT_MILLISECONDS); - secHandler_->ProxyPostTask(delayed, DELAY_EXIT_TASK, DELAY_EXIT_MILLISECONDS); -} - -void DelayExitTask::Stop() -{ - if (secHandler_ == nullptr) { - SC_LOG_ERROR(LABEL, "fail to get EventHandler"); - return; - } - - SC_LOG_INFO(LABEL, "service delay exit handler stop"); - secHandler_->ProxyRemoveTask(DELAY_EXIT_TASK); -} -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS - diff --git a/services/security_component_service/sa/sa_main/delay_exit_task.h b/services/security_component_service/sa/sa_main/delay_exit_task.h deleted file mode 100644 index d4315df..0000000 --- a/services/security_component_service/sa/sa_main/delay_exit_task.h +++ /dev/null @@ -1,44 +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. - */ -#ifndef SECURITY_COMPONENT_DELAY_EXIT_TASK_H -#define SECURITY_COMPONENT_DELAY_EXIT_TASK_H - -#include -#include -#include "nocopyable.h" -#include "sec_event_handler.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -class DelayExitTask { -public: - static DelayExitTask& GetInstance(); - virtual ~DelayExitTask() = default; - - void Init(const std::shared_ptr& secHandler); - void Start(); - void Stop(); -private: - DelayExitTask(); - std::shared_ptr secHandler_; - - DISALLOW_COPY_AND_MOVE(DelayExitTask); -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // SECURITY_COMPONENT_DELAY_EXIT_TASK_H - diff --git a/services/security_component_service/sa/sa_main/first_use_dialog.cpp b/services/security_component_service/sa/sa_main/first_use_dialog.cpp deleted file mode 100644 index 6439824..0000000 --- a/services/security_component_service/sa/sa_main/first_use_dialog.cpp +++ /dev/null @@ -1,297 +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 "first_use_dialog.h" - -#include -#include -#include -#include -#include -#include "ability_manager_client.h" -#include "accesstoken_kit.h" -#include "sec_comp_err.h" -#include "sec_comp_log.h" -#include "want_params_wrapper.h" -#include "want.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -namespace { -constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "FirstUseDialog"}; -static const std::string SEC_COMP_SRV_CFG_PATH = "/data/service/el1/public/security_component_service"; -static const std::string FIRST_USE_RECORD_JSON = SEC_COMP_SRV_CFG_PATH + "/first_use_record.json"; -static const std::string FIRST_USE_RECORD_TAG = "FirstUseRecord"; -static const std::string TOKEN_ID_TAG = "TokenId"; -static const std::string COMP_TYPE_TAG = "CompType"; - -const std::string GRANT_ABILITY_BUNDLE_NAME = "com.ohos.permissionmanager"; -const std::string GRANT_ABILITY_ABILITY_NAME = "com.ohos.permissionmanager.SecurityExtAbility"; -const std::string TYPE_KEY = "ohos.user.security.type"; -const std::string TOKEN_KEY = "ohos.ability.params.token"; - -constexpr uint32_t MAX_CFG_FILE_SIZE = 100 * 1024; // 100k -} - -bool FirstUseDialog::IsCfgDirExist(void) -{ - struct stat fstat = {}; - if (stat(SEC_COMP_SRV_CFG_PATH.c_str(), &fstat) != 0) { - SC_LOG_INFO(LABEL, "path %{public}s errno %{public}d.", SEC_COMP_SRV_CFG_PATH.c_str(), errno); - return false; - } - - if (!S_ISDIR(fstat.st_mode)) { - SC_LOG_ERROR(LABEL, "path %{public}s is not directory.", SEC_COMP_SRV_CFG_PATH.c_str()); - return false; - } - return true; -} - -bool FirstUseDialog::IsCfgFileExist(void) -{ - struct stat fstat = {}; - if (stat(FIRST_USE_RECORD_JSON.c_str(), &fstat) != 0) { - SC_LOG_INFO(LABEL, "path %{public}s errno %{public}d.", FIRST_USE_RECORD_JSON.c_str(), errno); - return false; - } - return true; -} - -bool FirstUseDialog::IsCfgFileValid(void) -{ - struct stat fstat = {}; - if (stat(FIRST_USE_RECORD_JSON.c_str(), &fstat) != 0) { - SC_LOG_INFO(LABEL, "path %{public}s errno %{public}d.", FIRST_USE_RECORD_JSON.c_str(), errno); - return false; - } - if (fstat.st_size > MAX_CFG_FILE_SIZE) { - SC_LOG_INFO(LABEL, "path %{public}s errno %{public}d.", FIRST_USE_RECORD_JSON.c_str(), errno); - return false; - } - return true; -} - -bool FirstUseDialog::ReadCfgContent(std::string& content) -{ - std::stringstream buffer; - std::ifstream i(FIRST_USE_RECORD_JSON); - if (!i.is_open()) { - SC_LOG_ERROR(LABEL, "cannot open file %{public}s, errno %{public}d.", FIRST_USE_RECORD_JSON.c_str(), errno); - return false; - } - buffer << i.rdbuf(); - content = buffer.str(); - i.close(); - return true; -} - -void FirstUseDialog::WriteCfgContent(const std::string& content) -{ - std::ofstream out(FIRST_USE_RECORD_JSON); - if (!out.is_open()) { - SC_LOG_ERROR(LABEL, "cannot open file %{public}s, errno %{public}d.", FIRST_USE_RECORD_JSON.c_str(), errno); - return; - } - out << content; - out.close(); -} - -bool FirstUseDialog::ParseRecord(nlohmann::json& jsonRes, - AccessToken::AccessTokenID& id, uint64_t& type) -{ - if (jsonRes.find(TOKEN_ID_TAG) == jsonRes.end() || - !jsonRes.at(TOKEN_ID_TAG).is_number()) { - SC_LOG_ERROR(LABEL, "parse TokenId failed."); - return false; - } - id = jsonRes.at(TOKEN_ID_TAG).get(); - if (id == AccessToken::INVALID_TOKENID) { - SC_LOG_ERROR(LABEL, "TokenId is not invalid."); - return false; - } - - if (jsonRes.find(COMP_TYPE_TAG) == jsonRes.end() || - !jsonRes.at(COMP_TYPE_TAG).is_number()) { - SC_LOG_ERROR(LABEL, "parse CompType failed."); - return false; - } - type = jsonRes.at(COMP_TYPE_TAG).get(); - return true; -} - -void FirstUseDialog::ParseRecords(nlohmann::json& jsonRes) -{ - std::unique_lock lock(useMapMutex_); - if (jsonRes.find(FIRST_USE_RECORD_TAG) == jsonRes.end() || - !jsonRes.at(FIRST_USE_RECORD_TAG).is_array()) { - SC_LOG_ERROR(LABEL, "parse tag failed."); - return; - } - - nlohmann::json recordListJson = jsonRes.at(FIRST_USE_RECORD_TAG); - for (auto& recordJson : recordListJson) { - AccessToken::AccessTokenID id; - uint64_t type; - if (!ParseRecord(recordJson, id, type)) { - SC_LOG_ERROR(LABEL, "parse record failed."); - return; - } - firstUseMap_[id] = type; - } -} - -void FirstUseDialog::LoadFirstUseRecord(void) -{ - if (!IsCfgFileValid()) { - SC_LOG_INFO(LABEL, "first use record is invalid."); - return; - } - - std::string content; - if (!ReadCfgContent(content)) { - return; - } - - nlohmann::json jsonRes = nlohmann::json::parse(content, nullptr, false); - if (jsonRes.is_discarded()) { - SC_LOG_ERROR(LABEL, "cfg info format is invalid"); - return; - } - - ParseRecords(jsonRes); -} - -void FirstUseDialog::SaveFirstUseRecord(void) -{ - SC_LOG_INFO(LABEL, "start save first_use_record json"); - if (!IsCfgDirExist()) { - SC_LOG_ERROR(LABEL, "dir %{public}s is not exist, errno %{public}d", - SEC_COMP_SRV_CFG_PATH.c_str(), errno); - return; - } - - if (!IsCfgFileExist()) { - if (creat(FIRST_USE_RECORD_JSON.c_str(), S_IRUSR | S_IWUSR) == -1) { - SC_LOG_ERROR(LABEL, "create %{public}s failed, errno %{public}d", - FIRST_USE_RECORD_JSON.c_str(), errno); - return; - } - } - - nlohmann::json jsonRes; - { - std::unique_lock lock(useMapMutex_); - nlohmann::json recordsJson; - for (auto iter = firstUseMap_.begin(); iter != firstUseMap_.end(); ++iter) { - AccessToken::AccessTokenID id = iter->first; - AccessToken::HapTokenInfo info; - if (AccessToken::AccessTokenKit::GetHapTokenInfo(id, info) != AccessToken::RET_SUCCESS) { - SC_LOG_INFO(LABEL, "token id %{public}d is not exist, do not update it.", id); - continue; - } - nlohmann::json recordJson; - recordJson[TOKEN_ID_TAG] = id; - recordJson[COMP_TYPE_TAG] = iter->second; - recordsJson.emplace_back(recordJson); - } - - jsonRes[FIRST_USE_RECORD_TAG] = recordsJson; - } - WriteCfgContent(jsonRes.dump()); -} - -void FirstUseDialog::StartDialogAbility(SecCompType type, sptr callerToken) -{ - int32_t typeNum; - if (type == LOCATION_COMPONENT) { - typeNum = 0; - } else if (type == SAVE_COMPONENT) { - typeNum = 1; - } else { - SC_LOG_ERROR(LABEL, "unknown type."); - return; - } - - AAFwk::Want want; - want.SetElementName(GRANT_ABILITY_BUNDLE_NAME, GRANT_ABILITY_ABILITY_NAME); - want.SetParam(TYPE_KEY, typeNum); - want.SetParam(TOKEN_KEY, callerToken); - int startRes = AAFwk::AbilityManagerClient::GetInstance()->StartExtensionAbility(want, callerToken); - SC_LOG_INFO(LABEL, "start ability res %{public}d", startRes); -} - -void FirstUseDialog::SendSaveEventHandler(void) -{ - std::function delayed = ([this]() { - this->SaveFirstUseRecord(); - }); - - SC_LOG_INFO(LABEL, "Delay first_use_record json"); - secHandler_->ProxyPostTask(delayed); -} - -void FirstUseDialog::NotifyFirstUseDialog(AccessToken::AccessTokenID tokenId, SecCompType type, - sptr callerToken) -{ - if (secHandler_ == nullptr) { - SC_LOG_ERROR(LABEL, "event handler invalid."); - return; - } - if (callerToken == nullptr) { - SC_LOG_INFO(LABEL, "callerToken is null, no need to notify dialog"); - return; - } - - uint64_t typeMask; - if (type == LOCATION_COMPONENT) { - typeMask = LOCATION_BUTTON_FIRST_USE; - } else if (type == SAVE_COMPONENT) { - typeMask = SAVE_BUTTON_FIRST_USE; - } else { - SC_LOG_INFO(LABEL, "this type need not notify dialog to user"); - return; - } - - std::unique_lock lock(useMapMutex_); - auto iter = firstUseMap_.find(tokenId); - if (iter == firstUseMap_.end()) { - SC_LOG_INFO(LABEL, "has not use record, start dialog"); - StartDialogAbility(type, callerToken); - firstUseMap_[tokenId] = typeMask; - SendSaveEventHandler(); - return; - } - - uint64_t compTypes = firstUseMap_[tokenId]; - if ((compTypes & typeMask) == typeMask) { - SC_LOG_INFO(LABEL, "no need notify again."); - return; - } - StartDialogAbility(type, callerToken); - firstUseMap_[tokenId] |= typeMask; - SendSaveEventHandler(); -} - -void FirstUseDialog::Init(std::shared_ptr secHandler) -{ - SC_LOG_DEBUG(LABEL, "Init!!"); - secHandler_ = secHandler; - LoadFirstUseRecord(); -} -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS - diff --git a/services/security_component_service/sa/sa_main/first_use_dialog.h b/services/security_component_service/sa/sa_main/first_use_dialog.h deleted file mode 100644 index fd04777..0000000 --- a/services/security_component_service/sa/sa_main/first_use_dialog.h +++ /dev/null @@ -1,64 +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. - */ -#ifndef FIRST_USE_DIALOG_H -#define FIRST_USE_DIALOG_H - -#include -#include -#include -#include -#include "access_token.h" -#include "iremote_object.h" -#include "nlohmann/json.hpp" -#include "sec_comp_err.h" -#include "sec_comp_info.h" -#include "sec_event_handler.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -constexpr uint64_t LOCATION_BUTTON_FIRST_USE = 1 << 0; -constexpr uint64_t SAVE_BUTTON_FIRST_USE = 1 << 1; - -class FirstUseDialog final { -public: - FirstUseDialog() = default; - ~FirstUseDialog() = default; - void NotifyFirstUseDialog(AccessToken::AccessTokenID tokenId, SecCompType type, sptr callerToken); - void Init(std::shared_ptr secHandler); - -private: - bool IsCfgDirExist(void); - bool IsCfgFileExist(void); - bool IsCfgFileValid(void); - bool ReadCfgContent(std::string& content); - void WriteCfgContent(const std::string& content); - bool ParseRecord(nlohmann::json& jsonRes, - AccessToken::AccessTokenID& id, uint64_t& type); - void ParseRecords(nlohmann::json& jsonRes); - void LoadFirstUseRecord(void); - void SaveFirstUseRecord(void); - void StartDialogAbility(SecCompType type, sptr callerToken); - void SendSaveEventHandler(void); - - std::mutex useMapMutex_; - std::unordered_map firstUseMap_; - std::shared_ptr secHandler_; -}; -} // namespace SecurityComponentEnhance -} // namespace Security -} // namespace OHOS -#endif // FIRST_USE_DIALOG_H - diff --git a/services/security_component_service/sa/sa_main/sec_comp_entity.cpp b/services/security_component_service/sa/sa_main/sec_comp_entity.cpp deleted file mode 100644 index aec385a..0000000 --- a/services/security_component_service/sa/sa_main/sec_comp_entity.cpp +++ /dev/null @@ -1,84 +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 "sec_comp_entity.h" - -#include -#include "hisysevent.h" -#include "ipc_skeleton.h" -#include "sec_comp_err.h" -#include "sec_comp_enhance_adapter.h" -#include "sec_comp_info_helper.h" -#include "sec_comp_log.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -namespace { -constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompEntity"}; -static constexpr uint64_t MAX_TOUCH_INTERVAL = 1000000L; // 1000ms -static constexpr uint64_t TIME_CONVERSION_UNIT = 1000; -} - -int32_t SecCompEntity::RevokeTempPermission() -{ - if (!isGrant_) { - SC_LOG_ERROR(LABEL, "security component is not granted"); - return SC_OK; - } - isGrant_ = false; - return SecCompInfoHelper::RevokeTempPermission(tokenId_, componentInfo_); -} - -int32_t SecCompEntity::GrantTempPermission() -{ - isGrant_ = true; - return SecCompInfoHelper::GrantTempPermission(tokenId_, componentInfo_); -} - -bool SecCompEntity::CompareComponentBasicInfo(SecCompBase* other, bool isRectCheck) const -{ - return componentInfo_->CompareComponentBasicInfo(other, isRectCheck); -} - -bool SecCompEntity::CheckTouchInfo(const SecCompClickEvent& touchInfo) const -{ - auto current = static_cast( - std::chrono::high_resolution_clock::now().time_since_epoch().count()) / TIME_CONVERSION_UNIT; - if (touchInfo.timestamp < current - MAX_TOUCH_INTERVAL || touchInfo.timestamp > current) { - SC_LOG_ERROR(LABEL, "touch timestamp invalid touchInfo. timestamp: %{public}lu, current: %{public}lu", - touchInfo.timestamp, current); - return false; - } - - if (!componentInfo_->rect_.IsInRect(touchInfo.touchX, touchInfo.touchY)) { - SC_LOG_ERROR(LABEL, "touch point is not in component rect"); - return false; - } - - int32_t res = SecCompEnhanceAdapter::CheckExtraInfo(touchInfo); - if ((res != SC_OK) && (res != SC_ENHANCE_ERROR_NOT_EXIST_ENHANCE)) { - SC_LOG_ERROR(LABEL, "HMAC checkout failed" - "touchX:%{public}f, touchY:%{public}f, timestamp:%{public}lu, dataSize:%{public}d", - touchInfo.touchX, touchInfo.touchY, touchInfo.timestamp, touchInfo.extraInfo.dataSize); - HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::SEC_COMPONENT, "CLICK_INFO_CHECK_FAILED", - HiviewDFX::HiSysEvent::EventType::SECURITY, "CALLER_UID", IPCSkeleton::GetCallingUid(), - "CALLER_PID", IPCSkeleton::GetCallingPid(), "SC_ID", scId_, "SC_TYPE", componentInfo_->type_); - return false; - } - return true; -} -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS diff --git a/services/security_component_service/sa/sa_main/sec_comp_entity.h b/services/security_component_service/sa/sa_main/sec_comp_entity.h deleted file mode 100644 index d95f6f6..0000000 --- a/services/security_component_service/sa/sa_main/sec_comp_entity.h +++ /dev/null @@ -1,80 +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. - */ -#ifndef SECURITY_COMPONENT_ENTITY_H -#define SECURITY_COMPONENT_ENTITY_H - -#include -#include "accesstoken_kit.h" -#include "sec_comp_base.h" -#include "sec_comp_info.h" -#include "sec_comp_perm_manager.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -class SecCompEntity { -public: - SecCompEntity(std::shared_ptr component, - AccessToken::AccessTokenID token, int32_t scId) : componentInfo_(component), - tokenId_(token), scId_(scId){}; - ~SecCompEntity() = default; - int32_t RevokeTempPermission(); - int32_t GrantTempPermission(); - int32_t GetScId() const - { - return scId_; - }; - - SecCompType GetType() const - { - if (componentInfo_ == nullptr) { - return UNKNOWN_SC_TYPE; - } - return componentInfo_->type_; - }; - - bool IsGrant() const - { - return isGrant_; - } - - std::shared_ptr GetComponentInfo() const - { - return componentInfo_; - }; - - void SetComponentInfo(const std::shared_ptr& com) - { - componentInfo_ = com; - }; - - std::shared_ptr GetComponentInfo() - { - return componentInfo_; - }; - - bool CompareComponentBasicInfo(SecCompBase* other, bool isRectCheck) const; - bool CheckTouchInfo(const SecCompClickEvent& touchInfo) const; - -private: - std::shared_ptr componentInfo_; - bool isGrant_ = false; - AccessToken::AccessTokenID tokenId_; - int32_t scId_; -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // SECURITY_COMPONENT_ENTITY_H diff --git a/services/security_component_service/sa/sa_main/sec_comp_info_helper.cpp b/services/security_component_service/sa/sa_main/sec_comp_info_helper.cpp deleted file mode 100644 index 7058200..0000000 --- a/services/security_component_service/sa/sa_main/sec_comp_info_helper.cpp +++ /dev/null @@ -1,272 +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 "sec_comp_info_helper.h" - -#include "display.h" -#include "display_info.h" -#include "display_manager.h" -#include "location_button.h" -#include "paste_button.h" -#include "save_button.h" -#include "sec_comp_err.h" -#include "sec_comp_log.h" -#include "sec_comp_service.h" -#include "sec_comp_tool.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -namespace { -constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompInfoHelper"}; -static constexpr double MAX_RECT_PERCENT = 0.1F; // 10% -static constexpr double ZERO_OFFSET = 0.0F; -static std::mutex g_renderLock; -} - -SecCompBase* SecCompInfoHelper::ParseComponent(SecCompType type, const nlohmann::json& jsonComponent) -{ - SecCompBase* comp = nullptr; - switch (type) { - case LOCATION_COMPONENT: - comp = ConstructComponent(jsonComponent); - break; - case PASTE_COMPONENT: - comp = ConstructComponent(jsonComponent); - break; - case SAVE_COMPONENT: - comp = ConstructComponent(jsonComponent); - break; - default: - SC_LOG_ERROR(LABEL, "Parse component type unknown"); - break; - } - if (comp == nullptr) { - SC_LOG_ERROR(LABEL, "Parse component failed"); - return comp; - } - - comp->SetValid(CheckComponentValid(comp)); - return comp; -} - -static bool GetScreenSize(double& width, double& height) -{ - sptr display = - OHOS::Rosen::DisplayManager::GetInstance().GetDefaultDisplaySync(); - if (display == nullptr) { - SC_LOG_ERROR(LABEL, "Get display manager failed"); - return false; - } - - auto info = display->GetDisplayInfo(); - if (info == nullptr) { - SC_LOG_ERROR(LABEL, "Get display info failed"); - return false; - } - - width = static_cast(info->GetWidth()); - height = static_cast(info->GetHeight()); - SC_LOG_DEBUG(LABEL, "display manager Screen width %{public}f height %{public}f", - width, height); - return true; -} - -bool SecCompInfoHelper::CheckRectValid(const SecCompRect& rect, const SecCompRect& windowRect) -{ - double curScreenWidth = 0.0F; - double curScreenHeight = 0.0F; - if (!GetScreenSize(curScreenWidth, curScreenHeight)) { - SC_LOG_ERROR(LABEL, "Get screen size is invalid"); - return false; - } - - if (GreatOrEqual(0.0, rect.width_) || GreatOrEqual(0.0, rect.height_)) { - SC_LOG_ERROR(LABEL, "width or height is <= 0"); - return false; - } - - if (GreatNotEqual(ZERO_OFFSET, rect.x_) || GreatNotEqual(ZERO_OFFSET, rect.y_) || - GreatNotEqual(rect.x_, curScreenWidth) || GreatNotEqual(rect.y_, curScreenHeight)) { - SC_LOG_ERROR(LABEL, "start point is out of screen"); - return false; - } - - if (GreatOrEqual((rect.x_ + rect.width_), curScreenWidth) || - GreatOrEqual((rect.y_ + rect.height_), curScreenHeight)) { - SC_LOG_ERROR(LABEL, "rect is out of screen"); - return false; - } - - if (GreatNotEqual(windowRect.x_, rect.x_) || GreatNotEqual(windowRect.y_, rect.y_) || - GreatNotEqual(rect.width_, windowRect.width_) || GreatNotEqual(rect.height_, windowRect.height_)) { - SC_LOG_ERROR(LABEL, "rect is out of window"); - return false; - } - - // check rect > 10% - if (GreatOrEqual((rect.width_ * rect.height_), (curScreenWidth * curScreenHeight * MAX_RECT_PERCENT))) { - SC_LOG_ERROR(LABEL, "rect area is too large"); - return false; - } - SC_LOG_DEBUG(LABEL, "check component rect success."); - return true; -} - -static bool CheckSecCompBaseButton(const SecCompBase* comp) -{ - if ((comp->text_ < 0) && (comp->icon_ < 0)) { - SC_LOG_INFO(LABEL, "both text and icon do not exist."); - return false; - } - if ((comp->text_ >= 0) && comp->fontSize_ < MIN_FONT_SIZE) { - SC_LOG_INFO(LABEL, "font size invalid."); - return false; - } - if ((comp->icon_ >= 0) && comp->iconSize_ < MIN_ICON_SIZE) { - SC_LOG_INFO(LABEL, "icon size invalid."); - return false; - } - - if ((comp->bg_ != SecCompBackground::NO_BG_TYPE) && - (((comp->text_ != NO_TEXT) && (IsColorSimilar(comp->fontColor_, comp->bgColor_))) || - ((comp->icon_ != NO_ICON) && (IsColorSimilar(comp->iconColor_, comp->bgColor_))))) { - SC_LOG_INFO(LABEL, "fontColor or iconColor is similar whith backgroundColor."); - return false; - } - - if (comp->bg_ == SecCompBackground::NO_BG_TYPE && - ((comp->padding_.top != MIN_PADDING_WITHOUT_BG) || (comp->padding_.right != MIN_PADDING_WITHOUT_BG) || - (comp->padding_.bottom != MIN_PADDING_WITHOUT_BG) || (comp->padding_.left != MIN_PADDING_WITHOUT_BG))) { - SC_LOG_INFO(LABEL, "padding can not change without background."); - return false; - } - - return true; -} - -static bool CheckSecCompBase(const SecCompBase* comp) -{ - if (comp->parentEffect_) { - SC_LOG_ERROR(LABEL, "parentEffect is active, security component invalid."); - return false; - } - - if ((comp->padding_.top < MIN_PADDING_SIZE) || (comp->padding_.right < MIN_PADDING_SIZE) || - (comp->padding_.bottom < MIN_PADDING_SIZE) || (comp->padding_.left < MIN_PADDING_SIZE) || - (comp->textIconSpace_ < MIN_PADDING_SIZE)) { - SC_LOG_ERROR(LABEL, "size is invalid."); - return false; - } - - if (((comp->bg_ != SecCompBackground::NO_BG_TYPE) && (IsColorTransparent(comp->bgColor_))) || - ((comp->text_ != NO_TEXT) && (IsColorTransparent(comp->fontColor_))) || - ((comp->icon_ != NO_ICON) && (IsColorTransparent(comp->iconColor_)))) { - SC_LOG_ERROR(LABEL, "bgColor or fontColor or iconColor is too transparent."); - return false; - } - if (!CheckSecCompBaseButton(comp)) { - return false; - } - return true; -} - -bool SecCompInfoHelper::CheckComponentValid(const SecCompBase* comp) -{ - if ((comp == nullptr) || !IsComponentTypeValid(comp->type_)) { - SC_LOG_INFO(LABEL, "comp is null or type is invalid."); - return false; - } - - if (!CheckSecCompBase(comp)) { - SC_LOG_INFO(LABEL, "SecComp base is invalid."); - return false; - } - - return true; -} - -int32_t SecCompInfoHelper::GrantTempPermission(AccessToken::AccessTokenID tokenId, - const std::shared_ptr& componentInfo) -{ - if ((tokenId <= 0) || (componentInfo == nullptr)) { - SC_LOG_ERROR(LABEL, "revoke component is null"); - return SC_SERVICE_ERROR_PERMISSION_OPER_FAIL; - } - - SecCompType type = componentInfo->type_; - switch (type) { - case LOCATION_COMPONENT: - { - int32_t res = SecCompPermManager::GetInstance().GrantLocationPermission(tokenId, - "ohos.permission.APPROXIMATELY_LOCATION", AccessToken::PermissionFlag::PERMISSION_COMPONENT_SET); - if (res != SC_OK) { - return SC_SERVICE_ERROR_PERMISSION_OPER_FAIL; - } - res = SecCompPermManager::GetInstance().GrantLocationPermission(tokenId, "ohos.permission.LOCATION", - AccessToken::PermissionFlag::PERMISSION_COMPONENT_SET); - if (res != SC_OK) { - SecCompPermManager::GetInstance().RevokeLocationPermission( - tokenId, "ohos.permission.APPROXIMATELY_LOCATION", - AccessToken::PermissionFlag::PERMISSION_COMPONENT_SET); - return SC_SERVICE_ERROR_PERMISSION_OPER_FAIL; - } - return SC_OK; - } - case PASTE_COMPONENT: - SC_LOG_DEBUG(LABEL, "grant paste permission"); - return SC_OK; - case SAVE_COMPONENT: - SC_LOG_DEBUG(LABEL, "grant save permission"); - return SecCompPermManager::GetInstance().GrantTempSavePermission(tokenId); - default: - SC_LOG_ERROR(LABEL, "Parse component type unknown"); - break; - } - return SC_SERVICE_ERROR_PERMISSION_OPER_FAIL; -} - -int32_t SecCompInfoHelper::RevokeTempPermission(AccessToken::AccessTokenID tokenId, - const std::shared_ptr& componentInfo) -{ - if (componentInfo == nullptr) { - SC_LOG_ERROR(LABEL, "revoke component is null"); - return SC_SERVICE_ERROR_PERMISSION_OPER_FAIL; - } - - SecCompType type = componentInfo->type_; - switch (type) { - case LOCATION_COMPONENT: - { - int32_t locationRes = SecCompPermManager::GetInstance().RevokeLocationPermission(tokenId, - "ohos.permission.LOCATION", AccessToken::PermissionFlag::PERMISSION_COMPONENT_SET); - int32_t approxLocationRes = SecCompPermManager::GetInstance().RevokeLocationPermission(tokenId, - "ohos.permission.APPROXIMATELY_LOCATION", AccessToken::PermissionFlag::PERMISSION_COMPONENT_SET); - if ((locationRes != SC_OK) || (approxLocationRes != SC_OK)) { - return SC_SERVICE_ERROR_PERMISSION_OPER_FAIL; - } - return SC_OK; - } - case PASTE_COMPONENT: - SC_LOG_DEBUG(LABEL, "revoke paste permission"); - return SC_OK; - default: - SC_LOG_ERROR(LABEL, "revoke component type unknown"); - break; - } - return SC_SERVICE_ERROR_PERMISSION_OPER_FAIL; -} -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS diff --git a/services/security_component_service/sa/sa_main/sec_comp_info_helper.h b/services/security_component_service/sa/sa_main/sec_comp_info_helper.h deleted file mode 100644 index 463c9fc..0000000 --- a/services/security_component_service/sa/sa_main/sec_comp_info_helper.h +++ /dev/null @@ -1,51 +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. - */ -#ifndef I_SECURITY_COMPONENT_INFO_HELPER_H -#define I_SECURITY_COMPONENT_INFO_HELPER_H - -#include "accesstoken_kit.h" -#include "nlohmann/json.hpp" -#include "sec_comp_base.h" -#include "sec_comp_info.h" -#include "sec_comp_perm_manager.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -template -T* ConstructComponent(const nlohmann::json& jsonComponent) -{ - T *componentPtr = new (std::nothrow)T(); - if ((componentPtr != nullptr) && !componentPtr->FromJson(jsonComponent)) { - delete componentPtr; - return nullptr; - } - return componentPtr; -} - -class SecCompInfoHelper { -public: - static SecCompBase* ParseComponent(SecCompType type, const nlohmann::json& jsonComponent); - static int32_t RevokeTempPermission(AccessToken::AccessTokenID tokenId, - const std::shared_ptr& componentInfo); - static int32_t GrantTempPermission(AccessToken::AccessTokenID tokenId, - const std::shared_ptr& componentInfo); - static bool CheckComponentValid(const SecCompBase* comp); - static bool CheckRectValid(const SecCompRect& rect, const SecCompRect& windowRect); -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // I_SECURITY_COMPONENT_INFO_HELPER_H diff --git a/services/security_component_service/sa/sa_main/sec_comp_manager.cpp b/services/security_component_service/sa/sa_main/sec_comp_manager.cpp deleted file mode 100644 index 899e2b4..0000000 --- a/services/security_component_service/sa/sa_main/sec_comp_manager.cpp +++ /dev/null @@ -1,519 +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 "sec_comp_manager.h" - -#include "delay_exit_task.h" -#include "hisysevent.h" -#include "i_sec_comp_service.h" -#include "ipc_skeleton.h" -#include "iservice_registry.h" -#include "sec_comp_enhance_adapter.h" -#include "sec_comp_err.h" -#include "sec_comp_info_helper.h" -#include "sec_comp_log.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -namespace { -constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompManager"}; -static constexpr int32_t SC_ID_START = 1000; -static constexpr int32_t MAX_INT_NUM = 0x7fffffff; -static constexpr int32_t ROOT_UID = 0; -} - -SecCompManager::SecCompManager() -{ - scIdStart_ = SC_ID_START; -} - -SecCompManager& SecCompManager::GetInstance() -{ - static SecCompManager instance; - return instance; -} - -int32_t SecCompManager::CreateScId() -{ - std::lock_guard lock(scIdMtx_); - if (scIdStart_ == MAX_INT_NUM) { - scIdStart_ = SC_ID_START; - } else { - scIdStart_++; - } - return scIdStart_; -} - -int32_t SecCompManager::AddSecurityComponentToList(int32_t pid, const SecCompEntity& newEntity) -{ - OHOS::Utils::UniqueWriteGuard lk(this->componentInfoLock_); - if (isSaExit_) { - SC_LOG_ERROR(LABEL, "SA is exiting, retry..."); - return SC_SERVICE_ERROR_SERVICE_NOT_EXIST; - } - - auto iter = componentMap_.find(pid); - if (iter != componentMap_.end()) { - iter->second.isForeground = true; - iter->second.compList.emplace_back(newEntity); - SecCompEnhanceAdapter::EnableInputEnhance(); - return SC_OK; - } - - ProcessCompInfos newProcess; - newProcess.isForeground = true; - newProcess.compList.emplace_back(newEntity); - componentMap_[pid] = newProcess; - SecCompEnhanceAdapter::EnableInputEnhance(); - return SC_OK; -} - -int32_t SecCompManager::DeleteSecurityComponentFromList(int32_t pid, int32_t scId) -{ - OHOS::Utils::UniqueWriteGuard lk(this->componentInfoLock_); - auto iter = componentMap_.find(pid); - if (iter == componentMap_.end()) { - SC_LOG_ERROR(LABEL, "Can not find registered process"); - return SC_SERVICE_ERROR_COMPONENT_NOT_EXIST; - } - std::vector& list = iter->second.compList; - for (auto it = list.begin(); it != list.end(); ++it) { - if (it->GetScId() == scId) { - it->RevokeTempPermission(); - list.erase(it); - if (!IsForegroundCompExist()) { - SecCompEnhanceAdapter::DisableInputEnhance(); - } - return SC_OK; - } - } - SC_LOG_ERROR(LABEL, "Can not find component"); - return SC_SERVICE_ERROR_COMPONENT_NOT_EXIST; -} - -bool SecCompManager::IsInMaliciousAppList(int32_t pid) -{ - std::lock_guard lock(maliciousMtx_); - if (IPCSkeleton::GetCallingUid() == ROOT_UID) { - return false; - } - return (maliciousAppList_.find(pid) != maliciousAppList_.end()); -} - -void SecCompManager::AddAppToMaliciousAppList(int32_t pid) -{ - std::lock_guard lock(maliciousMtx_); - maliciousAppList_.insert(pid); -} - -void SecCompManager::RemoveAppFromMaliciousAppList(int32_t pid) -{ - std::lock_guard lock(maliciousMtx_); - maliciousAppList_.erase(pid); -} - -bool SecCompManager::IsMaliciousAppListEmpty() -{ - std::lock_guard lock(maliciousMtx_); - return (maliciousAppList_.size() == 0); -} - -static std::string TransformCallBackResult(enum SCErrCode error) -{ - std::string errMsg = ""; - switch (error) { - case SC_ENHANCE_ERROR_NOT_EXIST_ENHANCE: - errMsg = "enhance do not exist"; - break; - case SC_ENHANCE_ERROR_VALUE_INVALID: - errMsg = "value is invalid"; - break; - case SC_ENHANCE_ERROR_CALLBACK_NOT_EXIST: - errMsg = "callback do not exist"; - break; - case SC_ENHANCE_ERROR_CALLBACK_OPER_FAIL: - errMsg = "callback operate fail"; - break; - case SC_SERVICE_ERROR_COMPONENT_INFO_INVALID: - errMsg = "component info invalid"; - break; - case SC_ENHANCE_ERROR_CALLBACK_CHECK_FAIL: - errMsg = "callback check fail"; - break; - default: - errMsg = "unknown error"; - break; - } - return errMsg; -} - -SecCompEntity* SecCompManager::GetSecurityComponentFromList(int32_t pid, int32_t scId) -{ - auto iter = componentMap_.find(pid); - if (iter == componentMap_.end()) { - return nullptr; - } - std::vector& list = iter->second.compList; - for (auto it = list.begin(); it != list.end(); ++it) { - if (it->GetScId() == scId) { - return std::addressof(*it); - } - } - return nullptr; -} - -bool SecCompManager::IsForegroundCompExist() -{ - return std::any_of(componentMap_.begin(), componentMap_.end(), [](const auto & iter) { - return (iter.second.isForeground) && (iter.second.compList.size() > 0); - }); -} - -void SecCompManager::NotifyProcessForeground(int32_t pid) -{ - OHOS::Utils::UniqueWriteGuard lk(this->componentInfoLock_); - auto iter = componentMap_.find(pid); - if (iter == componentMap_.end()) { - return; - } - iter->second.isForeground = true; - if (IsForegroundCompExist()) { - SecCompEnhanceAdapter::EnableInputEnhance(); - } - - SC_LOG_INFO(LABEL, "App pid %{public}d to foreground", pid); -} - -void SecCompManager::NotifyProcessBackground(int32_t pid) -{ - OHOS::Utils::UniqueWriteGuard lk(this->componentInfoLock_); - auto iter = componentMap_.find(pid); - if (iter == componentMap_.end()) { - return; - } - - iter->second.isForeground = false; - if (!IsForegroundCompExist()) { - SecCompEnhanceAdapter::DisableInputEnhance(); - } - SC_LOG_INFO(LABEL, "App pid %{public}d to background", pid); -} - -void SecCompManager::NotifyProcessDied(int32_t pid) -{ - // notify enhance process died. - SecCompEnhanceAdapter::NotifyProcessDied(pid); - - RemoveAppFromMaliciousAppList(pid); - OHOS::Utils::UniqueWriteGuard lk(this->componentInfoLock_); - auto iter = componentMap_.find(pid); - if (iter == componentMap_.end()) { - return; - } - SC_LOG_INFO(LABEL, "App pid %{public}d died", pid); - std::vector& list = iter->second.compList; - for (auto it = list.begin(); it != list.end(); ++it) { - it->RevokeTempPermission(); - } - list.clear(); - componentMap_.erase(pid); - - if (!IsForegroundCompExist()) { - SecCompEnhanceAdapter::DisableInputEnhance(); - } - - DelayExitTask::GetInstance().Start(); -} - -void SecCompManager::ExitSaProcess() -{ - OHOS::Utils::UniqueReadGuard lk(this->componentInfoLock_); - if (!componentMap_.empty() || !IsMaliciousAppListEmpty()) { - SC_LOG_INFO(LABEL, "Apps using security component still exist, no exit sa"); - return; - } - isSaExit_ = true; - SecCompEnhanceAdapter::DisableInputEnhance(); - SecCompEnhanceAdapter::ExistEnhanceService(); - - SC_LOG_INFO(LABEL, "All processes using security component died, start sa exit"); - auto systemAbilityMgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); - if (systemAbilityMgr == nullptr) { - SC_LOG_ERROR(LABEL, "Failed to get SystemAbilityManager."); - return; - } - int32_t ret = systemAbilityMgr->UnloadSystemAbility(SA_ID_SECURITY_COMPONENT_SERVICE); - if (ret != SC_OK) { - SC_LOG_ERROR(LABEL, "Failed to UnloadSystemAbility service! errcode=%{public}d", ret); - return; - } - SC_LOG_INFO(LABEL, "UnloadSystemAbility successfully!"); -} - -void SecCompManager::ExitWhenAppMgrDied() -{ - OHOS::Utils::UniqueWriteGuard lk(this->componentInfoLock_); - for (auto iter = componentMap_.begin(); iter != componentMap_.end(); ++iter) { - std::vector& list = iter->second.compList; - for (auto it = list.begin(); it != list.end(); ++it) { - it->RevokeTempPermission(); - } - list.clear(); - } - componentMap_.clear(); - - // no need exit enhance service, only disable input enhance. - SecCompEnhanceAdapter::DisableInputEnhance(); - isSaExit_ = true; - - SC_LOG_INFO(LABEL, "app mgr died, start sa exit"); - auto systemAbilityMgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); - if (systemAbilityMgr == nullptr) { - SC_LOG_ERROR(LABEL, "failed to get SystemAbilityManager."); - return; - } - int32_t ret = systemAbilityMgr->UnloadSystemAbility(SA_ID_SECURITY_COMPONENT_SERVICE); - if (ret != SC_OK) { - SC_LOG_ERROR(LABEL, "failed to UnloadSystemAbility service! errcode=%{public}d", ret); - return; - } - SC_LOG_INFO(LABEL, "UnloadSystemAbility successfully!"); -} - -void SecCompManager::SendCheckInfoEnhanceSysEvent(int32_t scId, - SecCompType type, const std::string& scene, int32_t res) -{ - if (res == SC_ENHANCE_ERROR_CHALLENGE_CHECK_FAIL) { - HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::SEC_COMPONENT, "CHALLENGE_CHECK_FAILED", - HiviewDFX::HiSysEvent::EventType::SECURITY, "CALLER_UID", IPCSkeleton::GetCallingUid(), - "CALLER_PID", IPCSkeleton::GetCallingPid(), "SC_ID", scId, "SC_TYPE", type, "CALL_SCENE", - scene); - } else { - HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::SEC_COMPONENT, "CALLBACK_FAILED", - HiviewDFX::HiSysEvent::EventType::SECURITY, "CALLER_UID", IPCSkeleton::GetCallingUid(), - "CALLER_PID", IPCSkeleton::GetCallingPid(), "SC_TYPE", type, - "CALL_SCENE", scene, "REASON", TransformCallBackResult(static_cast(res))); - } -} - -int32_t SecCompManager::RegisterSecurityComponent(SecCompType type, - const nlohmann::json& jsonComponent, const SecCompCallerInfo& caller, int32_t& scId) -{ - DelayExitTask::GetInstance().Stop(); - SC_LOG_DEBUG(LABEL, "PID: %{public}d, register security component", caller.pid); - if (IsInMaliciousAppList(caller.pid)) { - SC_LOG_ERROR(LABEL, "app is in MaliciousAppList, never allow it"); - return SC_ENHANCE_ERROR_IN_MALICIOUS_LIST; - } - - SecCompBase* componentPtr = SecCompInfoHelper::ParseComponent(type, jsonComponent); - std::shared_ptr component(componentPtr); - if (component == nullptr) { - SC_LOG_ERROR(LABEL, "Parse component info invalid"); - HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::SEC_COMPONENT, "COMPONENT_INFO_CHECK_FAILED", - HiviewDFX::HiSysEvent::EventType::SECURITY, "CALLER_UID", IPCSkeleton::GetCallingUid(), - "CALLER_PID", IPCSkeleton::GetCallingPid(), "SC_ID", scId, "CALL_SCENE", "REGITSTER", "SC_TYPE", type); - return SC_SERVICE_ERROR_COMPONENT_INFO_INVALID; - } - - int32_t enhanceRes = - SecCompEnhanceAdapter::CheckComponentInfoEnhnace(caller.pid, component, jsonComponent); - if (enhanceRes != SC_OK) { - SendCheckInfoEnhanceSysEvent(INVALID_SC_ID, type, "REGISTER", enhanceRes); - SC_LOG_ERROR(LABEL, "enhance check failed"); - AddAppToMaliciousAppList(caller.pid); - return enhanceRes; - } - - int32_t registerId = CreateScId(); - SecCompEntity entity(component, caller.tokenId, registerId); - int32_t ret = AddSecurityComponentToList(caller.pid, entity); - if (ret == SC_OK) { - scId = registerId; - } else { - SC_LOG_ERROR(LABEL, "Register security component failed"); - scId = INVALID_SC_ID; - } - return ret; -} - -int32_t SecCompManager::UpdateSecurityComponent(int32_t scId, const nlohmann::json& jsonComponent, - const SecCompCallerInfo& caller) -{ - SC_LOG_DEBUG(LABEL, "PID: %{public}d, update security component", caller.pid); - if (IsInMaliciousAppList(caller.pid)) { - SC_LOG_ERROR(LABEL, "app is in MaliciousAppList, never allow it"); - return SC_ENHANCE_ERROR_IN_MALICIOUS_LIST; - } - - OHOS::Utils::UniqueWriteGuard lk(this->componentInfoLock_); - SecCompEntity* sc = GetSecurityComponentFromList(caller.pid, scId); - if (sc == nullptr) { - SC_LOG_ERROR(LABEL, "Can not find target component"); - return SC_SERVICE_ERROR_COMPONENT_NOT_EXIST; - } - SecCompBase* report = SecCompInfoHelper::ParseComponent(sc->GetType(), jsonComponent); - std::shared_ptr reportComponentInfo(report); - if (reportComponentInfo == nullptr) { - SC_LOG_ERROR(LABEL, "Update component info invalid"); - HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::SEC_COMPONENT, "COMPONENT_INFO_CHECK_FAILED", - HiviewDFX::HiSysEvent::EventType::SECURITY, "CALLER_UID", IPCSkeleton::GetCallingUid(), - "CALLER_PID", IPCSkeleton::GetCallingPid(), "SC_ID", scId, "CALL_SCENE", "UPDATE", - "SC_TYPE", sc->GetType()); - return SC_SERVICE_ERROR_COMPONENT_INFO_INVALID; - } - - int32_t enhanceRes = - SecCompEnhanceAdapter::CheckComponentInfoEnhnace(caller.pid, reportComponentInfo, jsonComponent); - if (enhanceRes != SC_OK) { - SendCheckInfoEnhanceSysEvent(scId, sc->GetType(), "UPDATE", enhanceRes); - SC_LOG_ERROR(LABEL, "enhance check failed"); - AddAppToMaliciousAppList(caller.pid); - return enhanceRes; - } - - sc->SetComponentInfo(reportComponentInfo); - return SC_OK; -} - -int32_t SecCompManager::UnregisterSecurityComponent(int32_t scId, const SecCompCallerInfo& caller) -{ - SC_LOG_DEBUG(LABEL, "PID: %{public}d, unregister security component", caller.pid); - if (scId < 0) { - SC_LOG_ERROR(LABEL, "ScId is invalid"); - return SC_SERVICE_ERROR_VALUE_INVALID; - } - return DeleteSecurityComponentFromList(caller.pid, scId); -} - -int32_t SecCompManager::CheckClickSecurityComponentInfo(SecCompEntity* sc, int32_t scId, - const nlohmann::json& jsonComponent, const SecCompCallerInfo& caller) -{ - SC_LOG_DEBUG(LABEL, "PID: %{public}d, Check security component", caller.pid); - SecCompBase* report = SecCompInfoHelper::ParseComponent(sc->GetType(), jsonComponent); - std::shared_ptr reportComponentInfo(report); - if ((reportComponentInfo == nullptr) || (!reportComponentInfo->GetValid())) { - SC_LOG_ERROR(LABEL, "report component info invalid"); - HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::SEC_COMPONENT, "COMPONENT_INFO_CHECK_FAILED", - HiviewDFX::HiSysEvent::EventType::SECURITY, "CALLER_UID", IPCSkeleton::GetCallingUid(), - "CALLER_PID", IPCSkeleton::GetCallingPid(), "SC_ID", scId, "CALL_SCENE", "CLICK", "SC_TYPE", - sc->GetType()); - return SC_SERVICE_ERROR_COMPONENT_INFO_INVALID; - } - if ((!SecCompInfoHelper::CheckRectValid(reportComponentInfo->rect_, reportComponentInfo->windowRect_))) { - SC_LOG_ERROR(LABEL, "compare component info failed."); - HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::SEC_COMPONENT, "COMPONENT_INFO_CHECK_FAILED", - HiviewDFX::HiSysEvent::EventType::SECURITY, "CALLER_UID", IPCSkeleton::GetCallingUid(), - "CALLER_PID", IPCSkeleton::GetCallingPid(), "SC_ID", scId, "CALL_SCENE", "CLICK", "SC_TYPE", - sc->GetType()); - return SC_SERVICE_ERROR_COMPONENT_INFO_INVALID; - } - int32_t enhanceRes = - SecCompEnhanceAdapter::CheckComponentInfoEnhnace(caller.pid, reportComponentInfo, jsonComponent); - if (enhanceRes != SC_OK) { - SendCheckInfoEnhanceSysEvent(scId, sc->GetType(), "CLICK", enhanceRes); - SC_LOG_ERROR(LABEL, "enhance check failed"); - AddAppToMaliciousAppList(caller.pid); - return enhanceRes; - } - - sc->SetComponentInfo(reportComponentInfo); - return SC_OK; -} - -int32_t SecCompManager::ReportSecurityComponentClickEvent(int32_t scId, - const nlohmann::json& jsonComponent, const SecCompCallerInfo& caller, - const SecCompClickEvent& touchInfo, sptr callerToken) -{ - if (IsInMaliciousAppList(caller.pid)) { - SC_LOG_ERROR(LABEL, "app is in MaliciousAppList, never allow it"); - return SC_ENHANCE_ERROR_IN_MALICIOUS_LIST; - } - - OHOS::Utils::UniqueReadGuard lk(this->componentInfoLock_); - SecCompEntity* sc = GetSecurityComponentFromList(caller.pid, scId); - if (sc == nullptr) { - SC_LOG_ERROR(LABEL, "Can not find target component"); - return SC_SERVICE_ERROR_COMPONENT_NOT_EXIST; - } - - int32_t res = CheckClickSecurityComponentInfo(sc, scId, jsonComponent, caller); - if (res != SC_OK) { - return res; - } - - if (!sc->CheckTouchInfo(touchInfo)) { - HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::SEC_COMPONENT, "CLICK_INFO_CHECK_FAILED", - HiviewDFX::HiSysEvent::EventType::SECURITY, "CALLER_UID", IPCSkeleton::GetCallingUid(), - "CALLER_PID", IPCSkeleton::GetCallingPid(), "SC_ID", scId, "SC_TYPE", sc->GetType()); - AddAppToMaliciousAppList(caller.pid); - return SC_SERVICE_ERROR_CLICK_EVENT_INVALID; - } - res = sc->GrantTempPermission(); - if (res != SC_OK) { - HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::SEC_COMPONENT, "TEMP_GRANT_FAILED", - HiviewDFX::HiSysEvent::EventType::FAULT, "CALLER_UID", IPCSkeleton::GetCallingUid(), - "CALLER_PID", IPCSkeleton::GetCallingPid(), "SC_ID", scId, "SC_TYPE", sc->GetType()); - return res; - } - HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::SEC_COMPONENT, "TEMP_GRANT_SUCCESS", - HiviewDFX::HiSysEvent::EventType::BEHAVIOR, "CALLER_UID", IPCSkeleton::GetCallingUid(), - "CALLER_PID", IPCSkeleton::GetCallingPid(), "SC_ID", scId, "SC_TYPE", sc->GetType()); - firstUseDialog_.NotifyFirstUseDialog(caller.tokenId, sc->GetType(), callerToken); - return res; -} - -bool SecCompManager::ReduceAfterVerifySavePermission(AccessToken::AccessTokenID tokenId) -{ - if (SecCompPermManager::GetInstance().RevokeTempSavePermission(tokenId) == SC_OK) { - return true; - } - return false; -} - -void SecCompManager::DumpSecComp(std::string& dumpStr) -{ - OHOS::Utils::UniqueReadGuard lk(this->componentInfoLock_); - for (auto iter = componentMap_.begin(); iter != componentMap_.end(); ++iter) { - dumpStr.append("pid:" + std::to_string(iter->first) + "\n"); - for (auto compIter = iter->second.compList.begin(); compIter != iter->second.compList.end(); compIter ++) { - nlohmann::json json; - compIter->GetComponentInfo()->ToJson(json); - dumpStr.append(" scId:" + std::to_string(compIter->GetScId()) + - ", isGrant:" + std::to_string(compIter->IsGrant()) + ", " + json.dump() + "\n"); - } - } -} - -bool SecCompManager::Initialize() -{ - SC_LOG_DEBUG(LABEL, "Initialize!!"); - SecCompEnhanceAdapter::StartEnhanceService(); - - secRunner_ = AppExecFwk::EventRunner::Create(true); - if (!secRunner_) { - SC_LOG_ERROR(LABEL, "failed to create a recvRunner."); - return false; - } - - secHandler_ = std::make_shared(secRunner_); - DelayExitTask::GetInstance().Init(secHandler_); - firstUseDialog_.Init(secHandler_); - - return SecCompPermManager::GetInstance().InitEventHandler(secHandler_); -} -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS diff --git a/services/security_component_service/sa/sa_main/sec_comp_manager.h b/services/security_component_service/sa/sa_main/sec_comp_manager.h deleted file mode 100644 index 3c0848c..0000000 --- a/services/security_component_service/sa/sa_main/sec_comp_manager.h +++ /dev/null @@ -1,101 +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. - */ -#ifndef SECURITY_COMPONENT_MANAGER_H -#define SECURITY_COMPONENT_MANAGER_H - -#include -#include -#include -#include -#include -#include "accesstoken_kit.h" -#include "app_state_observer.h" -#include "first_use_dialog.h" -#include "nocopyable.h" -#include "rwlock.h" -#include "sec_comp_base.h" -#include "sec_comp_entity.h" -#include "sec_comp_info.h" -#include "sec_event_handler.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -struct SecCompCallerInfo { - AccessToken::AccessTokenID tokenId; - int32_t uid; - int32_t pid; -}; - -struct ProcessCompInfos { - std::vector compList; - bool isForeground = false; -}; - -class SecCompManager { -public: - static SecCompManager& GetInstance(); - virtual ~SecCompManager() = default; - - int32_t RegisterSecurityComponent(SecCompType type, const nlohmann::json& jsonComponent, - const SecCompCallerInfo& caller, int32_t& scId); - int32_t UpdateSecurityComponent(int32_t scId, const nlohmann::json& jsonComponent, - const SecCompCallerInfo& caller); - int32_t UnregisterSecurityComponent(int32_t scId, const SecCompCallerInfo& caller); - int32_t ReportSecurityComponentClickEvent(int32_t scId, const nlohmann::json& jsonComponent, - const SecCompCallerInfo& caller, const SecCompClickEvent& touchInfo, sptr callerToken); - bool ReduceAfterVerifySavePermission(AccessToken::AccessTokenID tokenId); - void NotifyProcessForeground(int32_t pid); - void NotifyProcessBackground(int32_t pid); - void NotifyProcessDied(int32_t pid); - void DumpSecComp(std::string& dumpStr); - bool Initialize(); - void ExitSaProcess(); - void ExitWhenAppMgrDied(); - -private: - SecCompManager(); - bool IsForegroundCompExist(); - int32_t AddSecurityComponentToList(int32_t pid, const SecCompEntity& newEntity); - int32_t DeleteSecurityComponentFromList(int32_t pid, int32_t scId); - SecCompEntity* GetSecurityComponentFromList(int32_t pid, int32_t scId); - int32_t CheckClickSecurityComponentInfo(SecCompEntity* sc, int32_t scId, - const nlohmann::json& jsonComponent, const SecCompCallerInfo& caller); - bool IsInMaliciousAppList(int32_t pid); - void AddAppToMaliciousAppList(int32_t pid); - void RemoveAppFromMaliciousAppList(int32_t pid); - bool IsMaliciousAppListEmpty(); - void SendCheckInfoEnhanceSysEvent(int32_t scId, - SecCompType type, const std::string& scene, int32_t res); - int32_t CreateScId(); - - OHOS::Utils::RWLock componentInfoLock_; - std::mutex scIdMtx_; - std::unordered_map componentMap_; - int32_t scIdStart_; - bool isSaExit_ = false; - - std::shared_ptr secRunner_; - std::shared_ptr secHandler_; - std::set maliciousAppList_; // pid set - std::mutex maliciousMtx_; - FirstUseDialog firstUseDialog_; - - DISALLOW_COPY_AND_MOVE(SecCompManager); -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // SECURITY_COMPONENT_MANAGER_H diff --git a/services/security_component_service/sa/sa_main/sec_comp_perm_manager.cpp b/services/security_component_service/sa/sa_main/sec_comp_perm_manager.cpp deleted file mode 100644 index 23f9d1a..0000000 --- a/services/security_component_service/sa/sa_main/sec_comp_perm_manager.cpp +++ /dev/null @@ -1,130 +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 "sec_comp_perm_manager.h" - -#include "location_button.h" -#include "paste_button.h" -#include "save_button.h" -#include "sec_comp_err.h" -#include "sec_comp_log.h" -#include "sec_comp_service.h" -#include "sec_comp_tool.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -namespace { -constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompPermManager"}; -static const int32_t WAIT_MILLISECONDS = 5 * 1000; -} - -SecCompPermManager& SecCompPermManager::GetInstance() -{ - static SecCompPermManager instance; - return instance; -} - -bool SecCompPermManager::DelayRevokePermission(AccessToken::AccessTokenID tokenId, const std::string& taskName) -{ - if (secHandler_ == nullptr) { - SC_LOG_ERROR(LABEL, "fail to get EventHandler"); - return false; - } - - std::function delayed = ([tokenId]() { - SC_LOG_DEBUG(LABEL, "delay revoke save permission"); - SecCompPermManager::GetInstance().RevokeTempSavePermission(tokenId); - }); - - SC_LOG_DEBUG(LABEL, "revoke save permission after %{public}d ms", WAIT_MILLISECONDS); - secHandler_->ProxyPostTask(delayed, taskName, WAIT_MILLISECONDS); - return true; -} - -bool SecCompPermManager::RevokeSavePermissionTask(const std::string& taskName) -{ - if (secHandler_ == nullptr) { - SC_LOG_ERROR(LABEL, "fail to get EventHandler"); - return false; - } - - SC_LOG_DEBUG(LABEL, "revoke save permission task name:%{public}s", taskName.c_str()); - secHandler_->ProxyRemoveTask(taskName); - return true; -} - -int32_t SecCompPermManager::GrantLocationPermission(AccessToken::AccessTokenID tokenId, - const std::string& permissionName, int flag) -{ - int32_t res = AccessToken::AccessTokenKit::GrantPermission(tokenId, permissionName, - AccessToken::PermissionFlag::PERMISSION_COMPONENT_SET); - SC_LOG_INFO(LABEL, "grant permission: %{public}s, tokenId:%{public}d", permissionName.c_str(), tokenId); - return res; -} - -int32_t SecCompPermManager::RevokeLocationPermission(AccessToken::AccessTokenID tokenId, - const std::string& permissionName, int flag) -{ - int32_t res = AccessToken::AccessTokenKit::RevokePermission(tokenId, permissionName, - AccessToken::PermissionFlag::PERMISSION_COMPONENT_SET); - SC_LOG_INFO(LABEL, "revoke permission: %{public}s, tokenId:%{public}d", permissionName.c_str(), tokenId); - return res; -} - -int32_t SecCompPermManager::GrantTempSavePermission(AccessToken::AccessTokenID tokenId) -{ - auto current = static_cast(std::chrono::high_resolution_clock::now().time_since_epoch().count()); - std::string taskName = std::to_string(tokenId) + std::to_string(current); - if (!DelayRevokePermission(tokenId, taskName)) { - return SC_SERVICE_ERROR_PERMISSION_OPER_FAIL; - } - std::lock_guard lock(mutex_); - taskQue_.push_back(taskName); - applySaveCountMap_[tokenId]++; - SC_LOG_DEBUG(LABEL, "tokenId: %{public}d current permission apply counts is: %{public}d.", - tokenId, applySaveCountMap_[tokenId]); - return SC_OK; -} - -int32_t SecCompPermManager::RevokeTempSavePermission(AccessToken::AccessTokenID tokenId) -{ - std::lock_guard lock(mutex_); - auto iter = applySaveCountMap_.find(tokenId); - if (iter == applySaveCountMap_.end() || applySaveCountMap_[tokenId] == 0) { - SC_LOG_ERROR(LABEL, "This hap has no permissions to save files."); - return SC_SERVICE_ERROR_PERMISSION_OPER_FAIL; - } - std::string taskName = taskQue_.front(); - if (!RevokeSavePermissionTask(taskName)) { - return false; - } - taskQue_.pop_front(); - SC_LOG_DEBUG(LABEL, "tokenId: %{public}d current permission apply counts is: %{public}d.", - tokenId, applySaveCountMap_[tokenId]); - if ((--applySaveCountMap_[tokenId]) == 0) { - applySaveCountMap_.erase(tokenId); - } - return SC_OK; -} - -bool SecCompPermManager::InitEventHandler(const std::shared_ptr& secHandler) -{ - secHandler_ = secHandler; - return true; -} - -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS diff --git a/services/security_component_service/sa/sa_main/sec_comp_perm_manager.h b/services/security_component_service/sa/sa_main/sec_comp_perm_manager.h deleted file mode 100644 index 0cd7f76..0000000 --- a/services/security_component_service/sa/sa_main/sec_comp_perm_manager.h +++ /dev/null @@ -1,57 +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. - */ -#ifndef SECURITY_COMPONENT_PERMISSION_MANAGER_H -#define SECURITY_COMPONENT_PERMISSION_MANAGER_H - -#include -#include -#include "accesstoken_kit.h" -#include "rwlock.h" -#include "sec_comp_base.h" -#include "sec_event_handler.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -class SecCompPermManager { -public: - SecCompPermManager() = default; - virtual ~SecCompPermManager() = default; - static SecCompPermManager& GetInstance(); - - int32_t GrantLocationPermission(AccessToken::AccessTokenID tokenId, - const std::string& permissionName, int flag); - int32_t RevokeLocationPermission(AccessToken::AccessTokenID tokenId, - const std::string& permissionName, int flag); - - int32_t GrantTempSavePermission(AccessToken::AccessTokenID tokenId); - int32_t RevokeTempSavePermission(AccessToken::AccessTokenID tokenId); - - bool InitEventHandler(const std::shared_ptr& secHandler); - std::shared_ptr GetSecEventHandler() const; - -private: - bool DelayRevokePermission(AccessToken::AccessTokenID tokenId, const std::string& taskName); - bool RevokeSavePermissionTask(const std::string& taskName); - - std::unordered_map applySaveCountMap_; - std::deque taskQue_; - std::mutex mutex_; - std::shared_ptr secHandler_; -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // SECURITY_COMPONENT_PERMISSION_MANAGER_H diff --git a/services/security_component_service/sa/sa_main/sec_comp_service.cpp b/services/security_component_service/sa/sa_main/sec_comp_service.cpp deleted file mode 100644 index 40aad2d..0000000 --- a/services/security_component_service/sa/sa_main/sec_comp_service.cpp +++ /dev/null @@ -1,284 +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 "sec_comp_service.h" - -#include - -#include "app_mgr_death_recipient.h" -#include "hisysevent.h" -#include "hitrace_meter.h" -#include "ipc_skeleton.h" -#include "iservice_registry.h" -#include "sec_comp_enhance_adapter.h" -#include "sec_comp_err.h" -#include "sec_comp_manager.h" -#include "sec_comp_log.h" -#include "system_ability_definition.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -namespace { -constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompService"}; -static const int32_t ROOT_UID = 0; -} - -REGISTER_SYSTEM_ABILITY_BY_ID(SecCompService, SA_ID_SECURITY_COMPONENT_SERVICE, true); - -SecCompService::SecCompService(int32_t saId, bool runOnCreate) - : SystemAbility(saId, runOnCreate), state_(ServiceRunningState::STATE_NOT_START) -{ -} - -SecCompService::~SecCompService() -{ -} - -void SecCompService::OnStart() -{ - StartTrace(HITRACE_TAG_ACCESS_CONTROL, "SecurityComponentOnStart"); - if (state_ == ServiceRunningState::STATE_RUNNING) { - SC_LOG_INFO(LABEL, "SecCompService has already started!"); - FinishTrace(HITRACE_TAG_ACCESS_CONTROL); - return; - } - SC_LOG_INFO(LABEL, "SecCompService is starting"); - if (!RegisterAppStateObserver()) { - SC_LOG_ERROR(LABEL, "Failed to register app state observer!"); - FinishTrace(HITRACE_TAG_ACCESS_CONTROL); - return; - } - if (!Initialize()) { - SC_LOG_ERROR(LABEL, "Failed to initialize"); - FinishTrace(HITRACE_TAG_ACCESS_CONTROL); - return; - } - - state_ = ServiceRunningState::STATE_RUNNING; - bool ret = Publish(this); - if (!ret) { - SC_LOG_ERROR(LABEL, "Failed to publish service!"); - FinishTrace(HITRACE_TAG_ACCESS_CONTROL); - return; - } - HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::SEC_COMPONENT, "SERVICE_INIT_SUCCESS", - HiviewDFX::HiSysEvent::EventType::BEHAVIOR, "PID", getpid()); - SC_LOG_INFO(LABEL, "Congratulations, SecCompService start successfully!"); - FinishTrace(HITRACE_TAG_ACCESS_CONTROL); -} - -void SecCompService::OnStop() -{ - SC_LOG_INFO(LABEL, "Stop service"); - state_ = ServiceRunningState::STATE_NOT_START; - UnregisterAppStateObserver(); - iAppMgr_ = nullptr; - appStateObserver_ = nullptr; -} - -bool SecCompService::RegisterAppStateObserver() -{ - if (appStateObserver_ != nullptr) { - SC_LOG_INFO(LABEL, "AppStateObserver instance already create"); - return true; - } - appStateObserver_ = new (std::nothrow) AppStateObserver(); - if (appStateObserver_ == nullptr) { - SC_LOG_ERROR(LABEL, "Failed to create AppStateObserver instance"); - return false; - } - sptr samgrClient = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); - if (samgrClient == nullptr) { - SC_LOG_ERROR(LABEL, "Failed to get system ability manager"); - appStateObserver_ = nullptr; - return false; - } - auto remoteObject = samgrClient->GetSystemAbility(APP_MGR_SERVICE_ID); - iAppMgr_ = iface_cast(remoteObject); - if (iAppMgr_ == nullptr) { - SC_LOG_ERROR(LABEL, "Failed to get ability manager service"); - appStateObserver_ = nullptr; - return false; - } - - if (iAppMgr_->RegisterApplicationStateObserver(appStateObserver_) != ERR_OK) { - SC_LOG_ERROR(LABEL, "Failed to Register app state observer"); - iAppMgr_ = nullptr; - appStateObserver_ = nullptr; - return false; - } - - sptr appMgrDeathRecipient = new (std::nothrow) AppMgrDeathRecipient(); - if (appMgrDeathRecipient == nullptr) { - SC_LOG_ERROR(LABEL, "Alloc appMgr death observer fail"); - return false; - } - - if (!remoteObject->AddDeathRecipient(appMgrDeathRecipient)) { - SC_LOG_ERROR(LABEL, "Add service death observer fail"); - return false; - } - - std::vector list; - if (iAppMgr_->GetForegroundApplications(list) == ERR_OK) { - for (auto it = list.begin(); it != list.end(); ++it) { - appStateObserver_->AddProcessToForegroundSet(*it); - } - } - SC_LOG_ERROR(LABEL, "Register app state observer success"); - return true; -} - -void SecCompService::UnregisterAppStateObserver() -{ - if (iAppMgr_ != nullptr && appStateObserver_ != nullptr) { - iAppMgr_->UnregisterApplicationStateObserver(appStateObserver_); - } -} - -bool SecCompService::GetCallerInfo(SecCompCallerInfo& caller) -{ - AccessToken::AccessTokenID tokenId = IPCSkeleton::GetCallingTokenID(); - int32_t pid = IPCSkeleton::GetCallingPid(); - int32_t uid = IPCSkeleton::GetCallingUid(); - if ((uid != ROOT_UID) && (AccessToken::AccessTokenKit::GetTokenTypeFlag(tokenId) != AccessToken::TOKEN_HAP)) { - SC_LOG_ERROR(LABEL, "Get caller tokenId invalid"); - return false; - } - if ((uid != ROOT_UID) && (!appStateObserver_->IsProcessForeground(pid, uid))) { - SC_LOG_ERROR(LABEL, "caller pid is not in foreground"); - return false; - } - caller.tokenId = tokenId; - caller.pid = pid; - caller.uid = uid; - return true; -} - -int32_t SecCompService::RegisterSecurityComponent(SecCompType type, - const std::string& componentInfo, int32_t& scId) -{ - StartTrace(HITRACE_TAG_ACCESS_CONTROL, "SecurityComponentRegister"); - SecCompCallerInfo caller; - if (!GetCallerInfo(caller)) { - SC_LOG_ERROR(LABEL, "Check caller failed"); - FinishTrace(HITRACE_TAG_ACCESS_CONTROL); - return SC_SERVICE_ERROR_VALUE_INVALID; - } - - nlohmann::json jsonRes = nlohmann::json::parse(componentInfo, nullptr, false); - if (jsonRes.is_discarded()) { - SC_LOG_ERROR(LABEL, "component info invalid %{public}s", componentInfo.c_str()); - FinishTrace(HITRACE_TAG_ACCESS_CONTROL); - return SC_SERVICE_ERROR_VALUE_INVALID; - } - - int32_t res = SecCompManager::GetInstance().RegisterSecurityComponent(type, jsonRes, caller, scId); - FinishTrace(HITRACE_TAG_ACCESS_CONTROL); - return res; -} - -int32_t SecCompService::UpdateSecurityComponent(int32_t scId, const std::string& componentInfo) -{ - SecCompCallerInfo caller; - if (!GetCallerInfo(caller)) { - SC_LOG_ERROR(LABEL, "Check caller failed"); - return SC_SERVICE_ERROR_VALUE_INVALID; - } - - nlohmann::json jsonRes = nlohmann::json::parse(componentInfo, nullptr, false); - if (jsonRes.is_discarded()) { - SC_LOG_ERROR(LABEL, "component info invalid %{public}s", componentInfo.c_str()); - return SC_SERVICE_ERROR_VALUE_INVALID; - } - return SecCompManager::GetInstance().UpdateSecurityComponent(scId, jsonRes, caller); -} - -int32_t SecCompService::UnregisterSecurityComponent(int32_t scId) -{ - SecCompCallerInfo caller; - if (!GetCallerInfo(caller)) { - SC_LOG_ERROR(LABEL, "Check caller failed"); - return SC_SERVICE_ERROR_VALUE_INVALID; - } - - return SecCompManager::GetInstance().UnregisterSecurityComponent(scId, caller); -} - -int32_t SecCompService::ReportSecurityComponentClickEvent(int32_t scId, - const std::string& componentInfo, const SecCompClickEvent& touchInfo, sptr callerToken) -{ - StartTrace(HITRACE_TAG_ACCESS_CONTROL, "SecurityComponentClick"); - SecCompCallerInfo caller; - if (!GetCallerInfo(caller)) { - SC_LOG_ERROR(LABEL, "Check caller failed"); - FinishTrace(HITRACE_TAG_ACCESS_CONTROL); - return SC_SERVICE_ERROR_VALUE_INVALID; - } - - nlohmann::json jsonRes = nlohmann::json::parse(componentInfo, nullptr, false); - if (jsonRes.is_discarded()) { - SC_LOG_ERROR(LABEL, "component info invalid %{public}s", componentInfo.c_str()); - FinishTrace(HITRACE_TAG_ACCESS_CONTROL); - return SC_SERVICE_ERROR_VALUE_INVALID; - } - int32_t res = - SecCompManager::GetInstance().ReportSecurityComponentClickEvent(scId, jsonRes, caller, touchInfo, callerToken); - FinishTrace(HITRACE_TAG_ACCESS_CONTROL); - return res; -} - -bool SecCompService::ReduceAfterVerifySavePermission(AccessToken::AccessTokenID tokenId) -{ - return SecCompManager::GetInstance().ReduceAfterVerifySavePermission(tokenId); -} - -sptr SecCompService::GetEnhanceRemoteObject() -{ - return SecCompEnhanceAdapter::GetEnhanceRemoteObject(); -} - -int SecCompService::Dump(int fd, const std::vector& args) -{ - if (fd < 0) { - return ERR_INVALID_VALUE; - } - - dprintf(fd, "SecCompService Dump:\n"); - std::string arg0 = ((args.size() == 0)? "" : Str16ToStr8(args.at(0))); - if (arg0.compare("-h") == 0) { - dprintf(fd, "Usage:\n"); - dprintf(fd, " -h: command help\n"); - dprintf(fd, " -a: dump all sec component\n"); - dprintf(fd, " -p: dump foreground processes\n"); - } else if (arg0.compare("-p") == 0) { - std::string dumpStr; - appStateObserver_->DumpProcess(dumpStr); - dprintf(fd, "%s\n", dumpStr.c_str()); - } else if (arg0.compare("-a") == 0 || arg0 == "") { - std::string dumpStr; - SecCompManager::GetInstance().DumpSecComp(dumpStr); - dprintf(fd, "%s\n", dumpStr.c_str()); - } - return ERR_OK; -} - -bool SecCompService::Initialize() const -{ - return SecCompManager::GetInstance().Initialize(); -} -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS diff --git a/services/security_component_service/sa/sa_main/sec_comp_service.h b/services/security_component_service/sa/sa_main/sec_comp_service.h deleted file mode 100644 index 99d21f2..0000000 --- a/services/security_component_service/sa/sa_main/sec_comp_service.h +++ /dev/null @@ -1,65 +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. - */ -#ifndef SECURITY_COMPONENT_SERVICE_H -#define SECURITY_COMPONENT_SERVICE_H - -#include -#include -#include "app_state_observer.h" -#include "iremote_object.h" -#include "nocopyable.h" -#include "sec_comp_manager.h" -#include "sec_comp_stub.h" -#include "singleton.h" -#include "system_ability.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -enum class ServiceRunningState { STATE_NOT_START, STATE_RUNNING }; -class SecCompService final : public SystemAbility, public SecCompStub { - DECLARE_DELAYED_SINGLETON(SecCompService); - DECLEAR_SYSTEM_ABILITY(SecCompService); - -public: - SecCompService(int32_t saId, bool runOnCreate); - - void OnStart() override; - void OnStop() override; - - int32_t RegisterSecurityComponent(SecCompType type, const std::string& componentInfo, int32_t& scId) override; - int32_t UpdateSecurityComponent(int32_t scId, const std::string& componentInfo) override; - int32_t UnregisterSecurityComponent(int32_t scId) override; - int32_t ReportSecurityComponentClickEvent(int32_t scId, - const std::string& componentInfo, const SecCompClickEvent& touchInfo, sptr callerToken) override; - bool ReduceAfterVerifySavePermission(AccessToken::AccessTokenID tokenId) override; - sptr GetEnhanceRemoteObject() override; - - int Dump(int fd, const std::vector& args) override; - -private: - bool Initialize() const; - bool RegisterAppStateObserver(); - void UnregisterAppStateObserver(); - bool GetCallerInfo(SecCompCallerInfo& caller); - - ServiceRunningState state_; - sptr iAppMgr_; - sptr appStateObserver_; -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // SECURITY_COMPONENT_SERVICE_H diff --git a/services/security_component_service/sa/sa_main/sec_comp_stub.cpp b/services/security_component_service/sa/sa_main/sec_comp_stub.cpp deleted file mode 100644 index c492afd..0000000 --- a/services/security_component_service/sa/sa_main/sec_comp_stub.cpp +++ /dev/null @@ -1,223 +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 "sec_comp_stub.h" - -#include "ipc_skeleton.h" -#include "sec_comp_click_event_parcel.h" -#include "sec_comp_err.h" -#include "sec_comp_log.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -namespace { -static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompStub"}; -} // namespace - -int32_t SecCompStub::OnRemoteRequest( - uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) -{ - std::u16string descripter = SecCompStub::GetDescriptor(); - std::u16string remoteDescripter = data.ReadInterfaceToken(); - if (descripter != remoteDescripter) { - SC_LOG_ERROR(LABEL, "Deal remote request fail, descriptor is not matched"); - return SC_SERVICE_ERROR_IPC_REQUEST_FAIL; - } - - auto itFunc = requestFuncMap_.find(code); - if (itFunc != requestFuncMap_.end()) { - auto requestFunc = itFunc->second; - if (requestFunc != nullptr) { - return (this->*requestFunc)(data, reply); - } - } - return IPCObjectStub::OnRemoteRequest(code, data, reply, option); -} - -int32_t SecCompStub::RegisterSecurityComponentInner(MessageParcel& data, MessageParcel& reply) -{ - uint32_t type; - if (!data.ReadUint32(type)) { - SC_LOG_ERROR(LABEL, "Read component type fail"); - return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; - } - - if (type <= UNKNOWN_SC_TYPE || type >= MAX_SC_TYPE) { - SC_LOG_ERROR(LABEL, "Security component type invalid"); - return SC_SERVICE_ERROR_VALUE_INVALID; - } - - std::string componentInfo; - if (!data.ReadString(componentInfo)) { - SC_LOG_ERROR(LABEL, "Read component info fail"); - return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; - } - - int32_t scId = INVALID_SC_ID; - int32_t res = this->RegisterSecurityComponent(static_cast(type), componentInfo, scId); - if (!reply.WriteInt32(res)) { - SC_LOG_ERROR(LABEL, "Register security component result fail"); - return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; - } - - if (!reply.WriteInt32(scId)) { - SC_LOG_ERROR(LABEL, "Register security component result fail"); - return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; - } - - return SC_OK; -} - -int32_t SecCompStub::UpdateSecurityComponentInner(MessageParcel& data, MessageParcel& reply) -{ - int32_t scId; - if (!data.ReadInt32(scId)) { - SC_LOG_ERROR(LABEL, "Read component id fail"); - return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; - } - - if (scId < 0) { - SC_LOG_ERROR(LABEL, "Security component id invalid"); - return SC_SERVICE_ERROR_VALUE_INVALID; - } - - std::string componentInfo; - if (!data.ReadString(componentInfo)) { - SC_LOG_ERROR(LABEL, "Read component info fail"); - return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; - } - - int32_t res = this->UpdateSecurityComponent(scId, componentInfo); - if (!reply.WriteInt32(res)) { - SC_LOG_ERROR(LABEL, "Update security component result fail"); - return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; - } - - return res; -} - -int32_t SecCompStub::UnregisterSecurityComponentInner(MessageParcel& data, MessageParcel& reply) -{ - int32_t scId; - if (!data.ReadInt32(scId)) { - SC_LOG_ERROR(LABEL, "Read component id fail"); - return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; - } - - if (scId < 0) { - SC_LOG_ERROR(LABEL, "Security component id invalid"); - return SC_SERVICE_ERROR_VALUE_INVALID; - } - - int32_t res = this->UnregisterSecurityComponent(scId); - if (!reply.WriteInt32(res)) { - SC_LOG_ERROR(LABEL, "Unregister security component result fail"); - return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; - } - return SC_OK; -} - -int32_t SecCompStub::ReportSecurityComponentClickEventInner(MessageParcel& data, MessageParcel& reply) -{ - int32_t scId; - if (!data.ReadInt32(scId)) { - SC_LOG_ERROR(LABEL, "Read component id fail"); - return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; - } - - if (scId < 0) { - SC_LOG_ERROR(LABEL, "Security component id invalid"); - return SC_SERVICE_ERROR_VALUE_INVALID; - } - - std::string componentInfo; - if (!data.ReadString(componentInfo)) { - SC_LOG_ERROR(LABEL, "Read component info fail"); - return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; - } - sptr touchInfoParcel = data.ReadParcelable(); - if (touchInfoParcel == nullptr) { - SC_LOG_ERROR(LABEL, "Read touchInfo info fail"); - return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; - } - - sptr callerToken = data.ReadRemoteObject(); - int32_t res = - this->ReportSecurityComponentClickEvent(scId, componentInfo, touchInfoParcel->touchInfoParams_, callerToken); - if (!reply.WriteInt32(res)) { - SC_LOG_ERROR(LABEL, "Register security component result fail"); - return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; - } - return SC_OK; -} - -int32_t SecCompStub::ReduceAfterVerifySavePermissionInner(MessageParcel& data, MessageParcel& reply) -{ - uint32_t tokenId; - if (!data.ReadUint32(tokenId)) { - SC_LOG_ERROR(LABEL, "Read component id fail"); - return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; - } - - if (tokenId == 0) { - SC_LOG_ERROR(LABEL, "AccessTokenId invalid"); - return SC_SERVICE_ERROR_VALUE_INVALID; - } - - bool res = this->ReduceAfterVerifySavePermission(tokenId); - if (!reply.WriteBool(res)) { - SC_LOG_ERROR(LABEL, "verify temp save permission result fail"); - return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; - } - return SC_OK; -} - -int32_t SecCompStub::GetEnhanceRemoteObjectInner(MessageParcel& data, MessageParcel& reply) -{ - auto res = this->GetEnhanceRemoteObject(); - if (!reply.WriteRemoteObject(res)) { - SC_LOG_ERROR(LABEL, "Register security component enhance remote object fail"); - return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; - } - return SC_OK; -} - -SecCompStub::SecCompStub() -{ - requestFuncMap_[static_cast(SecurityComponentServiceInterfaceCode::REGISTER_SECURITY_COMPONENT)] = - &SecCompStub::RegisterSecurityComponentInner; - requestFuncMap_[static_cast(SecurityComponentServiceInterfaceCode::UPDATE_SECURITY_COMPONENT)] = - &SecCompStub::UpdateSecurityComponentInner; - requestFuncMap_[static_cast(SecurityComponentServiceInterfaceCode::UNREGISTER_SECURITY_COMPONENT)] = - &SecCompStub::UnregisterSecurityComponentInner; - requestFuncMap_[static_cast( - SecurityComponentServiceInterfaceCode::REPORT_SECURITY_COMPONENT_CLICK_EVENT)] = - &SecCompStub::ReportSecurityComponentClickEventInner; - requestFuncMap_[static_cast(SecurityComponentServiceInterfaceCode::VERIFY_TEMP_SAVE_PERMISSION)] = - &SecCompStub::ReduceAfterVerifySavePermissionInner; - requestFuncMap_[static_cast( - SecurityComponentServiceInterfaceCode::GET_SECURITY_COMPONENT_ENHANCE_OBJECT)] = - &SecCompStub::GetEnhanceRemoteObjectInner; -} - -SecCompStub::~SecCompStub() -{ - SC_LOG_ERROR(LABEL, "~SecCompStub"); - requestFuncMap_.clear(); - SC_LOG_ERROR(LABEL, "~SecCompStub end"); -} -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS diff --git a/services/security_component_service/sa/sa_main/sec_comp_stub.h b/services/security_component_service/sa/sa_main/sec_comp_stub.h deleted file mode 100644 index c435876..0000000 --- a/services/security_component_service/sa/sa_main/sec_comp_stub.h +++ /dev/null @@ -1,47 +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. - */ -#ifndef SECURITY_COMPONENT_STUB_H -#define SECURITY_COMPONENT_STUB_H - -#include -#include "i_sec_comp_service.h" -#include "iremote_stub.h" -#include "nocopyable.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -class SecCompStub : public IRemoteStub { -public: - SecCompStub(); - virtual ~SecCompStub(); - - int OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) override; - -private: - int32_t RegisterSecurityComponentInner(MessageParcel& data, MessageParcel& reply); - int32_t UpdateSecurityComponentInner(MessageParcel& data, MessageParcel& reply); - int32_t UnregisterSecurityComponentInner(MessageParcel& data, MessageParcel& reply); - int32_t ReportSecurityComponentClickEventInner(MessageParcel& data, MessageParcel& reply); - int32_t ReduceAfterVerifySavePermissionInner(MessageParcel& data, MessageParcel& reply); - int32_t GetEnhanceRemoteObjectInner(MessageParcel& data, MessageParcel& reply); - - using RequestFuncType = int32_t (SecCompStub::*)(MessageParcel& data, MessageParcel& reply); - std::map requestFuncMap_; -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // SECURITY_COMPONENT_STUB_H diff --git a/services/security_component_service/sa/sa_main/sec_event_handler.cpp b/services/security_component_service/sa/sa_main/sec_event_handler.cpp deleted file mode 100644 index 32e3d8b..0000000 --- a/services/security_component_service/sa/sa_main/sec_event_handler.cpp +++ /dev/null @@ -1,40 +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 "sec_event_handler.h" - -#include "sec_comp_log.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -SecEventHandler::SecEventHandler( - const std::shared_ptr& runner) - : AppExecFwk::EventHandler(runner) {} - -SecEventHandler::~SecEventHandler() = default; - -bool SecEventHandler::ProxyPostTask( - const Callback &callback, const std::string &name, int64_t delayTime) -{ - return AppExecFwk::EventHandler::PostTask(callback, name, delayTime); -} - -void SecEventHandler::ProxyRemoveTask(const std::string &name) -{ - AppExecFwk::EventHandler::RemoveTask(name); -} -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS \ No newline at end of file diff --git a/services/security_component_service/sa/sa_main/sec_event_handler.h b/services/security_component_service/sa/sa_main/sec_event_handler.h deleted file mode 100644 index 86b0734..0000000 --- a/services/security_component_service/sa/sa_main/sec_event_handler.h +++ /dev/null @@ -1,37 +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. - */ -#ifndef SEC_EVENT_HANDLER_H -#define SEC_EVENT_HANDLER_H - -#include -#include "event_handler.h" -#include "event_runner.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -class SecEventHandler : public AppExecFwk::EventHandler { -public: - explicit SecEventHandler(const std::shared_ptr& runner); - ~SecEventHandler() override; - - bool ProxyPostTask(const Callback &callback, const std::string &name = std::string(), int64_t delayTime = 0); - - void ProxyRemoveTask(const std::string &name); -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // SEC_EVENT_HANDLER_H diff --git a/services/security_component_service/sa/sa_profile/3506.json b/services/security_component_service/sa/sa_profile/3506.json deleted file mode 100644 index 83650d4..0000000 --- a/services/security_component_service/sa/sa_profile/3506.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "process": "security_component_service", - "systemability": [ - { - "name": 3506, - "libpath": "libsecurity_component_service.z.so", - "run-on-create": false, - "distributed": false, - "dump_level": 1 - } - ] -} \ No newline at end of file diff --git a/services/security_component_service/sa/sa_profile/BUILD.gn b/services/security_component_service/sa/sa_profile/BUILD.gn deleted file mode 100644 index dc0c6d9..0000000 --- a/services/security_component_service/sa/sa_profile/BUILD.gn +++ /dev/null @@ -1,19 +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("//build/ohos/sa_profile/sa_profile.gni") - -ohos_sa_profile("security_component_sa_profile_standard") { - sources = [ "3506.json" ] - part_name = "security_component" -} diff --git a/services/security_component_service/sa/security_component_service.cfg b/services/security_component_service/sa/security_component_service.cfg deleted file mode 100644 index 009ac03..0000000 --- a/services/security_component_service/sa/security_component_service.cfg +++ /dev/null @@ -1,24 +0,0 @@ -{ - "jobs" : [{ - "name" : "post-fs-data", - "cmds" : [ - "mkdir /data/service/el1/public/security_component_service 0750 security_component security_component" - ] - } - ], - "services" : [{ - "name" : "security_component_service", - "path" : ["/system/bin/sa_main", "/system/profile/security_component_service.json"], - "ondemand" : true, - "start-mode" : "condition", - "uid" : "security_component", - "gid" : ["security_component"], - "apl" : "system_basic", - "permission" : [ - "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", - "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS" - ], - "secon" : "u:r:security_component_service:s0" - } - ] -} diff --git a/services/security_component_service/sa/security_component_service.rc b/services/security_component_service/sa/security_component_service.rc deleted file mode 100644 index 68b6fbc..0000000 --- a/services/security_component_service/sa/security_component_service.rc +++ /dev/null @@ -1,19 +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. - -service security_component_service /system/bin/sa_main /system/profile/security_component.json - class security_component_service - priority -20 - user security_component - group security_component - seclabel u:r:security_component_service:s0 diff --git a/services/security_component_service/sa/test/BUILD.gn b/services/security_component_service/sa/test/BUILD.gn deleted file mode 100644 index 04537f3..0000000 --- a/services/security_component_service/sa/test/BUILD.gn +++ /dev/null @@ -1,145 +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("//build/test.gni") - -sec_comp_root_dir = "../../../.." - -ohos_unittest("sec_comp_service_test") { - subsystem_name = "security" - part_name = "security_component" - module_out_path = part_name + "/" + part_name - - include_dirs = [ - "${sec_comp_root_dir}/frameworks/common/include", - "${sec_comp_root_dir}/frameworks/enhance_adapter/include", - "${sec_comp_root_dir}/frameworks/security_component/include", - "${sec_comp_root_dir}/interfaces/inner_api/security_component/include", - "${sec_comp_root_dir}/services/security_component_service/sa/sa_main", - "${sec_comp_root_dir}/services/security_component_service/sa/test/mock/include", - "//third_party/json/include", - ] - - sources = [ - "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/app_mgr_death_recipient.cpp", - "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/app_state_observer.cpp", - "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/delay_exit_task.cpp", - "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/first_use_dialog.cpp", - "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/sec_comp_entity.cpp", - "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/sec_comp_perm_manager.cpp", - "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/sec_comp_info_helper.cpp", - "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/sec_comp_manager.cpp", - "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/sec_comp_service.cpp", - "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/sec_comp_stub.cpp", - "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/sec_event_handler.cpp", - "${sec_comp_root_dir}/services/security_component_service/sa/test/mock/src/mock_app_mgr_proxy.cpp", - "${sec_comp_root_dir}/services/security_component_service/sa/test/mock/src/mock_iservice_registry.cpp", - "unittest/src/app_state_observer_test.cpp", - "unittest/src/sec_comp_entity_test.cpp", - "unittest/src/sec_comp_info_helper_test.cpp", - "unittest/src/sec_comp_manager_test.cpp", - "unittest/src/sec_comp_service_test.cpp", - "unittest/src/sec_comp_stub_test.cpp", - ] - - configs = [ "${sec_comp_root_dir}/config:coverage_flags" ] - cflags_cc = [ "-DHILOG_ENABLE" ] - - deps = [ - "${sec_comp_root_dir}/frameworks:libsecurity_component_enhance_adapter", - "${sec_comp_root_dir}/frameworks:libsecurity_component_framework", - "//third_party/googletest:gmock_main", - ] - - external_deps = [ - "ability_base:base", - "ability_base:want", - "ability_runtime:ability_manager", - "ability_runtime:runtime", - "access_token:libtoken_setproc", - "c_utils:utils", - "eventhandler:libeventhandler", - "graphic_2d:librender_service_client", - "hilog:libhilog", - "hisysevent:libhisysevent", - "hitrace:hitrace_meter", - "ipc:ipc_core", - "window_manager:libdm", - ] -} - -ohos_unittest("sec_comp_service_mock_test") { - subsystem_name = "security" - part_name = "security_component" - module_out_path = part_name + "/" + part_name - - include_dirs = [ - "${sec_comp_root_dir}/frameworks/common/include", - "${sec_comp_root_dir}/frameworks/security_component/include", - "${sec_comp_root_dir}/frameworks/enhance_adapter/include", - "${sec_comp_root_dir}/interfaces/inner_api/security_component/include", - "${sec_comp_root_dir}/services/security_component_service/sa/sa_main", - "${sec_comp_root_dir}/services/security_component_service/sa/test/mock/include", - "//third_party/json/include", - ] - - sources = [ - "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/app_mgr_death_recipient.cpp", - "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/app_state_observer.cpp", - "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/delay_exit_task.cpp", - "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/first_use_dialog.cpp", - "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/sec_comp_entity.cpp", - "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/sec_comp_perm_manager.cpp", - "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/sec_comp_info_helper.cpp", - "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/sec_comp_manager.cpp", - "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/sec_comp_service.cpp", - "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/sec_comp_stub.cpp", - "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/sec_event_handler.cpp", - "${sec_comp_root_dir}/services/security_component_service/sa/test/mock/src/mock_app_mgr_proxy.cpp", - "${sec_comp_root_dir}/services/security_component_service/sa/test/mock/src/mock_iservice_registry.cpp", - "${sec_comp_root_dir}/services/security_component_service/sa/test/mock/src/sec_comp_enhance_adapter.cpp", - "unittest/src/sec_comp_service_mock_test.cpp", - ] - - configs = [ "${sec_comp_root_dir}/config:coverage_flags" ] - cflags_cc = [ "-DHILOG_ENABLE" ] - - deps = [ - "${sec_comp_root_dir}/frameworks:libsecurity_component_framework", - "//third_party/googletest:gmock_main", - ] - - external_deps = [ - "ability_base:base", - "ability_base:want", - "ability_runtime:ability_manager", - "ability_runtime:runtime", - "access_token:libtoken_setproc", - "c_utils:utils", - "eventhandler:libeventhandler", - "graphic_2d:librender_service_client", - "hilog:libhilog", - "hisysevent:libhisysevent", - "hitrace:hitrace_meter", - "ipc:ipc_core", - "window_manager:libdm", - ] -} - -group("unittest") { - testonly = true - deps = [ - ":sec_comp_service_test", - ":sec_comp_service_mock_test", - ] -} diff --git a/services/security_component_service/sa/test/mock/include/access_token.h b/services/security_component_service/sa/test/mock/include/access_token.h deleted file mode 100644 index 654bb5b..0000000 --- a/services/security_component_service/sa/test/mock/include/access_token.h +++ /dev/null @@ -1,57 +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. - */ -#ifndef SECURITY_COMPONENT_MOCK_ACCESS_TOKEN_DEF_H -#define SECURITY_COMPONENT_MOCK_ACCESS_TOKEN_DEF_H - -namespace OHOS { -namespace Security { -namespace AccessToken { -typedef unsigned int AccessTokenID; -static const AccessTokenID INVALID_TOKENID = 0; - -enum AccessTokenKitRet { - RET_FAILED = -1, - RET_SUCCESS = 0, -}; - -typedef enum TypeATokenTypeEnum { - TOKEN_INVALID = -1, - TOKEN_HAP = 0, - TOKEN_NATIVE, - TOKEN_SHELL, - TOKEN_TYPE_BUTT, -} ATokenTypeEnum; - -typedef enum TypePermissionFlag { - PERMISSION_DEFAULT_FLAG = 0, - PERMISSION_USER_SET = 1 << 0, - PERMISSION_USER_FIXED = 1 << 1, - PERMISSION_SYSTEM_FIXED = 1 << 2, - PERMISSION_GRANTED_BY_POLICY = 1 << 3, - PERMISSION_COMPONENT_SET = 1 << 4, - PERMISSION_POLICY_FIXED = 1 << 5, -} PermissionFlag; - -typedef struct { - unsigned int tokenUniqueID : 20; - unsigned int res : 6; - unsigned int dlpFlag : 1; - unsigned int type : 2; - unsigned int version : 3; -} AccessTokenIDInner; -} // namespace AccessToken -} // namespace Security -} // namespace OHOS -#endif // SECURITY_COMPONENT_MOCK_ACCESS_TOKEN_DEF_H diff --git a/services/security_component_service/sa/test/mock/include/accesstoken_kit.h b/services/security_component_service/sa/test/mock/include/accesstoken_kit.h deleted file mode 100644 index f4a2af7..0000000 --- a/services/security_component_service/sa/test/mock/include/accesstoken_kit.h +++ /dev/null @@ -1,53 +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. - */ -#ifndef SECURITY_COMPONENT_INTERFACES_INNER_KITS_ACCESSTOKEN_KIT_H -#define SECURITY_COMPONENT_INTERFACES_INNER_KITS_ACCESSTOKEN_KIT_H - -#include -#include "access_token.h" - -namespace OHOS { -namespace Security { -namespace AccessToken { -struct HapTokenInfo { -}; - -class AccessTokenKit { -public: - static int RevokePermission(AccessTokenID tokenID, const std::string& permissionName, int flag) - { - return 0; - }; - - static int GrantPermission(AccessTokenID tokenID, const std::string& permissionName, int flag) - { - return 0; - }; - - static int GetHapTokenInfo(AccessTokenID tokenID, HapTokenInfo& hapTokenInfoRes) - { - return 0; - }; - - static ATokenTypeEnum GetTokenTypeFlag(AccessTokenID tokenID) - { - AccessTokenIDInner *idInner = reinterpret_cast(&tokenID); - return static_cast(idInner->type); - }; -}; -} // namespace SECURITY_COMPONENT_INTERFACES_INNER_KITS_ACCESSTOKEN_KIT_H -} // namespace Security -} // namespace OHOS -#endif diff --git a/services/security_component_service/sa/test/mock/include/app_mgr_interface.h b/services/security_component_service/sa/test/mock/include/app_mgr_interface.h deleted file mode 100644 index b0a36ec..0000000 --- a/services/security_component_service/sa/test/mock/include/app_mgr_interface.h +++ /dev/null @@ -1,38 +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. - */ -#ifndef SECURITY_COMPONENT_MOCK_ABILITY_RUNTIME_APP_MGR_INTERFACE_H -#define SECURITY_COMPONENT_MOCK_ABILITY_RUNTIME_APP_MGR_INTERFACE_H - -#include "iremote_broker.h" -#include "iremote_object.h" -#include "application_state_observer_stub.h" - -namespace OHOS { -namespace AppExecFwk { - -class IAppMgr : public IRemoteBroker { -public: - DECLARE_INTERFACE_DESCRIPTOR(u"ohos.appexecfwk.mock.AppMgr"); - - virtual int32_t RegisterApplicationStateObserver(const sptr &observer, - const std::vector &bundleNameList = {}) = 0; - - virtual int32_t UnregisterApplicationStateObserver(const sptr &observer) = 0; - - virtual int32_t GetForegroundApplications(std::vector &list) = 0; -}; -} // namespace AppExecFwk -} // namespace OHOS -#endif // SECURITY_COMPONENT_MOCK_ABILITY_RUNTIME_APP_MGR_INTERFACE_H diff --git a/services/security_component_service/sa/test/mock/include/application_state_observer_stub.h b/services/security_component_service/sa/test/mock/include/application_state_observer_stub.h deleted file mode 100644 index 9271160..0000000 --- a/services/security_component_service/sa/test/mock/include/application_state_observer_stub.h +++ /dev/null @@ -1,73 +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. - */ -#ifndef SECURITY_COMPONENT_MOCK_ABILITY_RUNTIME_APPLICATION_STATE_OBSERVER_STUB_H -#define SECURITY_COMPONENT_MOCK_ABILITY_RUNTIME_APPLICATION_STATE_OBSERVER_STUB_H - -#include -#include - -#include "iremote_stub.h" -#include "nocopyable.h" -#include "string_ex.h" - -namespace OHOS { -namespace AppExecFwk { -enum class AppProcessState { - APP_STATE_BEGIN = 0, - APP_STATE_CREATE = APP_STATE_BEGIN, - APP_STATE_READY, - APP_STATE_FOREGROUND, - APP_STATE_FOCUS, - APP_STATE_BACKGROUND, - APP_STATE_TERMINATED, - APP_STATE_END, -}; - -struct ProcessData { - std::string bundleName; - int32_t pid = 0; - int32_t uid = 0; - AppProcessState state; - bool isContinuousTask = false; - bool isKeepAlive = false; - bool isFocused = false; - int32_t requestProcCode = 0; -}; - -struct AppStateData { - std::string bundleName; - int32_t pid = -1; - int32_t uid = 0; - int32_t state = 0; - int32_t accessTokenId = 0; - bool isFocused = false; -}; - -class IApplicationStateObserver : public IRemoteBroker { -public: - DECLARE_INTERFACE_DESCRIPTOR(u"ohos.appexecfwk.IApplicationStateObserver"); - virtual void OnProcessStateChanged(const ProcessData &processData) {} - virtual void OnProcessDied(const ProcessData &processData) = 0; -}; - -class ApplicationStateObserverStub : public IRemoteStub { -public: - ApplicationStateObserverStub() = default; - virtual ~ApplicationStateObserverStub() = default; - DISALLOW_COPY_AND_MOVE(ApplicationStateObserverStub); -}; -} // namespace AppExecFwk -} // namespace OHOS -#endif // SECURITY_COMPONENT_MOCK_ABILITY_RUNTIME_APPLICATION_STATE_OBSERVER_STUB_H diff --git a/services/security_component_service/sa/test/mock/include/if_system_ability_manager.h b/services/security_component_service/sa/test/mock/include/if_system_ability_manager.h deleted file mode 100644 index eee66c0..0000000 --- a/services/security_component_service/sa/test/mock/include/if_system_ability_manager.h +++ /dev/null @@ -1,51 +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. -*/ -#ifndef SEC_COMP_MOCK_SYSTEM_ABILITY_IF_MANAGER_CLINET_INCLUDE_H -#define SEC_COMP_MOCK_SYSTEM_ABILITY_IF_MANAGER_CLINET_INCLUDE_H -#include "iremote_broker.h" -#include "iremote_object.h" -#include "iremote_proxy.h" -#include "mock_app_mgr_proxy.h" - -namespace OHOS { -class MockIRemoteObject : public virtual RefBase { -public: - bool AddDeathRecipient(const sptr& recipient) - { - (void)recipient; - return addResult; - } - bool addResult = true; -}; - -template inline sptr iface_cast(const sptr &object) -{ - if (object == nullptr) { - return nullptr; - } - const std::u16string descriptor = INTERFACE::GetDescriptor(); - if (descriptor == u"ohos.appexecfwk.mock.AppMgr") { - return static_cast(MockAppMgrProxy::g_MockAppMgrProxy); - } - return nullptr; -} - -class ISystemAbilityManager : public IRemoteBroker { -public: - virtual sptr GetSystemAbility(int32_t systemAbilityId) = 0; - virtual int32_t UnloadSystemAbility(int32_t systemAbilityId) = 0; -}; -} // namespace OHOS -#endif // SEC_COMP_MOCK_SYSTEM_ABILITY_IF_MANAGER_CLINET_INCLUDE_H diff --git a/services/security_component_service/sa/test/mock/include/ipc_mock_skeleton.h b/services/security_component_service/sa/test/mock/include/ipc_mock_skeleton.h deleted file mode 100644 index f1ca97c..0000000 --- a/services/security_component_service/sa/test/mock/include/ipc_mock_skeleton.h +++ /dev/null @@ -1,38 +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. -*/ -#ifndef SEC_COMP_MOCK_IPC_SKELETON_INCLUDE_H -#define SEC_COMP_MOCK_IPC_SKELETON_INCLUDE_H -#include - -namespace OHOS { -class IPCSkeleton { -public: - IPCSkeleton() = default; - ~IPCSkeleton() = default; - static uint32_t GetCallingTokenID() - { - return tokenID; - }; - - static pid_t GetCallingPid() - { - return pid; - }; - - static uint32_t tokenID; - static pid_t pid; -}; -} // namespace OHOS -#endif // SEC_COMP_MOCK_IPC_SKELETON_INCLUDE_H diff --git a/services/security_component_service/sa/test/mock/include/iservice_registry.h b/services/security_component_service/sa/test/mock/include/iservice_registry.h deleted file mode 100644 index 8a4aa3d..0000000 --- a/services/security_component_service/sa/test/mock/include/iservice_registry.h +++ /dev/null @@ -1,33 +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. -*/ -#ifndef SEC_COMP_MOCK_SYSTEM_ABILITY_MANAGER_CLINET_INCLUDE_H -#define SEC_COMP_MOCK_SYSTEM_ABILITY_MANAGER_CLINET_INCLUDE_H -#include -#include "if_system_ability_manager.h" - -namespace OHOS { -class SystemAbilityManagerClient { -public: - static SystemAbilityManagerClient& GetInstance(); - SystemAbilityManagerClient() = default; - ~SystemAbilityManagerClient() = default; - - static SystemAbilityManagerClient* clientInstance; - static SystemAbilityManagerClient defaultInstance; - static std::mutex instanceMtx; - MOCK_METHOD0(GetSystemAbilityManager, sptr()); -}; -} // namespace OHOS -#endif // SEC_COMP_MOCK_SYSTEM_ABILITY_MANAGER_CLINET_INCLUDE_H \ No newline at end of file diff --git a/services/security_component_service/sa/test/mock/include/mock_app_mgr_proxy.h b/services/security_component_service/sa/test/mock/include/mock_app_mgr_proxy.h deleted file mode 100644 index eab8644..0000000 --- a/services/security_component_service/sa/test/mock/include/mock_app_mgr_proxy.h +++ /dev/null @@ -1,37 +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. - */ -#ifndef SECURITY_COMPONET_MOCK_APP_MGR_PROXY_H -#define SECURITY_COMPONET_MOCK_APP_MGR_PROXY_H -#include -#include -#include "app_mgr_interface.h" -#include "iremote_proxy.h" - -namespace OHOS { -class MockAppMgrProxy : public IRemoteProxy { -public: - explicit MockAppMgrProxy(const sptr& impl) - : IRemoteProxy(impl) {} - ~MockAppMgrProxy() = default; - - static MockAppMgrProxy* g_MockAppMgrProxy; - - MOCK_METHOD2(RegisterApplicationStateObserver, - int32_t(const sptr&, const std::vector&)); - MOCK_METHOD1(UnregisterApplicationStateObserver, int32_t(const sptr &)); - MOCK_METHOD1(GetForegroundApplications, int32_t(std::vector&)); -}; -} // namespace OHOS -#endif diff --git a/services/security_component_service/sa/test/mock/include/mock_system_ability_proxy.h b/services/security_component_service/sa/test/mock/include/mock_system_ability_proxy.h deleted file mode 100644 index ee833e6..0000000 --- a/services/security_component_service/sa/test/mock/include/mock_system_ability_proxy.h +++ /dev/null @@ -1,32 +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. - */ -#ifndef SECURITY_COMPONENT_MOCK_SYSTEM_ABILITY_MANAGER_PROXY -#define SECURITY_COMPONENT_MOCK_SYSTEM_ABILITY_MANAGER_PROXY -#include -#include -#include "if_system_ability_manager.h" - -namespace OHOS { -class SystemAbilityManagerProxy : public IRemoteProxy { -public: - explicit SystemAbilityManagerProxy(const sptr& impl) - : IRemoteProxy(impl) {} - ~SystemAbilityManagerProxy() = default; - - MOCK_METHOD1(GetSystemAbility, sptr(int32_t)); - MOCK_METHOD1(UnloadSystemAbility, int32_t(int32_t)); -}; -} // namespace OHOS -#endif diff --git a/services/security_component_service/sa/test/mock/include/sec_comp_enhance_adapter.h b/services/security_component_service/sa/test/mock/include/sec_comp_enhance_adapter.h deleted file mode 100644 index 36bbaaa..0000000 --- a/services/security_component_service/sa/test/mock/include/sec_comp_enhance_adapter.h +++ /dev/null @@ -1,36 +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. - */ -#ifndef SECURITY_COMPONENT_ENHANCE_ADAPTER_H -#define SECURITY_COMPONENT_ENHANCE_ADAPTER_H -#include -#include "parcel.h" -#include "sec_comp_info.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -struct SecCompEnhanceAdapter { - static int32_t SetEnhanceCfg(uint8_t* cfg, uint32_t cfgLen); - static int32_t GetPointerEventEnhanceData(void* data, uint32_t dataLen, - uint8_t* enhanceData, uint32_t& enHancedataLen); - static int32_t CheckExtraInfo(const SecCompClickEvent& touchInfo); - - static int32_t EnableInputEnhance(); - static int32_t DisableInputEnhance(); -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // SECURITY_COMPONENT_ENHANCE_ADAPTER_H diff --git a/services/security_component_service/sa/test/mock/include/system_ability.h b/services/security_component_service/sa/test/mock/include/system_ability.h deleted file mode 100644 index 9127f3a..0000000 --- a/services/security_component_service/sa/test/mock/include/system_ability.h +++ /dev/null @@ -1,47 +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. - */ -#ifndef MOCK_SECURITY_COMPONENT_SYSTEM_ABILITY_H -#define MOCK_SECURITY_COMPONENT_SYSTEM_ABILITY_H - -#include -#include "if_system_ability_manager.h" -#include "iremote_object.h" - -namespace OHOS { -#define DECLEAR_SYSTEM_ABILITY(className) -#define SA_ID_SECURITY_COMPONENT_SERVICE 1000 -#define REGISTER_SYSTEM_ABILITY_BY_ID(a, b, c) - -class SystemAbility { -public: - static bool MakeAndRegisterAbility(SystemAbility*) - { - return true; - } - - virtual void OnStart() {}; - - virtual void OnStop() {}; - - MOCK_METHOD1(Publish, bool(sptr)); - - SystemAbility(bool runOnCreate = false) {}; - - SystemAbility(const int32_t serviceId, bool runOnCreate = false) {}; - - virtual ~SystemAbility() = default; -}; -} // namespace OHOS -#endif // MOCK_SECURITY_COMPONENT_SYSTEM_ABILITY_H diff --git a/services/security_component_service/sa/test/mock/src/mock_app_mgr_proxy.cpp b/services/security_component_service/sa/test/mock/src/mock_app_mgr_proxy.cpp deleted file mode 100644 index d83e9f0..0000000 --- a/services/security_component_service/sa/test/mock/src/mock_app_mgr_proxy.cpp +++ /dev/null @@ -1,20 +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 "mock_app_mgr_proxy.h" - -namespace OHOS { -MockAppMgrProxy* MockAppMgrProxy::g_MockAppMgrProxy = nullptr; -} diff --git a/services/security_component_service/sa/test/mock/src/mock_ipc_skeleton.cpp b/services/security_component_service/sa/test/mock/src/mock_ipc_skeleton.cpp deleted file mode 100644 index 62174e8..0000000 --- a/services/security_component_service/sa/test/mock/src/mock_ipc_skeleton.cpp +++ /dev/null @@ -1,20 +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 "ipc_skeleton.h" - -namespace OHOS { -uint32_t IPCSkeleton::tokenID = 0; -pid_t IPCSkeleton::pid = -1; -} // namespace OHOS diff --git a/services/security_component_service/sa/test/mock/src/mock_iservice_registry.cpp b/services/security_component_service/sa/test/mock/src/mock_iservice_registry.cpp deleted file mode 100644 index 7abc1fa..0000000 --- a/services/security_component_service/sa/test/mock/src/mock_iservice_registry.cpp +++ /dev/null @@ -1,34 +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 "iservice_registry.h" - -namespace OHOS { -SystemAbilityManagerClient* SystemAbilityManagerClient::clientInstance = nullptr; -SystemAbilityManagerClient SystemAbilityManagerClient::defaultInstance; -std::mutex SystemAbilityManagerClient::instanceMtx; - -SystemAbilityManagerClient& SystemAbilityManagerClient::GetInstance() -{ - std::lock_guard lock(instanceMtx); - if (clientInstance == nullptr) { - clientInstance = new (std::nothrow)SystemAbilityManagerClient(); - if (clientInstance == nullptr) { - return defaultInstance; - } - } - return *clientInstance; -} -} // namespace OHOS diff --git a/services/security_component_service/sa/test/mock/src/sec_comp_enhance_adapter.cpp b/services/security_component_service/sa/test/mock/src/sec_comp_enhance_adapter.cpp deleted file mode 100644 index 7c5538e..0000000 --- a/services/security_component_service/sa/test/mock/src/sec_comp_enhance_adapter.cpp +++ /dev/null @@ -1,109 +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 "sec_comp_enhance_adapter.h" -#include "sec_comp_err.h" -#include "sec_comp_log.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -namespace { -static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { - LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "MockSecCompEnhanceAdapter"}; -} - -int32_t SecCompEnhanceAdapter::SetEnhanceCfg(uint8_t* cfg, uint32_t cfgLen) -{ - SC_LOG_DEBUG(LABEL, "SetEnhanceCfg success"); - return SC_OK; -} - -int32_t SecCompEnhanceAdapter::GetPointerEventEnhanceData(void* data, uint32_t dataLen, - uint8_t* enhanceData, uint32_t& enHancedataLen) -{ - SC_LOG_DEBUG(LABEL, "GetPointerEventEnhanceData success"); - return SC_OK; -} - -int32_t SecCompEnhanceAdapter::CheckExtraInfo(const SecCompClickEvent& touchInfo) -{ - SC_LOG_DEBUG(LABEL, "CheckExtraInfo success"); - return SC_OK; -} - -int32_t SecCompEnhanceAdapter::EnableInputEnhance() -{ - SC_LOG_DEBUG(LABEL, "EnableInputEnhance success"); - return SC_OK; -} - -int32_t SecCompEnhanceAdapter::DisableInputEnhance() -{ - SC_LOG_DEBUG(LABEL, "DisableInputEnhance success"); - return SC_OK; -} - -bool SecCompEnhanceAdapter::EnhanceDataPreprocess(std::string& componentInfo) -{ - SC_LOG_DEBUG(LABEL, "EnhanceDataPreprocess success"); - return true; -} - -bool SecCompEnhanceAdapter::EnhanceDataPreprocess(int32_t scId, std::string& componentInfo) -{ - SC_LOG_DEBUG(LABEL, "EnhanceDataPreprocess success"); - return true; -} - -void SecCompEnhanceAdapter::RegisterScIdEnhance(int32_t scId) -{ - SC_LOG_DEBUG(LABEL, "RegisterScIdEnhance success"); -} - -void SecCompEnhanceAdapter::UnregisterScIdEnhance(int32_t scId) -{ - SC_LOG_DEBUG(LABEL, "UnregisterScIdEnhance success"); -} - -void SecCompEnhanceAdapter::StartEnhanceService() -{ - SC_LOG_DEBUG(LABEL, "StartEnhanceService success"); -} - -void SecCompEnhanceAdapter::ExistEnhanceService() -{ - SC_LOG_DEBUG(LABEL, "ExistEnhanceService success"); -} - -void SecCompEnhanceAdapter::NotifyProcessDied(int32_t pid) -{ - SC_LOG_DEBUG(LABEL, "NotifyProcessDied success"); -} - -int32_t SecCompEnhanceAdapter::CheckComponentInfoEnhnace(int32_t pid, - std::shared_ptr& compInfo, const nlohmann::json& jsonComponent) -{ - SC_LOG_DEBUG(LABEL, "CheckComponentInfoEnhnace success"); - return SC_OK; -} - -sptr SecCompEnhanceAdapter::GetEnhanceRemoteObject() -{ - SC_LOG_DEBUG(LABEL, "GetEnhanceRemoteObject success"); - return nullptr; -} -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS diff --git a/services/security_component_service/sa/test/unittest/src/app_state_observer_test.cpp b/services/security_component_service/sa/test/unittest/src/app_state_observer_test.cpp deleted file mode 100644 index 4923cdb..0000000 --- a/services/security_component_service/sa/test/unittest/src/app_state_observer_test.cpp +++ /dev/null @@ -1,182 +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 "app_state_observer_test.h" -#include "sec_comp_log.h" -#include "sec_comp_err.h" - -using namespace testing::ext; -using namespace OHOS; -using namespace OHOS::Security::SecurityComponent; - -namespace { -static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { - LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "AppStateObserverTest"}; - -static constexpr int32_t TEST_UID = 1; -static constexpr int32_t TEST_UID_2 = 2; -static constexpr int32_t TEST_PID = 1; -static constexpr int32_t TEST_PID_2 = 2; -} - -void AppStateObserverTest::SetUpTestCase() -{} - -void AppStateObserverTest::TearDownTestCase() -{} - -void AppStateObserverTest::SetUp() -{ - SC_LOG_INFO(LABEL, "setup"); - if (observer_ != nullptr) { - return; - } - - observer_ = std::make_shared(); - ASSERT_NE(nullptr, observer_); -} - -void AppStateObserverTest::TearDown() -{ - observer_ = nullptr; -} - -/** - * @tc.name: IsProcessForeground001 - * @tc.desc: Test is process foreground - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(AppStateObserverTest, IsProcessForeground001, TestSize.Level1) -{ - ASSERT_FALSE(observer_->IsProcessForeground(TEST_PID, TEST_UID)); - AppExecFwk::AppStateData stateData = { - .pid = TEST_PID, - .uid = TEST_UID, - }; - observer_->AddProcessToForegroundSet(stateData); - ASSERT_TRUE(observer_->IsProcessForeground(TEST_PID, TEST_UID)); -} - -/** - * @tc.name: AddProcessToForegroundSet001 - * @tc.desc: Test add process to foreground - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(AppStateObserverTest, AddProcessToForegroundSet001, TestSize.Level1) -{ - AppExecFwk::AppStateData stateData = { - .pid = TEST_PID, - .uid = TEST_UID, - }; - observer_->AddProcessToForegroundSet(stateData); - observer_->AddProcessToForegroundSet(stateData); - ASSERT_TRUE(observer_->IsProcessForeground(TEST_PID, TEST_UID)); - - AppExecFwk::ProcessData procData = { - .pid = TEST_PID_2, - .uid = TEST_UID_2, - }; - observer_->AddProcessToForegroundSet(procData); - observer_->AddProcessToForegroundSet(procData); - ASSERT_TRUE(observer_->IsProcessForeground(TEST_PID_2, TEST_UID_2)); -} - -/** - * @tc.name: RemoveProcessFromForegroundSet001 - * @tc.desc: Test remove process from foreground - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(AppStateObserverTest, RemoveProcessFromForegroundSet001, TestSize.Level1) -{ - AppExecFwk::ProcessData procData = { - .pid = TEST_PID, - .uid = TEST_UID, - }; - observer_->AddProcessToForegroundSet(procData); - ASSERT_TRUE(observer_->IsProcessForeground(TEST_PID, TEST_UID)); - observer_->RemoveProcessFromForegroundSet(procData); - observer_->RemoveProcessFromForegroundSet(procData); - ASSERT_FALSE(observer_->IsProcessForeground(TEST_PID, TEST_UID)); -} - -/** - * @tc.name: RemoveProcessFromForegroundSet002 - * @tc.desc: Test remove process with different uid - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(AppStateObserverTest, RemoveProcessFromForegroundSet002, TestSize.Level1) -{ - AppExecFwk::ProcessData procData = { - .pid = TEST_PID, - .uid = TEST_UID, - }; - observer_->AddProcessToForegroundSet(procData); - ASSERT_TRUE(observer_->IsProcessForeground(TEST_PID, TEST_UID)); - procData.pid = TEST_PID_2; - observer_->RemoveProcessFromForegroundSet(procData); - ASSERT_TRUE(observer_->IsProcessForeground(TEST_PID, TEST_UID)); -} - -/** - * @tc.name: OnProcessStateChanged001 - * @tc.desc: Test recieve process state changed - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(AppStateObserverTest, OnProcessStateChanged001, TestSize.Level1) -{ - AppExecFwk::ProcessData processData; - processData.state = AppExecFwk::AppProcessState::APP_STATE_CREATE; - observer_->OnProcessStateChanged(processData); - ASSERT_EQ(observer_->foregrandProcList_.size(), static_cast(0)); - - processData.state = AppExecFwk::AppProcessState::APP_STATE_FOREGROUND; - processData.pid = TEST_PID; - observer_->OnProcessStateChanged(processData); - ASSERT_TRUE(observer_->IsProcessForeground(TEST_PID, TEST_UID)); - - processData.state = AppExecFwk::AppProcessState::APP_STATE_BACKGROUND; - processData.pid = TEST_PID; - observer_->OnProcessStateChanged(processData); - ASSERT_FALSE(observer_->IsProcessForeground(TEST_PID, TEST_UID)); -} - -/** - * @tc.name: OnProcessDied001 - * @tc.desc: Test recieve process state died - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(AppStateObserverTest, OnProcessDied001, TestSize.Level1) -{ - AppExecFwk::ProcessData processData; - processData.state = AppExecFwk::AppProcessState::APP_STATE_FOREGROUND; - processData.pid = TEST_PID; - observer_->OnProcessStateChanged(processData); - ASSERT_TRUE(observer_->IsProcessForeground(TEST_PID, TEST_UID)); - - // if last process died, the sec_comp service will exit. - processData.pid = TEST_PID_2; - observer_->OnProcessStateChanged(processData); - ASSERT_TRUE(observer_->IsProcessForeground(TEST_PID_2, TEST_UID_2)); - - // notify process 1 died - processData.pid = TEST_PID; - observer_->OnProcessDied(processData); - ASSERT_FALSE(observer_->IsProcessForeground(TEST_PID, TEST_UID)); -} diff --git a/services/security_component_service/sa/test/unittest/src/app_state_observer_test.h b/services/security_component_service/sa/test/unittest/src/app_state_observer_test.h deleted file mode 100644 index 7195cf2..0000000 --- a/services/security_component_service/sa/test/unittest/src/app_state_observer_test.h +++ /dev/null @@ -1,41 +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. - */ -#ifndef APP_STATE_OBSERVER_TEST_H -#define APP_STATE_OBSERVER_TEST_H - -#include -#define private public -#include "app_state_observer.h" -#undef private - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -class AppStateObserverTest : public testing::Test { -public: - static void SetUpTestCase(); - - static void TearDownTestCase(); - - void SetUp(); - - void TearDown(); - - std::shared_ptr observer_ = nullptr; -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // APP_STATE_OBSERVER_TEST_H diff --git a/services/security_component_service/sa/test/unittest/src/sec_comp_entity_test.cpp b/services/security_component_service/sa/test/unittest/src/sec_comp_entity_test.cpp deleted file mode 100644 index 66d2831..0000000 --- a/services/security_component_service/sa/test/unittest/src/sec_comp_entity_test.cpp +++ /dev/null @@ -1,157 +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 "sec_comp_entity_test.h" -#include "sec_comp_log.h" -#include "location_button.h" -#include "paste_button.h" -#include "save_button.h" -#include "sec_comp_err.h" -#include "sec_comp_tool.h" - -using namespace testing::ext; -using namespace OHOS; -using namespace OHOS::Security::SecurityComponent; -using namespace OHOS::Security::AccessToken; - -namespace { -static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { - LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompEntityTest"}; -static constexpr double TEST_COORDINATE = 100.0; -static constexpr double TEST_DIFF_COORDINATE = 200.0; -static constexpr uint64_t TIME_CONVERSION_UNIT = 1000; -} - -void SecCompEntityTest::SetUpTestCase() -{} - -void SecCompEntityTest::TearDownTestCase() -{} - -void SecCompEntityTest::SetUp() -{ - SC_LOG_INFO(LABEL, "setup"); - if (entity_ != nullptr) { - return; - } - - std::shared_ptr component = std::make_shared(); - ASSERT_NE(nullptr, component); - - entity_ = std::make_shared(component, 1, 1); - ASSERT_NE(nullptr, entity_); -} - -void SecCompEntityTest::TearDown() -{ - entity_ = nullptr; -} - -/** - * @tc.name: RevokeTempPermission001 - * @tc.desc: Test revoke temp permission - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompEntityTest, RevokeTempPermission001, TestSize.Level1) -{ - entity_->isGrant_ = false; - ASSERT_EQ(entity_->RevokeTempPermission(), SC_OK); - - entity_->isGrant_ = true; - entity_->componentInfo_->type_ = UNKNOWN_SC_TYPE; - ASSERT_EQ(entity_->RevokeTempPermission(), SC_SERVICE_ERROR_PERMISSION_OPER_FAIL); - ASSERT_FALSE(entity_->isGrant_); - - entity_->isGrant_ = true; - entity_->componentInfo_->type_ = LOCATION_COMPONENT; - ASSERT_EQ(entity_->RevokeTempPermission(), SC_OK); - ASSERT_FALSE(entity_->isGrant_); -} - -/** - * @tc.name: GrantTempPermission001 - * @tc.desc: Test grant location permission - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompEntityTest, GrantTempPermission001, TestSize.Level1) -{ - entity_->isGrant_ = false; - entity_->componentInfo_->type_ = UNKNOWN_SC_TYPE; - ASSERT_EQ(entity_->GrantTempPermission(), SC_SERVICE_ERROR_PERMISSION_OPER_FAIL); - ASSERT_TRUE(entity_->isGrant_); - - entity_->isGrant_ = false; - entity_->componentInfo_->type_ = LOCATION_COMPONENT; - ASSERT_EQ(entity_->GrantTempPermission(), SC_OK); - ASSERT_TRUE(entity_->isGrant_); - - entity_->isGrant_ = false; - entity_->componentInfo_->type_ = PASTE_COMPONENT; - ASSERT_EQ(entity_->GrantTempPermission(), SC_OK); - ASSERT_TRUE(entity_->isGrant_); -} - -/** - * @tc.name: GrantTempPermission002 - * @tc.desc: Test grant paste permission with invalid tokenId. - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompEntityTest, GrantTempPermission002, TestSize.Level1) -{ - std::shared_ptr pasteComponent = std::make_shared(); - ASSERT_NE(nullptr, pasteComponent); - - entity_ = std::make_shared(pasteComponent, 0, 1); - ASSERT_NE(nullptr, entity_); - - ASSERT_EQ(entity_->GrantTempPermission(), SC_SERVICE_ERROR_PERMISSION_OPER_FAIL); - ASSERT_EQ(entity_->RevokeTempPermission(), SC_SERVICE_ERROR_PERMISSION_OPER_FAIL); -} - -/** - * @tc.name: CheckTouchInfo001 - * @tc.desc: Test touch info - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompEntityTest, CheckTouchInfo001, TestSize.Level1) -{ - SecCompClickEvent touch = { - .touchX = TEST_COORDINATE, - .touchY = TEST_COORDINATE, - .timestamp = 0, - }; - ASSERT_FALSE(entity_->CheckTouchInfo(touch)); - - uint64_t current = static_cast(std::chrono::high_resolution_clock::now().time_since_epoch().count()); - touch.timestamp = current + 10000L; // 10s - ASSERT_FALSE(entity_->CheckTouchInfo(touch)); - - entity_->componentInfo_->rect_.x_ = TEST_DIFF_COORDINATE; // click event will not hit this rect - entity_->componentInfo_->rect_.y_ = TEST_DIFF_COORDINATE; - entity_->componentInfo_->rect_.width_ = TEST_DIFF_COORDINATE; - entity_->componentInfo_->rect_.height_ = TEST_DIFF_COORDINATE; - touch.timestamp = static_cast( - std::chrono::high_resolution_clock::now().time_since_epoch().count()) / TIME_CONVERSION_UNIT; - ASSERT_FALSE(entity_->CheckTouchInfo(touch)); - - entity_->componentInfo_->rect_.x_ = TEST_COORDINATE; - entity_->componentInfo_->rect_.y_ = TEST_COORDINATE; - touch.timestamp = static_cast( - std::chrono::high_resolution_clock::now().time_since_epoch().count()) / TIME_CONVERSION_UNIT; - ASSERT_FALSE(entity_->CheckTouchInfo(touch)); -} diff --git a/services/security_component_service/sa/test/unittest/src/sec_comp_entity_test.h b/services/security_component_service/sa/test/unittest/src/sec_comp_entity_test.h deleted file mode 100644 index c65cf37..0000000 --- a/services/security_component_service/sa/test/unittest/src/sec_comp_entity_test.h +++ /dev/null @@ -1,42 +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. - */ - -#ifndef SEC_COMP_ENTITY_TEST_H -#define SEC_COMP_ENTITY_TEST_H - -#include -#define private public -#include "sec_comp_entity.h" -#undef private - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -class SecCompEntityTest : public testing::Test { -public: - static void SetUpTestCase(); - - static void TearDownTestCase(); - - void SetUp(); - - void TearDown(); - - std::shared_ptr entity_ = nullptr; -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // SEC_COMP_ENTITY_TEST_H diff --git a/services/security_component_service/sa/test/unittest/src/sec_comp_info_helper_test.cpp b/services/security_component_service/sa/test/unittest/src/sec_comp_info_helper_test.cpp deleted file mode 100644 index ac86c7f..0000000 --- a/services/security_component_service/sa/test/unittest/src/sec_comp_info_helper_test.cpp +++ /dev/null @@ -1,713 +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 "sec_comp_info_helper_test.h" -#include "location_button.h" -#include "paste_button.h" -#include "save_button.h" -#include "sec_comp_log.h" -#include "sec_comp_err.h" -#include "display.h" -#include "display_info.h" -#include "display_manager.h" - -using namespace testing::ext; -using namespace OHOS; -using namespace OHOS::Security::SecurityComponent; - -namespace { -static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { - LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompInfoHelperTest"}; - -static constexpr float TEST_SIZE = 100.0; -static constexpr double TEST_DIMENSION = 100.0; -static constexpr double TEST_INVALID_DIMENSION = -100.0; -static constexpr uint32_t TEST_COLOR_YELLOW = 0xff7fff00; -static constexpr uint32_t TEST_COLOR_RED = 0xffff0000; -static constexpr uint32_t TEST_COLOR_BLUE = 0xff0000ff; -static constexpr uint32_t TEST_COLOR_INVALID = 0x66000000; -static constexpr uint32_t TEST_COLOR_BLACK = 0x00000000; -static constexpr uint32_t TEST_COLOR_WHITE = 0xffffffff; -static constexpr uint32_t QUARTER = 4; -static constexpr double ZERO_OFFSET = 0.0F; -static double g_curScreenWidth = 0.0F; -static double g_curScreenHeight = 0.0F; -static double g_testWidth = 0.0F; -static double g_testHeight = 0.0F; - -static bool GetScreenSize() -{ - sptr display = - OHOS::Rosen::DisplayManager::GetInstance().GetDefaultDisplaySync(); - if (display == nullptr) { - return false; - } - - auto info = display->GetDisplayInfo(); - if (info == nullptr) { - return false; - } - - g_curScreenWidth = static_cast(info->GetWidth()); - g_curScreenHeight = static_cast(info->GetHeight()); - return true; -} - -static void BuildLocationComponentInfo(nlohmann::json& jsonComponent) -{ - jsonComponent[JsonTagConstants::JSON_SC_TYPE] = LOCATION_COMPONENT; - jsonComponent[JsonTagConstants::JSON_NODE_ID] = 0; - jsonComponent[JsonTagConstants::JSON_RECT] = nlohmann::json { - {JsonTagConstants::JSON_RECT_X, g_testWidth }, - {JsonTagConstants::JSON_RECT_Y, g_testHeight }, - {JsonTagConstants::JSON_RECT_WIDTH, g_testWidth }, - {JsonTagConstants::JSON_RECT_HEIGHT, g_testHeight } - }; - jsonComponent[JsonTagConstants::JSON_WINDOW_RECT] = nlohmann::json { - { JsonTagConstants::JSON_RECT_X, g_testWidth }, - { JsonTagConstants::JSON_RECT_Y, g_testHeight }, - { JsonTagConstants::JSON_RECT_WIDTH, g_testWidth }, - { JsonTagConstants::JSON_RECT_HEIGHT, g_testHeight } - }; - nlohmann::json jsonPadding = nlohmann::json { - { JsonTagConstants::JSON_PADDING_TOP_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_RIGHT_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_LEFT_TAG, TEST_DIMENSION }, - }; - - jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, - }; - - jsonComponent[JsonTagConstants::JSON_COLORS_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_COLOR_TAG, TEST_COLOR_RED }, - { JsonTagConstants::JSON_ICON_COLOR_TAG, TEST_COLOR_BLUE }, - { JsonTagConstants::JSON_BG_COLOR_TAG, TEST_COLOR_YELLOW } - }; - - jsonComponent[JsonTagConstants::JSON_BORDER_TAG] = nlohmann::json { - { JsonTagConstants::JSON_BORDER_WIDTH_TAG, TEST_SIZE }, - }; - jsonComponent[JsonTagConstants::JSON_PARENT_TAG] = nlohmann::json { - { JsonTagConstants::JSON_PARENT_EFFECT_TAG, false }, - }; - jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_TEXT_TAG, LocationDesc::SELECT_LOCATION }, - { JsonTagConstants::JSON_ICON_TAG, LocationIcon::LINE_ICON }, - { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, - }; -} -} - -void SecCompInfoHelperTest::SetUpTestCase() -{ - ASSERT_TRUE(GetScreenSize()); - g_testWidth = (ZERO_OFFSET + g_curScreenWidth) / QUARTER; - g_testHeight = (ZERO_OFFSET + g_curScreenHeight) / QUARTER; -} - -void SecCompInfoHelperTest::TearDownTestCase() -{} - -void SecCompInfoHelperTest::SetUp() -{ - SC_LOG_INFO(LABEL, "setup"); -} - -void SecCompInfoHelperTest::TearDown() -{} - -/** - * @tc.name: ParseComponent001 - * @tc.desc: Test parse component info success - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompInfoHelperTest, ParseComponent001, TestSize.Level1) -{ - nlohmann::json jsonComponent; - BuildLocationComponentInfo(jsonComponent); - SecCompBase* comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); - ASSERT_NE(comp, nullptr); - ASSERT_TRUE(comp->GetValid()); -} - -/** - * @tc.name: ParseComponent002 - * @tc.desc: Test parse component info with empty json - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompInfoHelperTest, ParseComponent002, TestSize.Level1) -{ - nlohmann::json jsonComponent; - ASSERT_EQ(SecCompInfoHelper::ParseComponent(UNKNOWN_SC_TYPE, jsonComponent), nullptr); - - ASSERT_EQ(SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent), nullptr); - ASSERT_EQ(SecCompInfoHelper::ParseComponent(PASTE_COMPONENT, jsonComponent), nullptr); - ASSERT_EQ(SecCompInfoHelper::ParseComponent(SAVE_COMPONENT, jsonComponent), nullptr); -} - -/** - * @tc.name: ParseComponent003 - * @tc.desc: Test parse component info with invalid type - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompInfoHelperTest, ParseComponent003, TestSize.Level1) -{ - nlohmann::json jsonComponent; - BuildLocationComponentInfo(jsonComponent); - - SecCompBase* comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); - ASSERT_TRUE(comp->GetValid()); - - jsonComponent[JsonTagConstants::JSON_SC_TYPE] = UNKNOWN_SC_TYPE; - comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); - ASSERT_EQ(comp, nullptr); -} - -/** - * @tc.name: ParseComponent004 - * @tc.desc: Test parse component info with invalid rect - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompInfoHelperTest, ParseComponent004, TestSize.Level1) -{ - SecCompRect rect = { - .x_ = g_testWidth, - .y_ = g_testHeight, - .width_ = g_testWidth, - .height_ = g_testHeight - }; - SecCompRect windowRect = { - .x_ = g_testWidth, - .y_ = g_testHeight, - .width_ = g_testWidth, - .height_ = g_testHeight - }; - ASSERT_TRUE(SecCompInfoHelper::CheckRectValid(rect, windowRect)); - - rect.x_ = TEST_INVALID_DIMENSION; - ASSERT_FALSE(SecCompInfoHelper::CheckRectValid(rect, windowRect)); - rect.y_ = TEST_INVALID_DIMENSION; - ASSERT_FALSE(SecCompInfoHelper::CheckRectValid(rect, windowRect)); - rect.x_ = g_curScreenWidth + 1; - ASSERT_FALSE(SecCompInfoHelper::CheckRectValid(rect, windowRect)); - rect.y_ = g_curScreenHeight + 1; - ASSERT_FALSE(SecCompInfoHelper::CheckRectValid(rect, windowRect)); - rect.width_ = g_curScreenWidth; - ASSERT_FALSE(SecCompInfoHelper::CheckRectValid(rect, windowRect)); - rect.height_ = g_curScreenHeight; - ASSERT_FALSE(SecCompInfoHelper::CheckRectValid(rect, windowRect)); - rect.x_ = g_curScreenWidth - g_testWidth; - ASSERT_FALSE(SecCompInfoHelper::CheckRectValid(rect, windowRect)); - rect.y_ = g_curScreenHeight - g_testHeight; - ASSERT_FALSE(SecCompInfoHelper::CheckRectValid(rect, windowRect)); -} - -/** - * @tc.name: ParseComponent005 - * @tc.desc: Test parse component info with windowRect invalid - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompInfoHelperTest, ParseComponent005, TestSize.Level1) -{ - SecCompRect rect = { - .x_ = g_testWidth, - .y_ = g_testHeight, - .width_ = g_testWidth, - .height_ = g_testHeight - }; - SecCompRect windowRect = { - .x_ = g_testWidth, - .y_ = g_testHeight, - .width_ = g_testWidth, - .height_ = g_testHeight - }; - ASSERT_TRUE(SecCompInfoHelper::CheckRectValid(rect, windowRect)); - - windowRect.x_ = g_testWidth + 1; - ASSERT_FALSE(SecCompInfoHelper::CheckRectValid(rect, windowRect)); - windowRect.y_ = g_testHeight + 1; - ASSERT_FALSE(SecCompInfoHelper::CheckRectValid(rect, windowRect)); - windowRect.width_ = g_testWidth - 1; - ASSERT_FALSE(SecCompInfoHelper::CheckRectValid(rect, windowRect)); - windowRect.height_ = g_testHeight - 1; - ASSERT_FALSE(SecCompInfoHelper::CheckRectValid(rect, windowRect)); - windowRect.width_ = TEST_INVALID_DIMENSION; - ASSERT_FALSE(SecCompInfoHelper::CheckRectValid(rect, windowRect)); - windowRect.height_ = TEST_INVALID_DIMENSION; - ASSERT_FALSE(SecCompInfoHelper::CheckRectValid(rect, windowRect)); -} - -/** - * @tc.name: ParseComponent006 - * @tc.desc: Test parse component info with parentEffect active - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompInfoHelperTest, ParseComponent006, TestSize.Level1) -{ - nlohmann::json jsonComponent; - BuildLocationComponentInfo(jsonComponent); - - SecCompBase* comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); - ASSERT_TRUE(comp->GetValid()); - - jsonComponent[JsonTagConstants::JSON_PARENT_TAG] = nlohmann::json { - { JsonTagConstants::JSON_PARENT_EFFECT_TAG, true }, - }; - comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); - ASSERT_FALSE(comp->GetValid()); -} - -/** - * @tc.name: ParseComponent007 - * @tc.desc: Test parse component info with invalid size - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompInfoHelperTest, ParseComponent007, TestSize.Level1) -{ - nlohmann::json jsonComponent; - BuildLocationComponentInfo(jsonComponent); - - SecCompBase* comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); - ASSERT_TRUE(comp->GetValid()); - - nlohmann::json jsonPadding = nlohmann::json { - { JsonTagConstants::JSON_PADDING_TOP_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_RIGHT_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_LEFT_TAG, TEST_DIMENSION }, - }; - - jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_INVALID_DIMENSION }, - { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, - }; - comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); - ASSERT_FALSE(comp->GetValid()); - - jsonPadding = nlohmann::json { - { JsonTagConstants::JSON_PADDING_TOP_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_RIGHT_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_LEFT_TAG, TEST_DIMENSION }, - }; - - jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_INVALID_DIMENSION }, - { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, - }; - comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); - ASSERT_FALSE(comp->GetValid()); - - jsonPadding = nlohmann::json { - { JsonTagConstants::JSON_PADDING_TOP_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_RIGHT_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_LEFT_TAG, TEST_DIMENSION }, - }; - - jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_INVALID_DIMENSION }, - { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, - }; - comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); - ASSERT_FALSE(comp->GetValid()); -} - -/** - * @tc.name: ParseComponent008 - * @tc.desc: Test parse component info with invalid size - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompInfoHelperTest, ParseComponent008, TestSize.Level1) -{ - nlohmann::json jsonComponent; - BuildLocationComponentInfo(jsonComponent); - SecCompBase* comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); - ASSERT_TRUE(comp->GetValid()); - - nlohmann::json jsonPadding = nlohmann::json { - { JsonTagConstants::JSON_PADDING_TOP_TAG, TEST_INVALID_DIMENSION }, - { JsonTagConstants::JSON_PADDING_RIGHT_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_LEFT_TAG, TEST_DIMENSION }, - }; - - jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, - }; - comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); - ASSERT_FALSE(comp->GetValid()); - - jsonPadding = nlohmann::json { - { JsonTagConstants::JSON_PADDING_TOP_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_RIGHT_TAG, TEST_INVALID_DIMENSION }, - { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_LEFT_TAG, TEST_DIMENSION }, - }; - - jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, - }; - comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); - ASSERT_FALSE(comp->GetValid()); -} - -/** - * @tc.name: ParseComponent009 - * @tc.desc: Test parse component info with invalid size - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompInfoHelperTest, ParseComponent009, TestSize.Level1) -{ - nlohmann::json jsonComponent; - BuildLocationComponentInfo(jsonComponent); - SecCompBase* comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); - ASSERT_TRUE(comp->GetValid()); - - nlohmann::json jsonPadding = nlohmann::json { - { JsonTagConstants::JSON_PADDING_TOP_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_RIGHT_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, TEST_INVALID_DIMENSION }, - { JsonTagConstants::JSON_PADDING_LEFT_TAG, TEST_DIMENSION }, - }; - - jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, - }; - comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); - ASSERT_FALSE(comp->GetValid()); - - jsonPadding = nlohmann::json { - { JsonTagConstants::JSON_PADDING_TOP_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_RIGHT_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_LEFT_TAG, TEST_INVALID_DIMENSION }, - }; - - jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, - }; - comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); - ASSERT_FALSE(comp->GetValid()); -} - -/** - * @tc.name: ParseComponent010 - * @tc.desc: Test parse component info with invalid color - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompInfoHelperTest, ParseComponent010, TestSize.Level1) -{ - nlohmann::json jsonComponent; - BuildLocationComponentInfo(jsonComponent); - SecCompBase* comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); - ASSERT_TRUE(comp->GetValid()); - - jsonComponent[JsonTagConstants::JSON_COLORS_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_COLOR_TAG, TEST_COLOR_INVALID }, - { JsonTagConstants::JSON_ICON_COLOR_TAG, TEST_COLOR_BLUE }, - { JsonTagConstants::JSON_BG_COLOR_TAG, TEST_COLOR_YELLOW } - }; - comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); - ASSERT_FALSE(comp->GetValid()); - - jsonComponent[JsonTagConstants::JSON_COLORS_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_COLOR_TAG, TEST_COLOR_RED }, - { JsonTagConstants::JSON_ICON_COLOR_TAG, TEST_COLOR_INVALID }, - { JsonTagConstants::JSON_BG_COLOR_TAG, TEST_COLOR_YELLOW } - }; - comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); - ASSERT_FALSE(comp->GetValid()); - - jsonComponent[JsonTagConstants::JSON_COLORS_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_COLOR_TAG, TEST_COLOR_RED }, - { JsonTagConstants::JSON_ICON_COLOR_TAG, TEST_COLOR_BLUE }, - { JsonTagConstants::JSON_BG_COLOR_TAG, TEST_COLOR_INVALID } - }; - comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); - ASSERT_FALSE(comp->GetValid()); -} - -/** - * @tc.name: ParseComponent011 - * @tc.desc: Test parse component info with invalid style - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompInfoHelperTest, ParseComponent011, TestSize.Level1) -{ - nlohmann::json jsonComponent; - BuildLocationComponentInfo(jsonComponent); - SecCompBase* comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); - ASSERT_TRUE(comp->GetValid()); - - jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_TEXT_TAG, NO_TEXT }, - { JsonTagConstants::JSON_ICON_TAG, NO_ICON }, - { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, - }; - comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); - ASSERT_FALSE(comp->GetValid()); -} - -/** - * @tc.name: ParseComponent012 - * @tc.desc: Test parse component info with invalid style - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompInfoHelperTest, ParseComponent012, TestSize.Level1) -{ - nlohmann::json jsonComponent; - BuildLocationComponentInfo(jsonComponent); - SecCompBase* comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); - ASSERT_TRUE(comp->GetValid()); - - jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_TEXT_TAG, LocationDesc::SELECT_LOCATION }, - { JsonTagConstants::JSON_ICON_TAG, LocationIcon::LINE_ICON }, - { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, - }; - jsonComponent[JsonTagConstants::JSON_COLORS_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_COLOR_TAG, TEST_COLOR_YELLOW }, - { JsonTagConstants::JSON_ICON_COLOR_TAG, TEST_COLOR_BLUE }, - { JsonTagConstants::JSON_BG_COLOR_TAG, TEST_COLOR_YELLOW } - }; - comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); - ASSERT_FALSE(comp->GetValid()); - - jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_TEXT_TAG, LocationDesc::SELECT_LOCATION }, - { JsonTagConstants::JSON_ICON_TAG, LocationIcon::LINE_ICON }, - { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, - }; - jsonComponent[JsonTagConstants::JSON_COLORS_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_COLOR_TAG, TEST_COLOR_RED }, - { JsonTagConstants::JSON_ICON_COLOR_TAG, TEST_COLOR_YELLOW }, - { JsonTagConstants::JSON_BG_COLOR_TAG, TEST_COLOR_YELLOW } - }; - comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); - ASSERT_FALSE(comp->GetValid()); - - jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_TEXT_TAG, LocationDesc::SELECT_LOCATION }, - { JsonTagConstants::JSON_ICON_TAG, LocationIcon::LINE_ICON }, - { JsonTagConstants::JSON_BG_TAG, SecCompBackground::NO_BG_TYPE }, - }; - jsonComponent[JsonTagConstants::JSON_COLORS_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_COLOR_TAG, TEST_COLOR_RED }, - { JsonTagConstants::JSON_ICON_COLOR_TAG, TEST_COLOR_YELLOW }, - { JsonTagConstants::JSON_BG_COLOR_TAG, TEST_COLOR_YELLOW } - }; - comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); - ASSERT_FALSE(comp->GetValid()); -} - -/** - * @tc.name: ParseComponent013 - * @tc.desc: Test parse component info with invalid style - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompInfoHelperTest, ParseComponent013, TestSize.Level1) -{ - nlohmann::json jsonComponent; - BuildLocationComponentInfo(jsonComponent); - SecCompBase* comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); - ASSERT_TRUE(comp->GetValid()); - - jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_TEXT_TAG, LocationDesc::SELECT_LOCATION }, - { JsonTagConstants::JSON_ICON_TAG, LocationIcon::LINE_ICON }, - { JsonTagConstants::JSON_BG_TAG, SecCompBackground::NO_BG_TYPE }, - }; - nlohmann::json jsonPadding = nlohmann::json { - { JsonTagConstants::JSON_PADDING_TOP_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_RIGHT_TAG, MIN_PADDING_WITHOUT_BG }, - { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, MIN_PADDING_WITHOUT_BG }, - { JsonTagConstants::JSON_PADDING_LEFT_TAG, MIN_PADDING_WITHOUT_BG }, - }; - - jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, - }; - comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); - ASSERT_FALSE(comp->GetValid()); - - jsonPadding = nlohmann::json { - { JsonTagConstants::JSON_PADDING_TOP_TAG, MIN_PADDING_WITHOUT_BG }, - { JsonTagConstants::JSON_PADDING_RIGHT_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, MIN_PADDING_WITHOUT_BG }, - { JsonTagConstants::JSON_PADDING_LEFT_TAG, MIN_PADDING_WITHOUT_BG }, - }; - - jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, - }; - comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); - ASSERT_FALSE(comp->GetValid()); -} - -/** - * @tc.name: ParseComponent014 - * @tc.desc: Test parse component info with invalid style - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompInfoHelperTest, ParseComponent014, TestSize.Level1) -{ - nlohmann::json jsonComponent; - BuildLocationComponentInfo(jsonComponent); - SecCompBase* comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); - ASSERT_TRUE(comp->GetValid()); - - jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_TEXT_TAG, LocationDesc::SELECT_LOCATION }, - { JsonTagConstants::JSON_ICON_TAG, LocationIcon::LINE_ICON }, - { JsonTagConstants::JSON_BG_TAG, SecCompBackground::NO_BG_TYPE }, - }; - - nlohmann::json jsonPadding = nlohmann::json { - { JsonTagConstants::JSON_PADDING_TOP_TAG, MIN_PADDING_WITHOUT_BG }, - { JsonTagConstants::JSON_PADDING_RIGHT_TAG, MIN_PADDING_WITHOUT_BG }, - { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, TEST_DIMENSION }, - { JsonTagConstants::JSON_PADDING_LEFT_TAG, MIN_PADDING_WITHOUT_BG }, - }; - - jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, - }; - comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); - ASSERT_FALSE(comp->GetValid()); - - jsonPadding = nlohmann::json { - { JsonTagConstants::JSON_PADDING_TOP_TAG, MIN_PADDING_WITHOUT_BG }, - { JsonTagConstants::JSON_PADDING_RIGHT_TAG, MIN_PADDING_WITHOUT_BG }, - { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, MIN_PADDING_WITHOUT_BG }, - { JsonTagConstants::JSON_PADDING_LEFT_TAG, TEST_DIMENSION }, - }; - - jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, - { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, - }; - comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); - ASSERT_FALSE(comp->GetValid()); -} - - -/** - * @tc.name: CheckComponentValid001 - * @tc.desc: Test CheckComponentValid with invalid color - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompInfoHelperTest, CheckComponentValid001, TestSize.Level1) -{ - nlohmann::json jsonComponent; - BuildLocationComponentInfo(jsonComponent); - SecCompBase* comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); - ASSERT_TRUE(comp->GetValid()); - jsonComponent[JsonTagConstants::JSON_COLORS_TAG] = nlohmann::json { - { JsonTagConstants::JSON_FONT_COLOR_TAG, TEST_COLOR_RED }, - { JsonTagConstants::JSON_ICON_COLOR_TAG, TEST_COLOR_BLACK }, - { JsonTagConstants::JSON_BG_COLOR_TAG, TEST_COLOR_WHITE } - }; - ASSERT_TRUE(SecCompInfoHelper::CheckComponentValid(comp)); -} - -/** - * @tc.name: CheckComponentValid002 - * @tc.desc: Test CheckComponentValid with invalid text or icon - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompInfoHelperTest, CheckComponentValid002, TestSize.Level1) -{ - nlohmann::json jsonComponent; - BuildLocationComponentInfo(jsonComponent); - SecCompBase* comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); - comp->text_ = UNKNOWN_TEXT; - ASSERT_TRUE(SecCompInfoHelper::CheckComponentValid(comp)); - - comp->text_ = static_cast(LocationDesc::SELECT_LOCATION); - comp->icon_ = UNKNOWN_ICON; - ASSERT_TRUE(SecCompInfoHelper::CheckComponentValid(comp)); - - comp->text_ = UNKNOWN_TEXT; - ASSERT_FALSE(SecCompInfoHelper::CheckComponentValid(comp)); -} - -/** - * @tc.name: CheckComponentValid003 - * @tc.desc: Test CheckComponentValid with invalid type - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompInfoHelperTest, CheckComponentValid003, TestSize.Level1) -{ - nlohmann::json jsonComponent; - BuildLocationComponentInfo(jsonComponent); - SecCompBase* comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); - comp->type_ = SecCompType::UNKNOWN_SC_TYPE; - ASSERT_FALSE(SecCompInfoHelper::CheckComponentValid(comp)); - - comp->type_ = SecCompType::MAX_SC_TYPE; - ASSERT_FALSE(SecCompInfoHelper::CheckComponentValid(comp)); -} diff --git a/services/security_component_service/sa/test/unittest/src/sec_comp_info_helper_test.h b/services/security_component_service/sa/test/unittest/src/sec_comp_info_helper_test.h deleted file mode 100644 index a9d8459..0000000 --- a/services/security_component_service/sa/test/unittest/src/sec_comp_info_helper_test.h +++ /dev/null @@ -1,37 +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. - */ -#ifndef SEC_COMP_INFO_HELPER_TEST_H -#define SEC_COMP_INFO_HELPER_TEST_H - -#include -#include "sec_comp_info_helper.h" - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -class SecCompInfoHelperTest : public testing::Test { -public: - static void SetUpTestCase(); - - static void TearDownTestCase(); - - void SetUp(); - - void TearDown(); -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // SEC_COMP_ENTITY_TEST_H diff --git a/services/security_component_service/sa/test/unittest/src/sec_comp_manager_test.cpp b/services/security_component_service/sa/test/unittest/src/sec_comp_manager_test.cpp deleted file mode 100644 index 737c938..0000000 --- a/services/security_component_service/sa/test/unittest/src/sec_comp_manager_test.cpp +++ /dev/null @@ -1,361 +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 "sec_comp_manager_test.h" -#include "sec_comp_log.h" -#include "location_button.h" -#include "save_button.h" -#include "sec_comp_err.h" - -using namespace testing::ext; -using namespace OHOS; -using namespace OHOS::Security::SecurityComponent; -using namespace OHOS::Security::AccessToken; - -namespace { -static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { - LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompManagerTest"}; - -static constexpr double TEST_SIZE = 100.0; -static constexpr uint32_t TEST_INVALID_SIZE = 0; -static constexpr double TEST_COORDINATE = 100.0; -static constexpr uint32_t TEST_COLOR = 0xffffffff; -static constexpr uint32_t TEST_COLOR_YELLOW = 0xff7fff00; -static constexpr uint32_t TEST_COLOR_RED = 0xffff0000; -static constexpr uint32_t TEST_COLOR_BLUE = 0xff0000ff; - -static constexpr int32_t TEST_PID_1 = 1; -static constexpr int32_t TEST_PID_2 = 2; -static constexpr int32_t TEST_PID_3 = 3; - -static constexpr AccessTokenID TEST_TOKEN_ID = 1; -static constexpr int32_t TEST_SC_ID_1 = 1; -static constexpr int32_t TEST_SC_ID_2 = 2; -static constexpr int32_t TEST_INVALID_SC_ID = -1; - -static constexpr int32_t MAX_INT_NUM = 0x7fffffff; -static constexpr int32_t SC_ID_START = 1000; - -static LocationButton BuildInvalidLocationComponent() -{ - LocationButton button; - button.fontSize_ = TEST_INVALID_SIZE; - button.iconSize_ = TEST_INVALID_SIZE; - button.padding_.top = TEST_INVALID_SIZE; - button.padding_.right = TEST_INVALID_SIZE; - button.padding_.bottom = TEST_INVALID_SIZE; - button.padding_.left = TEST_INVALID_SIZE; - button.textIconSpace_ = TEST_INVALID_SIZE; - button.fontColor_.value = TEST_COLOR; - button.iconColor_.value = TEST_COLOR; - button.bgColor_.value = TEST_COLOR; - button.borderWidth_ = TEST_INVALID_SIZE; - button.type_ = LOCATION_COMPONENT; - button.rect_.x_ = TEST_COORDINATE; - button.rect_.y_ = TEST_COORDINATE; - button.rect_.width_ = TEST_COORDINATE; - button.rect_.height_ = TEST_COORDINATE; - button.windowRect_.x_ = TEST_COORDINATE; - button.windowRect_.y_ = TEST_COORDINATE; - button.windowRect_.width_ = TEST_COORDINATE; - button.windowRect_.height_ = TEST_COORDINATE; - button.text_ = UNKNOWN_TEXT; - button.icon_ = UNKNOWN_ICON; - button.bg_ = SecCompBackground::UNKNOWN_BG; - return button; -} - -static LocationButton BuildValidLocationComponent() -{ - LocationButton button; - button.fontSize_ = TEST_SIZE; - button.iconSize_ = TEST_SIZE; - button.padding_.top = TEST_SIZE; - button.padding_.right = TEST_SIZE; - button.padding_.bottom = TEST_SIZE; - button.padding_.left = TEST_SIZE; - button.textIconSpace_ = TEST_SIZE; - button.fontColor_.value = TEST_COLOR_YELLOW; - button.iconColor_.value = TEST_COLOR_RED; - button.bgColor_.value = TEST_COLOR_BLUE; - button.borderWidth_ = TEST_SIZE; - button.type_ = LOCATION_COMPONENT; - button.rect_.x_ = TEST_COORDINATE; - button.rect_.y_ = TEST_COORDINATE; - button.rect_.width_ = TEST_COORDINATE; - button.rect_.height_ = TEST_COORDINATE; - button.windowRect_.x_ = TEST_COORDINATE; - button.windowRect_.y_ = TEST_COORDINATE; - button.windowRect_.width_ = TEST_COORDINATE; - button.windowRect_.height_ = TEST_COORDINATE; - button.text_ = static_cast(LocationDesc::SELECT_LOCATION); - button.icon_ = static_cast(LocationIcon::LINE_ICON); - button.bg_ = SecCompBackground::CIRCLE; - return button; -} -} - -void SecCompManagerTest::SetUpTestCase() -{} - -void SecCompManagerTest::TearDownTestCase() -{} - -void SecCompManagerTest::SetUp() -{ - SC_LOG_INFO(LABEL, "setup"); -} - -void SecCompManagerTest::TearDown() -{ - SecCompManager::GetInstance().componentMap_.clear(); -} - - -/** - * @tc.name: CreateScId001 - * @tc.desc: Test create sc id - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompManagerTest, CreateScId001, TestSize.Level1) -{ - SecCompManager::GetInstance().scIdStart_ = MAX_INT_NUM; - ASSERT_EQ(SecCompManager::GetInstance().CreateScId(), SC_ID_START); - - SecCompManager::GetInstance().scIdStart_ = SC_ID_START; - ASSERT_EQ(SecCompManager::GetInstance().CreateScId(), SC_ID_START + 1); -} - -/** - * @tc.name: AddSecurityComponentToList001 - * @tc.desc: Test add security component to list - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompManagerTest, AddSecurityComponentToList001, TestSize.Level1) -{ - std::shared_ptr compPtr = std::make_shared(); - ASSERT_NE(compPtr, nullptr); - compPtr->rect_.x_ = TEST_COORDINATE; - compPtr->rect_.y_ = TEST_COORDINATE; - compPtr->rect_.width_ = TEST_COORDINATE; - compPtr->rect_.height_ = TEST_COORDINATE; - SecCompEntity entity(compPtr, TEST_TOKEN_ID, TEST_SC_ID_1); - - ASSERT_EQ(SecCompManager::GetInstance().AddSecurityComponentToList(1, entity), SC_OK); - - std::shared_ptr compPtrNew = std::make_shared(); - ASSERT_NE(compPtrNew, nullptr); - compPtrNew->rect_.x_ = TEST_COORDINATE * 2; // not overlap - compPtrNew->rect_.y_ = TEST_COORDINATE * 2; // not overlap - compPtrNew->rect_.width_ = TEST_COORDINATE; - compPtrNew->rect_.height_ = TEST_COORDINATE; - SecCompEntity entityNew(compPtrNew, TEST_TOKEN_ID, TEST_SC_ID_2); - ASSERT_EQ(SecCompManager::GetInstance().AddSecurityComponentToList(1, entityNew), SC_OK); -} - -/** - * @tc.name: DeleteSecurityComponentFromList001 - * @tc.desc: Test delete security component - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompManagerTest, DeleteSecurityComponentFromList001, TestSize.Level1) -{ - ASSERT_EQ(SecCompManager::GetInstance().DeleteSecurityComponentFromList(TEST_PID_1, TEST_SC_ID_1), - SC_SERVICE_ERROR_COMPONENT_NOT_EXIST); - - std::shared_ptr compPtr = std::make_shared(); - ASSERT_NE(compPtr, nullptr); - compPtr->rect_.x_ = TEST_COORDINATE; - compPtr->rect_.y_ = TEST_COORDINATE; - compPtr->rect_.width_ = TEST_COORDINATE; - compPtr->rect_.height_ = TEST_COORDINATE; - SecCompEntity entity(compPtr, TEST_TOKEN_ID, TEST_SC_ID_1); - ASSERT_EQ(SecCompManager::GetInstance().AddSecurityComponentToList(TEST_PID_1, entity), SC_OK); - - ASSERT_EQ(SecCompManager::GetInstance().DeleteSecurityComponentFromList(TEST_PID_1, TEST_SC_ID_2), - SC_SERVICE_ERROR_COMPONENT_NOT_EXIST); - - ASSERT_EQ(SecCompManager::GetInstance().DeleteSecurityComponentFromList(TEST_PID_1, TEST_SC_ID_1), SC_OK); -} - -/** - * @tc.name: GetSecurityComponentFromList001 - * @tc.desc: Test get security component - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompManagerTest, GetSecurityComponentFromList001, TestSize.Level1) -{ - ASSERT_EQ(SecCompManager::GetInstance().GetSecurityComponentFromList(TEST_PID_1, TEST_SC_ID_1), nullptr); - - std::shared_ptr compPtr = std::make_shared(); - ASSERT_NE(compPtr, nullptr); - compPtr->rect_.x_ = TEST_COORDINATE; - compPtr->rect_.y_ = TEST_COORDINATE; - compPtr->rect_.width_ = TEST_COORDINATE; - compPtr->rect_.height_ = TEST_COORDINATE; - SecCompEntity entity(compPtr, TEST_TOKEN_ID, TEST_SC_ID_1); - ASSERT_EQ(SecCompManager::GetInstance().AddSecurityComponentToList(TEST_PID_1, entity), SC_OK); - ASSERT_EQ(SecCompManager::GetInstance().GetSecurityComponentFromList(TEST_PID_1, TEST_SC_ID_2), nullptr); - ASSERT_NE(SecCompManager::GetInstance().GetSecurityComponentFromList(TEST_PID_1, TEST_SC_ID_1), nullptr); -} - -/** - * @tc.name: NotifyProcessBackground001 - * @tc.desc: Test notify process background - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompManagerTest, NotifyProcessBackground001, TestSize.Level1) -{ - SecCompManager::GetInstance().NotifyProcessBackground(TEST_PID_1); - - std::shared_ptr compPtr = std::make_shared(); - ASSERT_NE(compPtr, nullptr); - compPtr->rect_.x_ = TEST_COORDINATE; - compPtr->rect_.y_ = TEST_COORDINATE; - compPtr->rect_.width_ = TEST_COORDINATE; - compPtr->rect_.height_ = TEST_COORDINATE; - SecCompEntity entity(compPtr, TEST_TOKEN_ID, TEST_SC_ID_1); - ASSERT_EQ(SecCompManager::GetInstance().AddSecurityComponentToList(TEST_PID_1, entity), SC_OK); - auto component = SecCompManager::GetInstance().GetSecurityComponentFromList(TEST_PID_1, TEST_SC_ID_1); - ASSERT_NE(component, nullptr); - SecCompManager::GetInstance().NotifyProcessForeground(TEST_PID_1); - ASSERT_TRUE(SecCompManager::GetInstance().IsForegroundCompExist()); - - SecCompManager::GetInstance().NotifyProcessBackground(TEST_PID_1); - ASSERT_FALSE(SecCompManager::GetInstance().IsForegroundCompExist()); -} - -/** - * @tc.name: NotifyProcessDied001 - * @tc.desc: Test notify process died - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompManagerTest, NotifyProcessDied001, TestSize.Level1) -{ - std::shared_ptr compPtr = std::make_shared(); - ASSERT_NE(compPtr, nullptr); - compPtr->rect_.x_ = TEST_COORDINATE; - compPtr->rect_.y_ = TEST_COORDINATE; - compPtr->rect_.width_ = TEST_COORDINATE; - compPtr->rect_.height_ = TEST_COORDINATE; - SecCompEntity entity(compPtr, TEST_TOKEN_ID, TEST_SC_ID_1); - ASSERT_EQ(SecCompManager::GetInstance().AddSecurityComponentToList(TEST_PID_1, entity), SC_OK); - - std::shared_ptr compPtr2 = std::make_shared(); - ASSERT_NE(compPtr2, nullptr); - compPtr2->rect_.x_ = TEST_COORDINATE * 2; // not overlap - compPtr2->rect_.y_ = TEST_COORDINATE * 2; // not overlap - compPtr2->rect_.width_ = TEST_COORDINATE; - compPtr2->rect_.height_ = TEST_COORDINATE; - SecCompEntity entity2(compPtr2, TEST_TOKEN_ID, TEST_SC_ID_2); - ASSERT_EQ(SecCompManager::GetInstance().AddSecurityComponentToList(TEST_PID_2, entity2), SC_OK); - - SecCompManager::GetInstance().NotifyProcessDied(TEST_PID_3); - ASSERT_NE(SecCompManager::GetInstance().GetSecurityComponentFromList(TEST_PID_1, TEST_SC_ID_1), nullptr); - - SecCompManager::GetInstance().NotifyProcessDied(TEST_PID_1); - ASSERT_EQ(SecCompManager::GetInstance().GetSecurityComponentFromList(TEST_PID_1, TEST_SC_ID_1), nullptr); -} - -/** - * @tc.name: RegisterSecurityComponent001 - * @tc.desc: Test register security component - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompManagerTest, RegisterSecurityComponent001, TestSize.Level1) -{ - nlohmann::json jsonInvalid; - LocationButton buttonInvalid = BuildInvalidLocationComponent(); - buttonInvalid.ToJson(jsonInvalid); - int32_t scId; - SecCompCallerInfo caller = { - .tokenId = TEST_TOKEN_ID, - .pid = TEST_PID_1 - }; - ASSERT_EQ(SecCompManager::GetInstance().RegisterSecurityComponent(LOCATION_COMPONENT, jsonInvalid, caller, scId), - SC_SERVICE_ERROR_COMPONENT_INFO_INVALID); - - nlohmann::json jsonValid; - LocationButton buttonValid = BuildValidLocationComponent(); - buttonValid.ToJson(jsonValid); - - // callback check failed - ASSERT_EQ(SecCompManager::GetInstance().RegisterSecurityComponent( - LOCATION_COMPONENT, jsonValid, caller, scId), SC_ENHANCE_ERROR_CALLBACK_NOT_EXIST); - SecCompManager::GetInstance().maliciousAppList_.clear(); -} - -/** - * @tc.name: UpdateSecurityComponent001 - * @tc.desc: Test update security component - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompManagerTest, UpdateSecurityComponent001, TestSize.Level1) -{ - nlohmann::json jsonValid; - LocationButton buttonValid = BuildValidLocationComponent(); - buttonValid.ToJson(jsonValid); - SecCompCallerInfo caller = { - .tokenId = TEST_TOKEN_ID, - .pid = TEST_PID_1 - }; - ASSERT_NE(SecCompManager::GetInstance().UpdateSecurityComponent(TEST_SC_ID_1, jsonValid, caller), - SC_OK); -} - -/** - * @tc.name: UnregisterSecurityComponent001 - * @tc.desc: Test unregister security component - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompManagerTest, UnregisterSecurityComponent001, TestSize.Level1) -{ - SecCompCallerInfo caller = { - .tokenId = TEST_TOKEN_ID, - .pid = TEST_PID_1 - }; - - ASSERT_EQ(SecCompManager::GetInstance().UnregisterSecurityComponent(TEST_INVALID_SC_ID, caller), - SC_SERVICE_ERROR_VALUE_INVALID); -} - -/** - * @tc.name: ReportSecurityComponentClickEvent001 - * @tc.desc: Test report security component click - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompManagerTest, ReportSecurityComponentClickEvent001, TestSize.Level1) -{ - SecCompCallerInfo caller = { - .tokenId = TEST_TOKEN_ID, - .pid = TEST_PID_1 - }; - SecCompClickEvent touchInfo; - nlohmann::json jsonVaild; - LocationButton buttonValid = BuildValidLocationComponent(); - buttonValid.ToJson(jsonVaild); - ASSERT_NE(SecCompManager::GetInstance(). - ReportSecurityComponentClickEvent(1, jsonVaild, caller, touchInfo, nullptr), SC_OK); -} diff --git a/services/security_component_service/sa/test/unittest/src/sec_comp_manager_test.h b/services/security_component_service/sa/test/unittest/src/sec_comp_manager_test.h deleted file mode 100644 index eaf0968..0000000 --- a/services/security_component_service/sa/test/unittest/src/sec_comp_manager_test.h +++ /dev/null @@ -1,39 +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. - */ -#ifndef SEC_COMP_MANAGER_TEST_H -#define SEC_COMP_MANAGER_TEST_H - -#include -#define private public -#include "sec_comp_manager.h" -#undef private - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -class SecCompManagerTest : public testing::Test { -public: - static void SetUpTestCase(); - - static void TearDownTestCase(); - - void SetUp(); - - void TearDown(); -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // SEC_COMP_MANAGER_TEST_H diff --git a/services/security_component_service/sa/test/unittest/src/sec_comp_service_mock_test.cpp b/services/security_component_service/sa/test/unittest/src/sec_comp_service_mock_test.cpp deleted file mode 100644 index c430ebe..0000000 --- a/services/security_component_service/sa/test/unittest/src/sec_comp_service_mock_test.cpp +++ /dev/null @@ -1,365 +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 "sec_comp_service_test.h" -#include "ipc_skeleton.h" -#include "iservice_registry.h" -#include "location_button.h" -#include "mock_system_ability_proxy.h" -#include "mock_app_mgr_proxy.h" -#include "paste_button.h" -#include "save_button.h" -#include "sec_comp_err.h" -#include "sec_comp_log.h" -#include "sec_comp_tool.h" -#include "sec_comp_enhance_adapter.h" -#include "system_ability.h" -#include "token_setproc.h" - -using namespace testing::ext; -using namespace OHOS; -using namespace OHOS::Security::SecurityComponent; -using namespace OHOS::Security::AccessToken; - -namespace { -static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { - LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompServiceTest"}; - -static constexpr uint32_t HAP_TOKEN_ID = 537715419; -static constexpr int32_t SA_ID = 3506; -static constexpr double TEST_COORDINATE = 100.0; -static constexpr double TEST_SIZE = 100.0; -static constexpr uint32_t TEST_COLOR_YELLOW = 0xff7fff00; -static constexpr uint32_t TEST_COLOR_RED = 0xffff0000; -static constexpr uint32_t TEST_COLOR_BLUE = 0xff0000ff; -static constexpr uint64_t TIME_CONVERSION_UNIT = 1000; -static AccessTokenID g_selfTokenId = 0; - -static std::string BuildSaveComponentInfo() -{ - SaveButton button; - button.fontSize_ = TEST_SIZE; - button.iconSize_ = TEST_SIZE; - button.padding_.top = TEST_SIZE; - button.padding_.right = TEST_SIZE; - button.padding_.bottom = TEST_SIZE; - button.padding_.left = TEST_SIZE; - button.textIconSpace_ = TEST_SIZE; - button.fontColor_.value = TEST_COLOR_YELLOW; - button.iconColor_.value = TEST_COLOR_RED; - button.bgColor_.value = TEST_COLOR_BLUE; - button.borderWidth_ = TEST_SIZE; - button.type_ = SAVE_COMPONENT; - button.rect_.x_ = TEST_COORDINATE; - button.rect_.y_ = TEST_COORDINATE; - button.rect_.width_ = TEST_COORDINATE; - button.rect_.height_ = TEST_COORDINATE; - button.windowRect_.x_ = TEST_COORDINATE; - button.windowRect_.y_ = TEST_COORDINATE; - button.windowRect_.width_ = TEST_COORDINATE; - button.windowRect_.height_ = TEST_COORDINATE; - button.text_ = static_cast(SaveDesc::DOWNLOAD); - button.icon_ = static_cast(SaveIcon::LINE_ICON); - button.bg_ = SecCompBackground::CIRCLE; - - nlohmann::json jsonRes; - button.ToJson(jsonRes); - return jsonRes.dump(); -} -} - -void SecCompServiceTest::SetUpTestCase() -{} - -void SecCompServiceTest::TearDownTestCase() -{} - -void SecCompServiceTest::SetUp() -{ - SC_LOG_INFO(LABEL, "setup"); - if (secCompService_ != nullptr) { - return; - } - SecCompService* ptr = new (std::nothrow) SecCompService(SA_ID, true); - secCompService_ = sptr(ptr); - ASSERT_NE(nullptr, secCompService_); - secCompService_->appStateObserver_ = new (std::nothrow) AppStateObserver(); - ASSERT_TRUE(secCompService_->appStateObserver_ != nullptr); - g_selfTokenId = GetSelfTokenID(); -} - -void SecCompServiceTest::TearDown() -{ - if (secCompService_ != nullptr) { - secCompService_->appStateObserver_ = nullptr; - } - secCompService_ = nullptr; - EXPECT_EQ(0, SetSelfTokenID(g_selfTokenId)); -} - -/** - * @tc.name: RegisterSecurityComponent001 - * @tc.desc: Test register security component - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompServiceTest, RegisterSecurityComponent001, TestSize.Level1) -{ - // get caller fail - int32_t scId; - secCompService_->state_ = ServiceRunningState::STATE_RUNNING; - secCompService_->Initialize(); - EXPECT_EQ(secCompService_->RegisterSecurityComponent(SAVE_COMPONENT, "", scId), - SC_SERVICE_ERROR_VALUE_INVALID); - - // parse component json fail - ASSERT_EQ(SetSelfTokenID(HAP_TOKEN_ID), 0); - AppExecFwk::AppStateData stateData = { - .uid = getuid() - }; - secCompService_->appStateObserver_->AddProcessToForegroundSet(stateData); - EXPECT_EQ(secCompService_->RegisterSecurityComponent(SAVE_COMPONENT, "{a=", scId), - SC_SERVICE_ERROR_VALUE_INVALID); // wrong json - - // register security component ok - EXPECT_EQ(secCompService_->RegisterSecurityComponent(SAVE_COMPONENT, BuildSaveComponentInfo(), scId), - SC_OK); - EXPECT_EQ(secCompService_->UpdateSecurityComponent(scId, BuildSaveComponentInfo()), - SC_OK); - struct SecCompClickEvent touch = { - .touchX = 100, - .touchY = 100, - .timestamp = static_cast( - std::chrono::high_resolution_clock::now().time_since_epoch().count()) / TIME_CONVERSION_UNIT - }; - - EXPECT_EQ(secCompService_->ReportSecurityComponentClickEvent(scId, BuildSaveComponentInfo(), touch, nullptr), - SC_OK); - sleep(5); - EXPECT_EQ(secCompService_->UnregisterSecurityComponent(scId), SC_OK); -} - -/** - * @tc.name: RegisterSecurityComponent002 - * @tc.desc: Test register security component check touch info failed - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompServiceTest, RegisterSecurityComponent002, TestSize.Level1) -{ - int32_t scId; - secCompService_->state_ = ServiceRunningState::STATE_RUNNING; - secCompService_->Initialize(); - - ASSERT_EQ(SetSelfTokenID(HAP_TOKEN_ID), 0); - AppExecFwk::AppStateData stateData = { - .uid = getuid() - }; - secCompService_->appStateObserver_->AddProcessToForegroundSet(stateData); - // register security component ok - EXPECT_EQ(secCompService_->RegisterSecurityComponent(SAVE_COMPONENT, BuildSaveComponentInfo(), scId), - SC_OK); - struct SecCompClickEvent touch = { - .touchX = 100, - .touchY = 100, - .timestamp = static_cast( - std::chrono::high_resolution_clock::now().time_since_epoch().count()) - }; - EXPECT_EQ(secCompService_->ReportSecurityComponentClickEvent(scId, BuildSaveComponentInfo(), touch, nullptr), - SC_SERVICE_ERROR_CLICK_EVENT_INVALID); - EXPECT_EQ(secCompService_->UnregisterSecurityComponent(scId), SC_OK); -} - -/** - * @tc.name: RegisterSecurityComponent003 - * @tc.desc: Test register security component permission grant failed - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompServiceTest, RegisterSecurityComponent003, TestSize.Level1) -{ - int32_t scId; - secCompService_->state_ = ServiceRunningState::STATE_RUNNING; - secCompService_->Initialize(); - - ASSERT_EQ(SetSelfTokenID(0), 0); - AppExecFwk::AppStateData stateData = { - .uid = getuid() - }; - secCompService_->appStateObserver_->AddProcessToForegroundSet(stateData); - // register security component ok - EXPECT_EQ(secCompService_->RegisterSecurityComponent(SAVE_COMPONENT, BuildSaveComponentInfo(), scId), - SC_OK); - struct SecCompClickEvent touch = { - .touchX = 100, - .touchY = 100, - .timestamp = static_cast( - std::chrono::high_resolution_clock::now().time_since_epoch().count()) / TIME_CONVERSION_UNIT - }; - EXPECT_EQ(secCompService_->ReportSecurityComponentClickEvent(scId, BuildSaveComponentInfo(), touch, nullptr), - SC_SERVICE_ERROR_PERMISSION_OPER_FAIL); - EXPECT_EQ(secCompService_->UnregisterSecurityComponent(scId), SC_OK); -} - -/** - * @tc.name: ReportSecurityComponentClickEvent001 - * @tc.desc: Test register security component - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompServiceTest, ReportSecurityComponentClickEvent001, TestSize.Level1) -{ - int32_t scId; - secCompService_->state_ = ServiceRunningState::STATE_RUNNING; - secCompService_->Initialize(); - - ASSERT_EQ(SetSelfTokenID(HAP_TOKEN_ID), 0); - AppExecFwk::AppStateData stateData = { - .uid = getuid() - }; - secCompService_->appStateObserver_->AddProcessToForegroundSet(stateData); - // register security component ok - EXPECT_EQ(secCompService_->RegisterSecurityComponent(SAVE_COMPONENT, BuildSaveComponentInfo(), scId), - SC_OK); - struct SecCompClickEvent touchInfo = { - .touchX = 100, - .touchY = 100, - .timestamp = static_cast( - std::chrono::high_resolution_clock::now().time_since_epoch().count()) / TIME_CONVERSION_UNIT - }; - - ASSERT_EQ(SC_OK, - secCompService_->ReportSecurityComponentClickEvent(scId, BuildSaveComponentInfo(), touchInfo, nullptr)); - - ASSERT_TRUE(secCompService_->ReduceAfterVerifySavePermission(HAP_TOKEN_ID)); - - ASSERT_FALSE(secCompService_->ReduceAfterVerifySavePermission(HAP_TOKEN_ID)); - - ASSERT_EQ(secCompService_->ReportSecurityComponentClickEvent(scId, BuildSaveComponentInfo(), touchInfo, nullptr), - SC_OK); - sleep(6); - ASSERT_FALSE(secCompService_->ReduceAfterVerifySavePermission(HAP_TOKEN_ID)); - EXPECT_EQ(secCompService_->UnregisterSecurityComponent(scId), SC_OK); -} - -/** - * @tc.name: ReportSecurityComponentClickEvent002 - * @tc.desc: Test report security component click with save button - * @tc.type: FUNC - * @tc.require: AR000HO9IN - */ -HWTEST_F(SecCompServiceTest, ReportSecurityComponentClickEvent002, TestSize.Level1) -{ - int32_t scId; - secCompService_->state_ = ServiceRunningState::STATE_RUNNING; - secCompService_->Initialize(); - - ASSERT_EQ(SetSelfTokenID(HAP_TOKEN_ID), 0); - AppExecFwk::AppStateData stateData = { - .uid = getuid() - }; - secCompService_->appStateObserver_->AddProcessToForegroundSet(stateData); - // register security component ok - EXPECT_EQ(secCompService_->RegisterSecurityComponent(SAVE_COMPONENT, BuildSaveComponentInfo(), scId), - SC_OK); - struct SecCompClickEvent touchInfo = { - .touchX = 100, - .touchY = 100, - .timestamp = static_cast( - std::chrono::high_resolution_clock::now().time_since_epoch().count()) / TIME_CONVERSION_UNIT - }; - - ASSERT_EQ(secCompService_->ReportSecurityComponentClickEvent(scId, BuildSaveComponentInfo(), touchInfo, nullptr), - SC_OK); - ASSERT_EQ(secCompService_->ReportSecurityComponentClickEvent(scId, BuildSaveComponentInfo(), touchInfo, nullptr), - SC_OK); - - ASSERT_TRUE(secCompService_->ReduceAfterVerifySavePermission(HAP_TOKEN_ID)); - ASSERT_TRUE(secCompService_->ReduceAfterVerifySavePermission(HAP_TOKEN_ID)); - ASSERT_FALSE(secCompService_->ReduceAfterVerifySavePermission(HAP_TOKEN_ID)); - - ASSERT_EQ(secCompService_->ReportSecurityComponentClickEvent(scId, BuildSaveComponentInfo(), touchInfo, nullptr), - SC_OK); - sleep(3); - touchInfo.timestamp = static_cast( - std::chrono::high_resolution_clock::now().time_since_epoch().count()) / TIME_CONVERSION_UNIT; - ASSERT_EQ(secCompService_->ReportSecurityComponentClickEvent(scId, BuildSaveComponentInfo(), touchInfo, nullptr), - SC_OK); - sleep(3); - ASSERT_TRUE(secCompService_->ReduceAfterVerifySavePermission(HAP_TOKEN_ID)); - ASSERT_FALSE(secCompService_->ReduceAfterVerifySavePermission(HAP_TOKEN_ID)); - - touchInfo.timestamp = static_cast( - std::chrono::high_resolution_clock::now().time_since_epoch().count()) / TIME_CONVERSION_UNIT; - ASSERT_EQ(secCompService_->ReportSecurityComponentClickEvent(scId, BuildSaveComponentInfo(), touchInfo, nullptr), - SC_OK); - sleep(3); - touchInfo.timestamp = static_cast( - std::chrono::high_resolution_clock::now().time_since_epoch().count()) / TIME_CONVERSION_UNIT;; - ASSERT_EQ(secCompService_->ReportSecurityComponentClickEvent(scId, BuildSaveComponentInfo(), touchInfo, nullptr), - SC_OK); - ASSERT_TRUE(secCompService_->ReduceAfterVerifySavePermission(HAP_TOKEN_ID)); - sleep(3); - ASSERT_TRUE(secCompService_->ReduceAfterVerifySavePermission(HAP_TOKEN_ID)); - ASSERT_FALSE(secCompService_->ReduceAfterVerifySavePermission(HAP_TOKEN_ID)); -} - -/** - * @tc.name: ReportSecurityComponentClickEvent003 - * @tc.desc: Test report security component click twice with save button - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompServiceTest, ReportSecurityComponentClickEvent003, TestSize.Level1) -{ - int32_t scId; - secCompService_->state_ = ServiceRunningState::STATE_RUNNING; - secCompService_->Initialize(); - - ASSERT_EQ(SetSelfTokenID(HAP_TOKEN_ID), 0); - AppExecFwk::AppStateData stateData = { - .uid = getuid() - }; - secCompService_->appStateObserver_->AddProcessToForegroundSet(stateData); - // register security component ok - EXPECT_EQ(secCompService_->RegisterSecurityComponent(SAVE_COMPONENT, BuildSaveComponentInfo(), scId), - SC_OK); - struct SecCompClickEvent touchInfo = { - .touchX = 100, - .touchY = 100, - .timestamp = static_cast( - std::chrono::high_resolution_clock::now().time_since_epoch().count()) / TIME_CONVERSION_UNIT - }; - - ASSERT_EQ(secCompService_->ReportSecurityComponentClickEvent(scId, BuildSaveComponentInfo(), touchInfo, nullptr), - SC_OK); - sleep(3); - touchInfo.timestamp = static_cast( - std::chrono::high_resolution_clock::now().time_since_epoch().count()) / TIME_CONVERSION_UNIT; - ASSERT_EQ(secCompService_->ReportSecurityComponentClickEvent(scId, BuildSaveComponentInfo(), touchInfo, nullptr), - SC_OK); - sleep(6); - ASSERT_FALSE(secCompService_->ReduceAfterVerifySavePermission(HAP_TOKEN_ID)); - - touchInfo.timestamp = static_cast( - std::chrono::high_resolution_clock::now().time_since_epoch().count()) / TIME_CONVERSION_UNIT; - ASSERT_EQ(secCompService_->ReportSecurityComponentClickEvent(scId, BuildSaveComponentInfo(), touchInfo, nullptr), - SC_OK); - ASSERT_TRUE(secCompService_->ReduceAfterVerifySavePermission(HAP_TOKEN_ID)); - ASSERT_EQ(secCompService_->ReportSecurityComponentClickEvent(scId, BuildSaveComponentInfo(), touchInfo, nullptr), - SC_OK); - sleep(3); - ASSERT_TRUE(secCompService_->ReduceAfterVerifySavePermission(HAP_TOKEN_ID)); - ASSERT_FALSE(secCompService_->ReduceAfterVerifySavePermission(HAP_TOKEN_ID)); -} diff --git a/services/security_component_service/sa/test/unittest/src/sec_comp_service_test.cpp b/services/security_component_service/sa/test/unittest/src/sec_comp_service_test.cpp deleted file mode 100644 index 5b6fe8e..0000000 --- a/services/security_component_service/sa/test/unittest/src/sec_comp_service_test.cpp +++ /dev/null @@ -1,307 +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 "sec_comp_service_test.h" -#include "ipc_skeleton.h" -#include "iservice_registry.h" -#include "location_button.h" -#include "mock_system_ability_proxy.h" -#include "mock_app_mgr_proxy.h" -#include "paste_button.h" -#include "save_button.h" -#include "sec_comp_err.h" -#include "sec_comp_log.h" -#include "sec_comp_tool.h" -#include "system_ability.h" -#include "token_setproc.h" - -using namespace testing::ext; -using namespace OHOS; -using namespace OHOS::Security::SecurityComponent; -using namespace OHOS::Security::AccessToken; - -namespace { -static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { - LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompServiceTest"}; - -static constexpr uint32_t HAP_TOKEN_ID = 537715419; -static constexpr int32_t SA_ID = 3506; -static constexpr int32_t TEST_SC_ID = 1; -static AccessTokenID g_selfTokenId = 0; -static constexpr double TEST_COORDINATE = 100.0; -static constexpr double TEST_SIZE = 100.0; -static constexpr uint32_t TEST_COLOR_YELLOW = 0xff7fff00; -static constexpr uint32_t TEST_COLOR_RED = 0xffff0000; -static constexpr uint32_t TEST_COLOR_BLUE = 0xff0000ff; -static constexpr uint64_t TIME_CONVERSION_UNIT = 1000; - -static std::string BuildLocationComponentInfo() -{ - LocationButton button; - button.fontSize_ = TEST_SIZE; - button.iconSize_ = TEST_SIZE; - button.padding_.top = TEST_SIZE; - button.padding_.right = TEST_SIZE; - button.padding_.bottom = TEST_SIZE; - button.padding_.left = TEST_SIZE; - button.textIconSpace_ = TEST_SIZE; - button.fontColor_.value = TEST_COLOR_YELLOW; - button.iconColor_.value = TEST_COLOR_RED; - button.bgColor_.value = TEST_COLOR_BLUE; - button.borderWidth_ = TEST_SIZE; - button.type_ = LOCATION_COMPONENT; - button.rect_.x_ = TEST_COORDINATE; - button.rect_.y_ = TEST_COORDINATE; - button.rect_.width_ = TEST_COORDINATE; - button.rect_.height_ = TEST_COORDINATE; - button.windowRect_.x_ = TEST_COORDINATE; - button.windowRect_.y_ = TEST_COORDINATE; - button.windowRect_.width_ = TEST_COORDINATE; - button.windowRect_.height_ = TEST_COORDINATE; - button.text_ = static_cast(LocationDesc::SELECT_LOCATION); - button.icon_ = static_cast(LocationIcon::LINE_ICON); - button.bg_ = SecCompBackground::CIRCLE; - - nlohmann::json jsonRes; - button.ToJson(jsonRes); - return jsonRes.dump(); -} -} - -void SecCompServiceTest::SetUpTestCase() -{} - -void SecCompServiceTest::TearDownTestCase() -{} - -void SecCompServiceTest::SetUp() -{ - SC_LOG_INFO(LABEL, "setup"); - if (secCompService_ != nullptr) { - return; - } - SecCompService* ptr = new (std::nothrow) SecCompService(SA_ID, true); - secCompService_ = sptr(ptr); - ASSERT_NE(nullptr, secCompService_); - secCompService_->appStateObserver_ = new (std::nothrow) AppStateObserver(); - ASSERT_TRUE(secCompService_->appStateObserver_ != nullptr); - g_selfTokenId = GetSelfTokenID(); -} - -void SecCompServiceTest::TearDown() -{ - if (secCompService_ != nullptr) { - secCompService_->appStateObserver_ = nullptr; - } - secCompService_ = nullptr; - EXPECT_EQ(0, SetSelfTokenID(g_selfTokenId)); -} - -/** - * @tc.name: Onstart001 - * @tc.desc: Test OnStart - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompServiceTest, OnStart001, TestSize.Level1) -{ - secCompService_->state_ = ServiceRunningState::STATE_RUNNING; - secCompService_->appStateObserver_ = nullptr; - secCompService_->OnStart(); - ASSERT_EQ(secCompService_->appStateObserver_, nullptr); - EXPECT_CALL(*secCompService_, Publish(testing::_)).WillOnce(testing::Return(false)); - - secCompService_->state_ = ServiceRunningState::STATE_NOT_START; - secCompService_->appStateObserver_ = new (std::nothrow) AppStateObserver(); - secCompService_->OnStart(); - ASSERT_EQ(secCompService_->state_, ServiceRunningState::STATE_RUNNING); - - secCompService_->OnStop(); - ASSERT_EQ(secCompService_->appStateObserver_, nullptr); -} - -/** - * @tc.name: RegisterAppStateObserver001 - * @tc.desc: Test RegisterAppStateObserver - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompServiceTest, RegisterAppStateObserver001, TestSize.Level1) -{ - // GetSystemAbilityManager get failed - secCompService_->appStateObserver_ = nullptr; - std::shared_ptr saClient = std::make_shared(); - ASSERT_NE(saClient, nullptr); - SystemAbilityManagerClient::clientInstance = saClient.get(); - EXPECT_CALL(*saClient, GetSystemAbilityManager()).WillOnce(testing::Return(nullptr)); - EXPECT_FALSE(secCompService_->RegisterAppStateObserver()); - - // GetSystemAbility get app mgr failed - secCompService_->appStateObserver_ = nullptr; - SystemAbilityManagerProxy proxy(nullptr); - EXPECT_CALL(*saClient, GetSystemAbilityManager()).WillOnce(testing::Return(&proxy)); - EXPECT_FALSE(secCompService_->RegisterAppStateObserver()); - - // RegisterApplicationStateObserver failed - secCompService_->appStateObserver_ = nullptr; - EXPECT_CALL(*saClient, GetSystemAbilityManager()).WillOnce(testing::Return(&proxy)); - MockIRemoteObject object; - EXPECT_CALL(proxy, GetSystemAbility(testing::_)).WillOnce(testing::Return(&object)); - sptr appProxy = new (std::nothrow) MockAppMgrProxy(nullptr); - MockAppMgrProxy::g_MockAppMgrProxy = appProxy; - EXPECT_CALL(*MockAppMgrProxy::g_MockAppMgrProxy, - RegisterApplicationStateObserver(testing::_, testing::_)).WillOnce(testing::Return(-1)); - EXPECT_FALSE(secCompService_->RegisterAppStateObserver()); - - // GetForegroundApplications failed - secCompService_->appStateObserver_ = nullptr; - EXPECT_CALL(*saClient, GetSystemAbilityManager()).WillOnce(testing::Return(&proxy)); - EXPECT_CALL(proxy, GetSystemAbility(testing::_)).WillOnce(testing::Return(&object)); - EXPECT_CALL(*MockAppMgrProxy::g_MockAppMgrProxy, - RegisterApplicationStateObserver(testing::_, testing::_)).WillOnce(testing::Return(0)); - EXPECT_CALL(*MockAppMgrProxy::g_MockAppMgrProxy, - GetForegroundApplications(testing::_)).WillOnce(testing::Return(-1)); - EXPECT_TRUE(secCompService_->RegisterAppStateObserver()); - EXPECT_EQ(secCompService_->appStateObserver_->foregrandProcList_.size(), static_cast(0)); - - // get one foreground app - secCompService_->appStateObserver_ = nullptr; - EXPECT_CALL(*saClient, GetSystemAbilityManager()).WillOnce(testing::Return(&proxy)); - EXPECT_CALL(proxy, GetSystemAbility(testing::_)).WillOnce(testing::Return(&object)); - EXPECT_CALL(*MockAppMgrProxy::g_MockAppMgrProxy, - RegisterApplicationStateObserver(testing::_, testing::_)).WillOnce(testing::Return(0)); - EXPECT_CALL(*MockAppMgrProxy::g_MockAppMgrProxy, GetForegroundApplications(testing::_)) - .WillOnce([](std::vector& list) { - AppExecFwk::AppStateData data; - data.uid = 1000; - list.emplace_back(data); - return 0; - }); - EXPECT_TRUE(secCompService_->RegisterAppStateObserver()); - EXPECT_EQ(secCompService_->appStateObserver_->foregrandProcList_.size(), static_cast(1)); - secCompService_->UnregisterAppStateObserver(); - SystemAbilityManagerClient::clientInstance = nullptr; -} - -/** - * @tc.name: UnregisterAppStateObserver001 - * @tc.desc: Test RegisterAppStateObserver - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompServiceTest, UnregisterAppStateObserver001, TestSize.Level1) -{ - // GetSystemAbilityManager get failed - secCompService_->appStateObserver_ = nullptr; - sptr appProxy = new (std::nothrow) MockAppMgrProxy(nullptr); - secCompService_->iAppMgr_ = appProxy; - - EXPECT_CALL(*appProxy, UnregisterApplicationStateObserver(testing::_)).Times(testing::Exactly(0)); - secCompService_->UnregisterAppStateObserver(); -} - -/** - * @tc.name: GetCallerInfo001 - * @tc.desc: Test get caller info - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompServiceTest, GetCallerInfo001, TestSize.Level1) -{ - // not root uid - setuid(1); - SecCompCallerInfo caller; - EXPECT_FALSE(secCompService_->GetCallerInfo(caller)); - - // set token id to hap token, but uid is not in foreground - EXPECT_FALSE(secCompService_->GetCallerInfo(caller)); - setuid(0); - ASSERT_EQ(SetSelfTokenID(HAP_TOKEN_ID), 0); - // add local uid to foreground. - AppExecFwk::AppStateData stateData = { - .uid = getuid() - }; - secCompService_->appStateObserver_->AddProcessToForegroundSet(stateData); - EXPECT_TRUE(secCompService_->GetCallerInfo(caller)); -} - -/** - * @tc.name: UnregisterSecurityComponent001 - * @tc.desc: Test unregister security component - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompServiceTest, UnregisterSecurityComponent001, TestSize.Level1) -{ - // get caller fail - EXPECT_EQ(secCompService_->UnregisterSecurityComponent(TEST_SC_ID), SC_SERVICE_ERROR_COMPONENT_NOT_EXIST); -} - -/** - * @tc.name: UpdateSecurityComponent001 - * @tc.desc: Test update security component - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompServiceTest, UpdateSecurityComponent001, TestSize.Level1) -{ - // get caller fail - EXPECT_EQ(secCompService_->UpdateSecurityComponent(TEST_SC_ID, ""), SC_SERVICE_ERROR_VALUE_INVALID); - - ASSERT_EQ(SetSelfTokenID(HAP_TOKEN_ID), 0); - AppExecFwk::AppStateData stateData = { - .uid = getuid() - }; - secCompService_->appStateObserver_->AddProcessToForegroundSet(stateData); - EXPECT_EQ(secCompService_->UpdateSecurityComponent(TEST_SC_ID, "{a"), SC_SERVICE_ERROR_VALUE_INVALID); -} - -/** - * @tc.name: ReportSecurityComponentClickEvent001 - * @tc.desc: Test report security component - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompServiceTest, ReportSecurityComponentClickEvent001, TestSize.Level1) -{ - auto uid = getuid(); - // get caller fail - int32_t scId; - EXPECT_EQ(secCompService_->RegisterSecurityComponent(LOCATION_COMPONENT, "", scId), - SC_SERVICE_ERROR_VALUE_INVALID); - - // parse component json fail - ASSERT_EQ(SetSelfTokenID(HAP_TOKEN_ID), 0); - setuid(100); - AppExecFwk::AppStateData stateData = { - .uid = getuid() - }; - secCompService_->appStateObserver_->AddProcessToForegroundSet(stateData); - - EXPECT_EQ(secCompService_->RegisterSecurityComponent(LOCATION_COMPONENT, BuildLocationComponentInfo(), scId), - SC_ENHANCE_ERROR_CALLBACK_NOT_EXIST); - uint8_t data[16] = { 0 }; - struct SecCompClickEvent touch = { - .touchX = 100, - .touchY = 100, - .timestamp = static_cast( - std::chrono::high_resolution_clock::now().time_since_epoch().count()) / TIME_CONVERSION_UNIT, - .extraInfo.data = data, - .extraInfo.dataSize = 16, - }; - EXPECT_EQ(secCompService_->ReportSecurityComponentClickEvent(scId, BuildLocationComponentInfo(), touch, nullptr), - SC_ENHANCE_ERROR_IN_MALICIOUS_LIST); - EXPECT_EQ(secCompService_->UnregisterSecurityComponent(scId), SC_SERVICE_ERROR_COMPONENT_NOT_EXIST); - setuid(uid); -} diff --git a/services/security_component_service/sa/test/unittest/src/sec_comp_service_test.h b/services/security_component_service/sa/test/unittest/src/sec_comp_service_test.h deleted file mode 100644 index 4786c06..0000000 --- a/services/security_component_service/sa/test/unittest/src/sec_comp_service_test.h +++ /dev/null @@ -1,42 +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. - */ - -#ifndef SEC_COMP_SERVICE_TEST_H -#define SEC_COMP_SERVICE_TEST_H - -#include -#define private public -#include "sec_comp_service.h" -#undef private - -namespace OHOS { -namespace Security { -namespace SecurityComponent { -class SecCompServiceTest : public testing::Test { -public: - static void SetUpTestCase(); - - static void TearDownTestCase(); - - void SetUp(); - - void TearDown(); - - sptr secCompService_ = nullptr; -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // SEC_COMP_SERVICE_TEST_H diff --git a/services/security_component_service/sa/test/unittest/src/sec_comp_stub_test.cpp b/services/security_component_service/sa/test/unittest/src/sec_comp_stub_test.cpp deleted file mode 100644 index d29720d..0000000 --- a/services/security_component_service/sa/test/unittest/src/sec_comp_stub_test.cpp +++ /dev/null @@ -1,177 +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 "sec_comp_stub_test.h" -#include "sec_comp_log.h" -#include "sec_comp_err.h" -#include "sec_comp_click_event_parcel.h" - -using namespace testing::ext; -using namespace OHOS; -using namespace OHOS::Security::SecurityComponent; - -namespace { -static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { - LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompStubTest"}; -} - -void SecCompStubTest::SetUpTestCase() -{} - -void SecCompStubTest::TearDownTestCase() -{} - -void SecCompStubTest::SetUp() -{ - SC_LOG_INFO(LABEL, "setup"); - if (stub_ != nullptr) { - return; - } - - stub_ = new (std::nothrow) SecCompStubMock(); - ASSERT_NE(nullptr, stub_); -} - -void SecCompStubTest::TearDown() -{ - stub_ = nullptr; -} - -/** - * @tc.name: OnRemoteRequest001 - * @tc.desc: Test on remote request - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompStubTest, OnRemoteRequest001, TestSize.Level1) -{ - MessageParcel data; - MessageParcel reply; - MessageOption option; - - data.WriteInterfaceToken(u"wrong"); - ASSERT_EQ(stub_->OnRemoteRequest( - static_cast(SecurityComponentServiceInterfaceCode::REGISTER_SECURITY_COMPONENT), - data, reply, option), SC_SERVICE_ERROR_IPC_REQUEST_FAIL); - - data.WriteInterfaceToken(u"ohos.security.ISecCompService"); - ASSERT_EQ(stub_->OnRemoteRequest( - static_cast(SecurityComponentServiceInterfaceCode::REGISTER_SECURITY_COMPONENT), - data, reply, option), SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL); - - data.WriteInterfaceToken(u"ohos.security.ISecCompService"); - ASSERT_EQ(stub_->OnRemoteRequest(1000, data, reply, option), 305); -} - -/** - * @tc.name: RegisterSecurityComponentInner001 - * @tc.desc: Test register security component - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompStubTest, RegisterSecurityComponentInner001, TestSize.Level1) -{ - MessageParcel data; - MessageParcel reply; - - ASSERT_EQ(stub_->RegisterSecurityComponentInner(data, reply), SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL); - - data.WriteUint32(UNKNOWN_SC_TYPE); - ASSERT_EQ(stub_->RegisterSecurityComponentInner(data, reply), SC_SERVICE_ERROR_VALUE_INVALID); - - data.WriteUint32(MAX_SC_TYPE); - ASSERT_EQ(stub_->RegisterSecurityComponentInner(data, reply), SC_SERVICE_ERROR_VALUE_INVALID); - - data.WriteUint32(LOCATION_COMPONENT); - ASSERT_EQ(stub_->RegisterSecurityComponentInner(data, reply), SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL); - - data.WriteUint32(LOCATION_COMPONENT); - data.WriteString(""); - ASSERT_EQ(stub_->RegisterSecurityComponentInner(data, reply), SC_OK); -} - -/** - * @tc.name: UpdateSecurityComponentInner001 - * @tc.desc: Test update security component - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompStubTest, UpdateSecurityComponentInner001, TestSize.Level1) -{ - MessageParcel data; - MessageParcel reply; - - ASSERT_EQ(stub_->UpdateSecurityComponentInner(data, reply), SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL); - - data.WriteInt32(-1); - ASSERT_EQ(stub_->UpdateSecurityComponentInner(data, reply), SC_SERVICE_ERROR_VALUE_INVALID); - - data.WriteInt32(1); - ASSERT_EQ(stub_->UpdateSecurityComponentInner(data, reply), SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL); - - data.WriteInt32(1); - data.WriteString(""); - ASSERT_EQ(stub_->UpdateSecurityComponentInner(data, reply), SC_OK); -} - -/** - * @tc.name: UnregisterSecurityComponentInner001 - * @tc.desc: Test unregister security component - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompStubTest, UnregisterSecurityComponentInner001, TestSize.Level1) -{ - MessageParcel data; - MessageParcel reply; - ASSERT_EQ(stub_->UnregisterSecurityComponentInner(data, reply), SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL); - - data.WriteInt32(-1); - ASSERT_EQ(stub_->UnregisterSecurityComponentInner(data, reply), SC_SERVICE_ERROR_VALUE_INVALID); - - data.WriteInt32(1); - ASSERT_EQ(stub_->UnregisterSecurityComponentInner(data, reply), SC_OK); -} - -/** - * @tc.name: ReportSecurityComponentClickEventInner001 - * @tc.desc: Test report click event - * @tc.type: FUNC - * @tc.require: AR000HO9J7 - */ -HWTEST_F(SecCompStubTest, ReportSecurityComponentClickEventInner001, TestSize.Level1) -{ - MessageParcel data; - MessageParcel reply; - ASSERT_EQ(stub_->ReportSecurityComponentClickEventInner(data, reply), SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL); - - data.WriteInt32(-1); - ASSERT_EQ(stub_->ReportSecurityComponentClickEventInner(data, reply), SC_SERVICE_ERROR_VALUE_INVALID); - - data.WriteInt32(1); - ASSERT_EQ(stub_->ReportSecurityComponentClickEventInner(data, reply), SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL); - - data.WriteInt32(1); - data.WriteString(""); - ASSERT_EQ(stub_->ReportSecurityComponentClickEventInner(data, reply), SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL); - - data.WriteInt32(1); - data.WriteString(""); - SecCompClickEvent touchInfo; - sptr parcel = new (std::nothrow) SecCompClickEventParcel(); - parcel->touchInfoParams_ = touchInfo; - data.WriteParcelable(parcel); - ASSERT_EQ(stub_->ReportSecurityComponentClickEventInner(data, reply), SC_OK); -} diff --git a/services/security_component_service/sa/test/unittest/src/sec_comp_stub_test.h b/services/security_component_service/sa/test/unittest/src/sec_comp_stub_test.h deleted file mode 100644 index e56866c..0000000 --- a/services/security_component_service/sa/test/unittest/src/sec_comp_stub_test.h +++ /dev/null @@ -1,79 +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. - */ - -#ifndef SEC_COMP_STUB_TEST_H -#define SEC_COMP_STUB_TEST_H - -#include -#define private public -#include "sec_comp_stub.h" -#undef private - -namespace OHOS { -namespace Security { -namespace SecurityComponent { - -// stub is abstract class -struct SecCompStubMock : public SecCompStub { -public: - int32_t RegisterSecurityComponent(SecCompType type, - const std::string& componentInfo, int32_t& scId) override - { - return 0; - }; - - int32_t UpdateSecurityComponent(int32_t scId, const std::string& componentInfo) override - { - return 0; - }; - - int32_t UnregisterSecurityComponent(int32_t scId) override - { - return 0; - }; - - int32_t ReportSecurityComponentClickEvent(int32_t scId, const std::string& componentInfo, - const SecCompClickEvent& touchInfo, sptr callerToken) override - { - return 0; - }; - - bool ReduceAfterVerifySavePermission(AccessToken::AccessTokenID tokenId) override - { - return true; - } - - sptr GetEnhanceRemoteObject() override - { - return nullptr; - } -}; - -class SecCompStubTest : public testing::Test { -public: - static void SetUpTestCase(); - - static void TearDownTestCase(); - - void SetUp(); - - void TearDown(); - - sptr stub_ = nullptr; -}; -} // namespace SecurityComponent -} // namespace Security -} // namespace OHOS -#endif // SEC_COMP_STUB_TEST_H diff --git a/test/dts/location_button.d.ts b/test/dts/location_button.d.ts deleted file mode 100644 index 1f0deaf..0000000 --- a/test/dts/location_button.d.ts +++ /dev/null @@ -1,263 +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. - */ - -/** - * Enumerates the icon styles. - * - * @enum { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ -declare enum LocationIconStyle { - /** - * Icon filled with the specified color. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - FULL_FILLED = 0, - - /** - * Icon rendered as lines. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - LINES = 1 -} - -/** - * Enumerates the text that can be displayed on the location button. - * - * @enum { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ -declare enum LocationDescription { - /** - * Current Location - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - CURRENT_LOCATION = 0, - - /** - * Add Location - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - ADD_LOCATION = 1, - - /** - * Select Location - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - SELECT_LOCATION = 2, - - /** - * Share Location - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - SHARE_LOCATION = 3, - - /** - * Send Location - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - SEND_LOCATION = 4, - - /** - * Locating - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - LOCATING = 5, - - /** - * Location - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - LOCATION = 6, - - /** - * Send Current Location - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - SEND_CURRENT_LOCATION = 7, - - /** - * Relocation - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - RELOCATION = 8, - - /** - * Punch In - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - PUNCH_IN = 9, - - /** - * Current Position - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - CURRENT_POSITION = 10 -} - -/** - * Declares the interface for setting the location button options. - * - * @interface LocationButtonOptions - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ -declare interface LocationButtonOptions { - /** - * Style of the icon to be drawn. - * - * @type { ?LocationIconStyle } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - icon?: LocationIconStyle; - - /** - * Text to be displayed on the button. - * - * @type { ?LocationDescription } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - text?: LocationDescription; - - /** - * Type of the button. - * - * @type { ?ButtonType } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - buttonType?: ButtonType; -} - -/** - * Enumerates the click event results of the location button. - * - * @enum { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ -declare enum LocationButtonOnClickResult { - /** - * Success. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - SUCCESS = 0, - - /** - * Failure because the application is not temporarily authorized for accessing location data. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - TEMPORARY_AUTHORIZATION_FAILED = 1 -} - -/** - * Defines the interface for setting a location button. - * - * @interface LocationButtonInterface - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ -interface LocationButtonInterface { - /** - * Creates a location button. - * - * @returns { LocationButtonAttribute } TReturns the attribute of the location button. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - (): LocationButtonAttribute; - - /** - * Creates a location button with the specified composition. - * If an attribute is not set, the corresponding element will not be drawn. - * - * @param { LocationButtonOptions } options - Indicates the options of the location button. - * @returns { LocationButtonAttribute } Returns the attribute of the location button. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - (options: LocationButtonOptions): LocationButtonAttribute; -} - -/** - * Defines the attributes of the location button. - * - * @extends SecurityComponentMethod - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ -declare class LocationButtonAttribute extends SecurityComponentMethod { - /** - * Called when the location button is clicked. - * - * @param { (event: ClickEvent, result: LocationButtonOnClickResult) => void } event - Indicates the - * click event result. - * @returns { LocationButtonAttribute } Returns the attribute of the location button. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - onClick(event: (event: ClickEvent, result: LocationButtonOnClickResult) => void): LocationButtonAttribute; -} - -/** - * Defines a button that interacts with the security component service to - * request the authorization for accessing location data. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ -declare const LocationButton: LocationButtonInterface; - -/** - * Defines a location button instance for secure access. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ -declare const LocationButtonInstance: LocationButtonAttribute; diff --git a/test/dts/paste_button.d.ts b/test/dts/paste_button.d.ts deleted file mode 100644 index 50c06eb..0000000 --- a/test/dts/paste_button.d.ts +++ /dev/null @@ -1,175 +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. - */ - -/** - * Enumerates the icon styles. - * - * @enum { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ -declare enum PasteIconStyle { - /** - * Icon rendered as lines. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - LINES = 0 -} - -/** - * Enumerates the text that can be displayed on the paste button. - * - * @enum { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ -declare enum PasteDescription { - /** - * Paste - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - PASTE = 0 -} - -/** - * Declares the interface for setting the paste button options. - * - * @interface PasteButtonOptions - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ -declare interface PasteButtonOptions { - /** - * Style of the icon to be drawn. - * - * @type { ?PasteIconStyle } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - icon?: PasteIconStyle; - - /** - * Text to be displayed on the button. - * - * @type { ?PasteDescription } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - text?: PasteDescription; - - /** - * Type of the button. - * - * @type { ?ButtonType } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - buttonType?: ButtonType; -} - -/** - * Enumerates the click event results of the paste button. - * - * @enum { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ -declare enum PasteButtonOnClickResult { - /** - * Success. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - SUCCESS = 0, - - /** - * Failure because the application is not temporarily authorized for accessing the current pasteboard data. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - TEMPORARY_AUTHORIZATION_FAILED = 1 -} - -/** - * Defines the interface for setting a paste button. - * - * @interface PasteButtonInterface - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ -interface PasteButtonInterface { - /** - * Creates a paste button. - * - * @returns { PasteButtonAttribute } Returns the attribute of the paste button. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - (): PasteButtonAttribute; - - /** - * Creates a paste button with the specified composition. - * If an attribute is not set, the corresponding element will not be drawn. - * - * @param { PasteButtonOptions } options - Indicates the options of the paste button. - * @returns { PasteButtonAttribute } Returns the attribute of the paste button. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - (options: PasteButtonOptions): PasteButtonAttribute; -} - -/** - * Defines the attributes of the paste button. - * - * @extends SecurityComponentMethod - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ -declare class PasteButtonAttribute extends SecurityComponentMethod { - /** - * Called when the paste button is clicked. - * - * @param { (event: ClickEvent, result: PasteButtonOnClickResult) => void } event - Indicates the - * click event result. - * @returns { PasteButtonAttribute } Returns the attribute of the paste button. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - onClick(event: (event: ClickEvent, result: PasteButtonOnClickResult) => void): PasteButtonAttribute; -} - -/** - * Defines a button that interacts with the security component service to - * request the permission for accessing the current pasteboard data. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ -declare const PasteButton: PasteButtonInterface; - -/** - * Defines a paste button instance for secure access. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ -declare const PasteButtonInstance: PasteButtonAttribute; diff --git a/test/dts/save_button.d.ts b/test/dts/save_button.d.ts deleted file mode 100644 index 61addc9..0000000 --- a/test/dts/save_button.d.ts +++ /dev/null @@ -1,239 +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. - */ - -/** - * Enumerates the icon styles. - * - * @enum { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ -declare enum SaveIconStyle { - /** - * Icon filled with the specified color. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - FULL_FILLED = 0, - - /** - * Icon rendered as lines. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - LINES = 1 -} - -/** - * Enumerates the text that can be displayed on the save button. - * - * @enum { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ -declare enum SaveDescription { - /** - * Download - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - DOWNLOAD = 0, - - /** - * Download File - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - DOWNLOAD_FILE = 1, - - /** - * Save - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - SAVE = 2, - - /** - * Save Image - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - SAVE_IMAGE = 3, - - /** - * Save File - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - SAVE_FILE = 4, - - /** - * Download and Share - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - DOWNLOAD_AND_SHARE = 5, - - /** - * Receive - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - RECEIVE = 6, - - /** - * Continue to Receive - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - CONTINUE_TO_RECEIVE = 7 -} - -/** - * Declares the interface for setting the save button options. - * - * @interface SaveButtonOptions - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ -declare interface SaveButtonOptions { - /** - * Style of the icon to be drawn. - * - * @type { ?SaveIconStyle } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - icon?: SaveIconStyle; - - /** - * Text to be displayed on the button. - * - * @type { ?SaveDescription } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - text?: SaveDescription; - - /** - * Type of the button. - * - * @type { ?ButtonType } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - buttonType?: ButtonType; -} - -/** - * Enumerates the click event results of the save button. - * - * @enum { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ -declare enum SaveButtonOnClickResult { - /** - * Success. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - SUCCESS = 0, - - /** - * Failure because the application is not temporarily authorized for saving files. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - TEMPORARY_AUTHORIZATION_FAILED = 1 -} - -/** - * Defines the interface for setting a save button. - * - * @interface SaveButtonInterface - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ -interface SaveButtonInterface { - /** - * Creates a save button. - * - * @returns { SaveButtonAttribute } Returns the attribute of the save button. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - (): SaveButtonAttribute; - - /** - * Creates a save button with the specified composition. - * If an attribute is not set, the corresponding element will not be drawn. - * - * @param { SaveButtonOptions } options - Indicates the options of the save button. - * @returns { SaveButtonAttribute } Returns the attribute of the save button. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - (options: SaveButtonOptions): SaveButtonAttribute; -} - -/** - * Defines the attributes of the save button. - * - * @extends SecurityComponentMethod - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ -declare class SaveButtonAttribute extends SecurityComponentMethod { - /** - * Called when the save button is clicked. - * - * @param { (event: ClickEvent, result: SaveButtonOnClickResult) => void } event - Indicates the - * click event result. - * @returns { SaveButtonAttribute } Returns the attribute of the save button. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - onClick(event: (event: ClickEvent, result: SaveButtonOnClickResult) => void): SaveButtonAttribute; -} - -/** - * Defines a button that interacts with the security component service to - * request the permission for saving files in the media library. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ -declare const SaveButton: SaveButtonInterface; - -/** - * Defines a save button instance for secure access. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ -declare const SaveButtonInstance: SaveButtonAttribute; diff --git a/test/dts/security_component.d.ts b/test/dts/security_component.d.ts deleted file mode 100644 index 8cac844..0000000 --- a/test/dts/security_component.d.ts +++ /dev/null @@ -1,242 +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. - */ - -/** - * Enumerates the layout direction of the icon and text. - * - * @enum { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ -declare enum SecurityComponentLayoutDirection { - /** - * Horizontal layout. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - HORIZONTAL = 0, - - /** - * Vertical layout. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - VERTICAL = 1 -} - -/** - * Defines the method of a security component. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ -declare class SecurityComponentMethod { - /** - * Icon size. - * - * @param { Dimension } value - Indicates the size of the icon. - * @returns { T } Returns the attribute of the security component. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - iconSize(value: Dimension): T; - - /** - * Layout direction of the icon and text. - * - * @param { SecurityComponentLayoutDirection } value - Indicates the layout direction of the icon and text. - * @returns { T } Returns the attribute of the security component. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - layoutDirection(value: SecurityComponentLayoutDirection): T; - - /** - * Position of the security component. - * - * @param { Position } value - Indicates the position of the security component. - * @returns { T } Returns the attribute of the security component. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - position(value: Position): T; - - /** - * Anchor of the security component for positioning. The top start edge of the component is used as - * the reference point for offset. - * - * @param { Position } value - Indicates the anchor of the component when it is positioned. - * @returns { T } Returns the attribute of the security component. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - markAnchor(value: Position): T; - - /** - * Coordinate offset relative to the layout position. - * Setting this attribute does not affect the layout of the parent container. - * The position is adjusted only during drawing. - * - * @param { Position } value - Indicates the offset value. - * @returns { T } Returns the attribute of the security component. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - offset(value: Position): T; - - /** - * Font size of the inner text. - * - * @param { Dimension } value - Indicates the font size of the text in the security component. - * @returns { T } Returns the attribute of the security component. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - fontSize(value: Dimension): T; - - /** - * Font style of the inner text. - * - * @param { FontStyle } value - Indicates the font style of the text in the security component. - * @returns { T } Returns the attribute of the security component. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - fontStyle(value: FontStyle): T; - - /** - * Font weight of the inner text. - * - * @param { number | FontWeight | string } value - Indicates the font weight of the text in the security component. - * @returns { T } Returns the attribute of the security component. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - fontWeight(value: number | FontWeight | string): T; - - /** - * Font family of the inner text. - * - * @param { string | Resource } value - Indicates the font family of the text in the security component. - * @returns { T } Returns the attribute of the security component. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - fontFamily(value: string | Resource): T; - - /** - * Font color of the inner text. - * - * @param { ResourceColor } value - Indicates the font color of the text in the security component. - * @returns { T } Returns the attribute of the security component. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - fontColor(value: ResourceColor): T; - - /** - * Color of the icon. - * - * @param { ResourceColor } value - Indicates the icon color in the security component. - * @returns { T } Returns the attribute of the security component. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - iconColor(value: ResourceColor): T; - - /** - * Background color. - * - * @param { ResourceColor } value - Indicates the background color of the security component. - * @returns { T } Returns the attribute of the security component. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - backgroundColor(value: ResourceColor): T; - - /** - * Style of the border. - * - * @param { BorderStyle } value - Indicates the border style of the security component. - * @returns { T } Returns the attribute of the security component. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - borderStyle(value: BorderStyle): T; - - /** - * Width of the border. - * - * @param { Dimension } value - Indicates the border width of the security component. - * @returns { T } Returns the attribute of the security component. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - borderWidth(value: Dimension): T; - - /** - * Color of the border. - * - * @param { ResourceColor } value - Indicates the border color of the security component. - * @returns { T } Returns the attribute of the security component. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - borderColor(value: ResourceColor): T; - - /** - * Radius of the border. - * - * @param { Dimension } value - Indicates the border radius of the security component. - * @returns { T } Returns the attribute of the security component. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - borderRadius(value: Dimension): T; - - /** - * Padding between the background border and icon/inner text. - * - * @param { Padding | Dimension } value - Indicates the padding of the security component. - * @returns { T } Returns the attribute of the security component. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - padding(value: Padding | Dimension): T; - - /** - * Space between the inner text and icon. - * - * @param { Dimension } value - Indicates the space between the inner text and icon. - * @returns { T } Returns the attribute of the security component. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - textIconSpace(value: Dimension): T; - - /** - * Key. User can set an key to the component to identify it. - * - * @param { string } value - identify the key of the component. - * @returns { T } Returns the attribute of the security component. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @systemapi - * @since 10 - * @test - */ - key(value: string): T; -} diff --git a/test/fuzztest/security_component/BUILD.gn b/test/fuzztest/security_component/BUILD.gn deleted file mode 100644 index 8d2c433..0000000 --- a/test/fuzztest/security_component/BUILD.gn +++ /dev/null @@ -1,34 +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. - -group("fuzztest") { - testonly = true - deps = [] - - deps += [ - "getenhanceremoteobjectInner_fuzzer:GetEnhanceRemoteObjectInnerFuzzTest", - "getenhanceremoteobject_fuzzer:GetEnhanceRemoteObjectFuzzTest", - "getpointereventenhancedata_fuzzer:GetPointerEventEnhanceDataFuzzTest", - "reduceafterverifysavepermissionInner_fuzzer:ReduceAfterVerifySavePermissionInnerFuzzTest", - "reduceafterverifysavepermission_fuzzer:ReduceAfterVerifySavePermissionFuzzTest", - "registersecuritycomponentInner_fuzzer:RegisterSecurityComponentInnerFuzzTest", - "registersecuritycomponent_fuzzer:RegisterSecurityComponentFuzzTest", - "reportsecuritycomponentclickeventInner_fuzzer:ReportSecurityComponentClickEventInnerFuzzTest", - "reportsecuritycomponentclickevent_fuzzer:ReportSecurityComponentClickEventFuzzTest", - "setenhancecfg_fuzzer:SetEnhanceCfgFuzzTest", - "unregistersecuritycomponentInner_fuzzer:UnregisterSecurityComponentInnerFuzzTest", - "unregistersecuritycomponent_fuzzer:UnregisterSecurityComponentFuzzTest", - "updatesecuritycomponentInner_fuzzer:UpdateSecurityComponentInnerFuzzTest", - "updatesecuritycomponent_fuzzer:UpdateSecurityComponentFuzzTest", - ] -} diff --git a/test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/BUILD.gn b/test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/BUILD.gn deleted file mode 100644 index 68d43fe..0000000 --- a/test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/BUILD.gn +++ /dev/null @@ -1,49 +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("//build/config/features.gni") -import("//build/test.gni") -import("../../../../security_component.gni") - -module_output_path = "security_component/security_component" - -ohos_fuzztest("GetEnhanceRemoteObjectInnerFuzzTest") { - module_out_path = module_output_path - fuzz_config_file = "${sec_comp_dir}/test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer" - - include_dirs = [ - "${sec_comp_dir}/frameworks/common/include", - "${sec_comp_dir}/services/security_component_service/sa/sa_main", - ] - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - configs = [ "${sec_comp_dir}/config:coverage_flags" ] - - cflags_cc = [ "-DHILOG_ENABLE" ] - sources = [ "getenhanceremoteobjectInner_fuzzer.cpp" ] - - deps = [ "${sec_comp_dir}/services/security_component_service/sa:security_component_service" ] - - external_deps = [ - "ability_runtime:app_manager", - "access_token:libaccesstoken_sdk", - "access_token:libtoken_setproc", - "c_utils:utils", - "hilog:libhilog", - "ipc:ipc_core", - ] -} diff --git a/test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/corpus/init b/test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/corpus/init deleted file mode 100644 index bc977bd..0000000 --- a/test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/corpus/init +++ /dev/null @@ -1,14 +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. - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/getenhanceremoteobjectInner_fuzzer.cpp b/test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/getenhanceremoteobjectInner_fuzzer.cpp deleted file mode 100644 index 48d375e..0000000 --- a/test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/getenhanceremoteobjectInner_fuzzer.cpp +++ /dev/null @@ -1,49 +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. - */ - - -#include -#include -#include -#include -#include "accesstoken_kit.h" -#include "securec.h" -#include "token_setproc.h" -#include "getenhanceremoteobjectInner_fuzzer.h" - -using namespace OHOS::Security::SecurityComponent; -using namespace OHOS::Security::AccessToken; -namespace OHOS { -static void GetEnhanceRemoteObjectInnerFuzzTest(const uint8_t *data, size_t size) -{ - uint32_t code = SecurityComponentServiceInterfaceCode::GET_SECURITY_COMPONENT_ENHANCE_OBJECT; - MessageParcel datas; - datas.WriteInterfaceToken(u"ohos.security.ISecCompService"); - datas.WriteBuffer(data, size); - datas.RewindRead(0); - MessageParcel reply; - MessageOption option; - auto service = std::make_shared(SA_ID_SECURITY_COMPONENT_SERVICE, true); - service->OnRemoteRequest(code, datas, reply, option); -} -} // namespace OHOS - -/* Fuzzer entry point */ -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) -{ - /* Run your code on data */ - OHOS::GetEnhanceRemoteObjectInnerFuzzTest(data, size); - return 0; -} diff --git a/test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/getenhanceremoteobjectInner_fuzzer.h b/test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/getenhanceremoteobjectInner_fuzzer.h deleted file mode 100644 index a3ec5aa..0000000 --- a/test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/getenhanceremoteobjectInner_fuzzer.h +++ /dev/null @@ -1,24 +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. - */ - -#ifndef GET_ENHANCE_REMOTE_OBJECT_INNER_FUZZER_H -#define GET_ENHANCE_REMOTE_OBJECT_INNER_FUZZER_H - -#define FUZZ_PROJECT_NAME "securitycomponent_fuzzer" - -#include "sec_comp_stub.h" -#include "sec_comp_service.h" - -#endif diff --git a/test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/project.xml b/test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/project.xml deleted file mode 100644 index 6e8ad2c..0000000 --- a/test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 1000 - - 300 - - 4096 - - diff --git a/test/fuzztest/security_component/getenhanceremoteobject_fuzzer/BUILD.gn b/test/fuzztest/security_component/getenhanceremoteobject_fuzzer/BUILD.gn deleted file mode 100644 index d0a5c65..0000000 --- a/test/fuzztest/security_component/getenhanceremoteobject_fuzzer/BUILD.gn +++ /dev/null @@ -1,48 +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("//build/config/features.gni") -import("//build/test.gni") -import("../../../../security_component.gni") - -module_output_path = "security_component/security_component" - -ohos_fuzztest("GetEnhanceRemoteObjectFuzzTest") { - module_out_path = module_output_path - fuzz_config_file = "${sec_comp_dir}/test/fuzztest/security_component/getenhanceremoteobject_fuzzer" - - include_dirs = [ - "${sec_comp_dir}/frameworks/common/include", - "${sec_comp_dir}/interfaces/inner_api/security_component/include", - ] - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - configs = [ "${sec_comp_dir}/config:coverage_flags" ] - - cflags_cc = [ "-DHILOG_ENABLE" ] - sources = [ "getenhanceremoteobject_fuzzer.cpp" ] - - deps = [ "${sec_comp_dir}/interfaces/inner_api/security_component:libsecurity_component_sdk" ] - - external_deps = [ - "ability_base:want", - "access_token:libaccesstoken_sdk", - "access_token:libtoken_setproc", - "c_utils:utils", - "hilog:libhilog", - ] -} diff --git a/test/fuzztest/security_component/getenhanceremoteobject_fuzzer/corpus/init b/test/fuzztest/security_component/getenhanceremoteobject_fuzzer/corpus/init deleted file mode 100644 index bc977bd..0000000 --- a/test/fuzztest/security_component/getenhanceremoteobject_fuzzer/corpus/init +++ /dev/null @@ -1,14 +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. - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/security_component/getenhanceremoteobject_fuzzer/getenhanceremoteobject_fuzzer.cpp b/test/fuzztest/security_component/getenhanceremoteobject_fuzzer/getenhanceremoteobject_fuzzer.cpp deleted file mode 100644 index 47d9293..0000000 --- a/test/fuzztest/security_component/getenhanceremoteobject_fuzzer/getenhanceremoteobject_fuzzer.cpp +++ /dev/null @@ -1,41 +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. - */ - -#include -#include -#include -#include -#include "accesstoken_kit.h" -#include "securec.h" -#include "token_setproc.h" -#include "getenhanceremoteobject_fuzzer.h" - -using namespace OHOS::Security::SecurityComponent; -using namespace OHOS::Security::AccessToken; -namespace OHOS { -static void GetEnhanceRemoteObjectFuzzTest(const uint8_t *data, size_t size) -{ - bool isLoad = true; - SecCompKit::GetEnhanceRemoteObject(isLoad); -} -} // namespace OHOS - -/* Fuzzer entry point */ -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) -{ - /* Run your code on data */ - OHOS::GetEnhanceRemoteObjectFuzzTest(data, size); - return 0; -} diff --git a/test/fuzztest/security_component/getenhanceremoteobject_fuzzer/getenhanceremoteobject_fuzzer.h b/test/fuzztest/security_component/getenhanceremoteobject_fuzzer/getenhanceremoteobject_fuzzer.h deleted file mode 100644 index a907797..0000000 --- a/test/fuzztest/security_component/getenhanceremoteobject_fuzzer/getenhanceremoteobject_fuzzer.h +++ /dev/null @@ -1,23 +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. - */ - -#ifndef GET_ENHANCE_REMOTE_OBJECT_FUZZER_H -#define GET_ENHANCE_REMOTE_OBJECT_FUZZER_H - -#define FUZZ_PROJECT_NAME "securitycomponent_fuzzer" - -#include "sec_comp_kit.h" - -#endif diff --git a/test/fuzztest/security_component/getenhanceremoteobject_fuzzer/project.xml b/test/fuzztest/security_component/getenhanceremoteobject_fuzzer/project.xml deleted file mode 100644 index 6e8ad2c..0000000 --- a/test/fuzztest/security_component/getenhanceremoteobject_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 1000 - - 300 - - 4096 - - diff --git a/test/fuzztest/security_component/getpointereventenhancedata_fuzzer/BUILD.gn b/test/fuzztest/security_component/getpointereventenhancedata_fuzzer/BUILD.gn deleted file mode 100644 index bca0c52..0000000 --- a/test/fuzztest/security_component/getpointereventenhancedata_fuzzer/BUILD.gn +++ /dev/null @@ -1,48 +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("//build/config/features.gni") -import("//build/test.gni") -import("../../../../security_component.gni") - -module_output_path = "security_component/security_component" - -ohos_fuzztest("GetPointerEventEnhanceDataFuzzTest") { - module_out_path = module_output_path - fuzz_config_file = "${sec_comp_dir}/test/fuzztest/security_component/getpointereventenhancedata_fuzzer" - - include_dirs = [ - "${sec_comp_dir}/frameworks/common/include", - "${sec_comp_dir}/interfaces/inner_api/enhance_kits/include", - ] - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - configs = [ "${sec_comp_dir}/config:coverage_flags" ] - - cflags_cc = [ "-DHILOG_ENABLE" ] - sources = [ "getpointereventenhancedata_fuzzer.cpp" ] - - deps = [ "${sec_comp_dir}/interfaces/inner_api/enhance_kits:libsecurity_component_enhance_sdk" ] - - external_deps = [ - "ability_base:want", - "access_token:libaccesstoken_sdk", - "access_token:libtoken_setproc", - "c_utils:utils", - "hilog:libhilog", - ] -} diff --git a/test/fuzztest/security_component/getpointereventenhancedata_fuzzer/corpus/init b/test/fuzztest/security_component/getpointereventenhancedata_fuzzer/corpus/init deleted file mode 100644 index bc977bd..0000000 --- a/test/fuzztest/security_component/getpointereventenhancedata_fuzzer/corpus/init +++ /dev/null @@ -1,14 +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. - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/security_component/getpointereventenhancedata_fuzzer/getpointereventenhancedata_fuzzer.cpp b/test/fuzztest/security_component/getpointereventenhancedata_fuzzer/getpointereventenhancedata_fuzzer.cpp deleted file mode 100644 index c894798..0000000 --- a/test/fuzztest/security_component/getpointereventenhancedata_fuzzer/getpointereventenhancedata_fuzzer.cpp +++ /dev/null @@ -1,43 +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. - */ - -#include -#include -#include -#include -#include "accesstoken_kit.h" -#include "securec.h" -#include "token_setproc.h" -#include "getpointereventenhancedata_fuzzer.h" - -using namespace OHOS::Security::SecurityComponent; -using namespace OHOS::Security::AccessToken; -namespace OHOS { -static void GetPointerEventEnhanceDataFuzzTest(const uint8_t *data, size_t size) -{ - uint8_t *data1 = const_cast(data); - uint8_t enhanceData[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; - uint32_t enhancedataLen = 10; - SecCompEnhanceKit::GetPointerEventEnhanceData(data1, size, enhanceData, enhancedataLen); -} -} // namespace OHOS - -/* Fuzzer entry point */ -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) -{ - /* Run your code on data */ - OHOS::GetPointerEventEnhanceDataFuzzTest(data, size); - return 0; -} diff --git a/test/fuzztest/security_component/getpointereventenhancedata_fuzzer/getpointereventenhancedata_fuzzer.h b/test/fuzztest/security_component/getpointereventenhancedata_fuzzer/getpointereventenhancedata_fuzzer.h deleted file mode 100644 index 5d8ac75..0000000 --- a/test/fuzztest/security_component/getpointereventenhancedata_fuzzer/getpointereventenhancedata_fuzzer.h +++ /dev/null @@ -1,23 +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. - */ - -#ifndef GET_POINTER_EVENT_ENHANCE_DATA_FUZZER_H -#define GET_POINTER_EVENT_ENHANCE_DATA_FUZZER_H - -#define FUZZ_PROJECT_NAME "getpointereventenhancedata_fuzzer" - -#include "sec_comp_enhance_kit.h" - -#endif diff --git a/test/fuzztest/security_component/getpointereventenhancedata_fuzzer/project.xml b/test/fuzztest/security_component/getpointereventenhancedata_fuzzer/project.xml deleted file mode 100644 index 6e8ad2c..0000000 --- a/test/fuzztest/security_component/getpointereventenhancedata_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 1000 - - 300 - - 4096 - - diff --git a/test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/BUILD.gn b/test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/BUILD.gn deleted file mode 100644 index ff5172e..0000000 --- a/test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/BUILD.gn +++ /dev/null @@ -1,49 +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("//build/config/features.gni") -import("//build/test.gni") -import("../../../../security_component.gni") - -module_output_path = "security_component/security_component" - -ohos_fuzztest("ReduceAfterVerifySavePermissionInnerFuzzTest") { - module_out_path = module_output_path - fuzz_config_file = "${sec_comp_dir}/test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer" - - include_dirs = [ - "${sec_comp_dir}/frameworks/common/include", - "${sec_comp_dir}/services/security_component_service/sa/sa_main", - ] - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - configs = [ "${sec_comp_dir}/config:coverage_flags" ] - - cflags_cc = [ "-DHILOG_ENABLE" ] - sources = [ "reduceafterverifysavepermissionInner_fuzzer.cpp" ] - - deps = [ "${sec_comp_dir}/services/security_component_service/sa:security_component_service" ] - - external_deps = [ - "ability_runtime:app_manager", - "access_token:libaccesstoken_sdk", - "access_token:libtoken_setproc", - "c_utils:utils", - "hilog:libhilog", - "ipc:ipc_core", - ] -} diff --git a/test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/corpus/init b/test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/corpus/init deleted file mode 100644 index bc977bd..0000000 --- a/test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/corpus/init +++ /dev/null @@ -1,14 +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. - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/project.xml b/test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/project.xml deleted file mode 100644 index 6e8ad2c..0000000 --- a/test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 1000 - - 300 - - 4096 - - diff --git a/test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/reduceafterverifysavepermissionInner_fuzzer.cpp b/test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/reduceafterverifysavepermissionInner_fuzzer.cpp deleted file mode 100644 index 5afd4e1..0000000 --- a/test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/reduceafterverifysavepermissionInner_fuzzer.cpp +++ /dev/null @@ -1,48 +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. - */ - -#include -#include -#include -#include -#include "accesstoken_kit.h" -#include "securec.h" -#include "token_setproc.h" -#include "reduceafterverifysavepermissionInner_fuzzer.h" - -using namespace OHOS::Security::SecurityComponent; -using namespace OHOS::Security::AccessToken; -namespace OHOS { -static void ReduceAfterVerifySavePermissionInnerFuzzTest(const uint8_t *data, size_t size) -{ - uint32_t code = SecurityComponentServiceInterfaceCode::VERIFY_TEMP_SAVE_PERMISSION; - MessageParcel datas; - datas.WriteInterfaceToken(u"ohos.security.ISecCompService"); - datas.WriteBuffer(data, size); - datas.RewindRead(0); - MessageParcel reply; - MessageOption option; - auto service = std::make_shared(SA_ID_SECURITY_COMPONENT_SERVICE, true); - service->OnRemoteRequest(code, datas, reply, option); -} -} // namespace OHOS - -/* Fuzzer entry point */ -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) -{ - /* Run your code on data */ - OHOS::ReduceAfterVerifySavePermissionInnerFuzzTest(data, size); - return 0; -} diff --git a/test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/reduceafterverifysavepermissionInner_fuzzer.h b/test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/reduceafterverifysavepermissionInner_fuzzer.h deleted file mode 100644 index d17798d..0000000 --- a/test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/reduceafterverifysavepermissionInner_fuzzer.h +++ /dev/null @@ -1,24 +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. - */ - -#ifndef REDUCE_AFTER_VERIFY_SAVEPERMISSION_INNER_FUZZER_H -#define REDUCE_AFTER_VERIFY_SAVEPERMISSION_INNER_FUZZER_H - -#define FUZZ_PROJECT_NAME "securitycomponent_fuzzer" - -#include "sec_comp_stub.h" -#include "sec_comp_service.h" - -#endif diff --git a/test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/BUILD.gn b/test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/BUILD.gn deleted file mode 100644 index aec22dc..0000000 --- a/test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/BUILD.gn +++ /dev/null @@ -1,48 +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("//build/config/features.gni") -import("//build/test.gni") -import("../../../../security_component.gni") - -module_output_path = "security_component/security_component" - -ohos_fuzztest("ReduceAfterVerifySavePermissionFuzzTest") { - module_out_path = module_output_path - fuzz_config_file = "${sec_comp_dir}/test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer" - - include_dirs = [ - "${sec_comp_dir}/frameworks/common/include", - "${sec_comp_dir}/interfaces/inner_api/security_component/include", - ] - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - configs = [ "${sec_comp_dir}/config:coverage_flags" ] - - cflags_cc = [ "-DHILOG_ENABLE" ] - sources = [ "reduceafterverifysavepermission_fuzzer.cpp" ] - - deps = [ "${sec_comp_dir}/interfaces/inner_api/security_component:libsecurity_component_sdk" ] - - external_deps = [ - "ability_base:want", - "access_token:libaccesstoken_sdk", - "access_token:libtoken_setproc", - "c_utils:utils", - "hilog:libhilog", - ] -} diff --git a/test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/corpus/init b/test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/corpus/init deleted file mode 100644 index bc977bd..0000000 --- a/test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/corpus/init +++ /dev/null @@ -1,14 +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. - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/project.xml b/test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/project.xml deleted file mode 100644 index 6e8ad2c..0000000 --- a/test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 1000 - - 300 - - 4096 - - diff --git a/test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/reduceafterverifysavepermission_fuzzer.cpp b/test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/reduceafterverifysavepermission_fuzzer.cpp deleted file mode 100644 index 62a7c88..0000000 --- a/test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/reduceafterverifysavepermission_fuzzer.cpp +++ /dev/null @@ -1,40 +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. - */ - -#include -#include -#include -#include -#include "accesstoken_kit.h" -#include "securec.h" -#include "token_setproc.h" -#include "reduceafterverifysavepermission_fuzzer.h" - -using namespace OHOS::Security::SecurityComponent; -using namespace OHOS::Security::AccessToken; -namespace OHOS { -static void ReduceAfterVerifySavePermissionFuzzTest(const uint8_t *data, size_t size) -{ - SecCompKit::ReduceAfterVerifySavePermission(size); -} -} // namespace OHOS - -/* Fuzzer entry point */ -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) -{ - /* Run your code on data */ - OHOS::ReduceAfterVerifySavePermissionFuzzTest(data, size); - return 0; -} \ No newline at end of file diff --git a/test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/reduceafterverifysavepermission_fuzzer.h b/test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/reduceafterverifysavepermission_fuzzer.h deleted file mode 100644 index 6d024ef..0000000 --- a/test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/reduceafterverifysavepermission_fuzzer.h +++ /dev/null @@ -1,23 +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. - */ - -#ifndef REDUCE_AFTER_VERIFY_SAVEPERMISSION_FUZZER_H -#define REDUCE_AFTER_VERIFY_SAVEPERMISSION_FUZZER_H - -#define FUZZ_PROJECT_NAME "securitycomponent_fuzzer" - -#include "sec_comp_kit.h" - -#endif // TEST_FUZZTEST_SECURITY_COMPONENT_FUZZER_H diff --git a/test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/BUILD.gn b/test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/BUILD.gn deleted file mode 100644 index 3e81ae7..0000000 --- a/test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/BUILD.gn +++ /dev/null @@ -1,49 +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("//build/config/features.gni") -import("//build/test.gni") -import("../../../../security_component.gni") - -module_output_path = "security_component/security_component" - -ohos_fuzztest("RegisterSecurityComponentInnerFuzzTest") { - module_out_path = module_output_path - fuzz_config_file = "${sec_comp_dir}/test/fuzztest/security_component/registersecuritycomponentInner_fuzzer" - - include_dirs = [ - "${sec_comp_dir}/frameworks/common/include", - "${sec_comp_dir}/services/security_component_service/sa/sa_main", - ] - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - configs = [ "${sec_comp_dir}/config:coverage_flags" ] - - cflags_cc = [ "-DHILOG_ENABLE" ] - sources = [ "registersecuritycomponentInner_fuzzer.cpp" ] - - deps = [ "${sec_comp_dir}/services/security_component_service/sa:security_component_service" ] - - external_deps = [ - "ability_runtime:app_manager", - "access_token:libaccesstoken_sdk", - "access_token:libtoken_setproc", - "c_utils:utils", - "hilog:libhilog", - "ipc:ipc_core", - ] -} diff --git a/test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/corpus/init b/test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/corpus/init deleted file mode 100644 index bc977bd..0000000 --- a/test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/corpus/init +++ /dev/null @@ -1,14 +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. - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/project.xml b/test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/project.xml deleted file mode 100644 index 6e8ad2c..0000000 --- a/test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 1000 - - 300 - - 4096 - - diff --git a/test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/registersecuritycomponentInner_fuzzer.cpp b/test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/registersecuritycomponentInner_fuzzer.cpp deleted file mode 100644 index 24385f9..0000000 --- a/test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/registersecuritycomponentInner_fuzzer.cpp +++ /dev/null @@ -1,51 +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. - */ - -#include -#include -#include -#include -#include "registersecuritycomponentInner_fuzzer.h" -#include "accesstoken_kit.h" -#include "sec_comp_service.h" -#include "securec.h" -#include "token_setproc.h" - -using namespace OHOS::Security::SecurityComponent; -using namespace OHOS::Security::AccessToken; -namespace OHOS { -static void RegisterSecurityComponentInnerFuzzTest(const uint8_t *data, size_t size) -{ - uint32_t code = - SecurityComponentServiceInterfaceCode::REGISTER_SECURITY_COMPONENT; - MessageParcel datas; - datas.WriteInterfaceToken(u"ohos.security.ISecCompService"); - datas.WriteBuffer(data, size); - datas.RewindRead(0); - MessageParcel reply; - MessageOption option; - auto service = - std::make_shared(SA_ID_SECURITY_COMPONENT_SERVICE, true); - service->OnRemoteRequest(code, datas, reply, option); -} -} // namespace OHOS - -/* Fuzzer entry point */ -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) -{ - /* Run your code on data */ - OHOS::RegisterSecurityComponentInnerFuzzTest(data, size); - return 0; -} \ No newline at end of file diff --git a/test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/registersecuritycomponentInner_fuzzer.h b/test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/registersecuritycomponentInner_fuzzer.h deleted file mode 100644 index a8ada33..0000000 --- a/test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/registersecuritycomponentInner_fuzzer.h +++ /dev/null @@ -1,21 +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. - */ - -#ifndef REGISTER_SECURITY_COMPONENT_INNER_FUZZER_H -#define REGISTER_SECURITY_COMPONENT_INNER_FUZZER_H - -#define FUZZ_PROJECT_NAME "securitycomponent_fuzzer" -#include "sec_comp_stub.h" -#endif diff --git a/test/fuzztest/security_component/registersecuritycomponent_fuzzer/BUILD.gn b/test/fuzztest/security_component/registersecuritycomponent_fuzzer/BUILD.gn deleted file mode 100644 index 68f586d..0000000 --- a/test/fuzztest/security_component/registersecuritycomponent_fuzzer/BUILD.gn +++ /dev/null @@ -1,50 +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("//build/config/features.gni") -import("//build/test.gni") -import("../../../../security_component.gni") - -module_output_path = "security_component/security_component" - -ohos_fuzztest("RegisterSecurityComponentFuzzTest") { - module_out_path = module_output_path - fuzz_config_file = "${sec_comp_dir}/test/fuzztest/security_component/registersecuritycomponent_fuzzer" - - include_dirs = [ - "${sec_comp_dir}/frameworks/common/include", - "${sec_comp_dir}/interfaces/inner_api/security_component/include", - "//third_party/json/include", - "//third_party/json/test/thirdparty/fifo_map", - ] - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - configs = [ "${sec_comp_dir}/config:coverage_flags" ] - - cflags_cc = [ "-DHILOG_ENABLE" ] - sources = [ "registersecuritycomponent_fuzzer.cpp" ] - - deps = [ "${sec_comp_dir}/interfaces/inner_api/security_component:libsecurity_component_sdk" ] - - external_deps = [ - "ability_base:want", - "access_token:libaccesstoken_sdk", - "access_token:libtoken_setproc", - "c_utils:utils", - "hilog:libhilog", - ] -} diff --git a/test/fuzztest/security_component/registersecuritycomponent_fuzzer/corpus/init b/test/fuzztest/security_component/registersecuritycomponent_fuzzer/corpus/init deleted file mode 100644 index bc977bd..0000000 --- a/test/fuzztest/security_component/registersecuritycomponent_fuzzer/corpus/init +++ /dev/null @@ -1,14 +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. - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/security_component/registersecuritycomponent_fuzzer/project.xml b/test/fuzztest/security_component/registersecuritycomponent_fuzzer/project.xml deleted file mode 100644 index 6e8ad2c..0000000 --- a/test/fuzztest/security_component/registersecuritycomponent_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 1000 - - 300 - - 4096 - - diff --git a/test/fuzztest/security_component/registersecuritycomponent_fuzzer/registersecuritycomponent_fuzzer.cpp b/test/fuzztest/security_component/registersecuritycomponent_fuzzer/registersecuritycomponent_fuzzer.cpp deleted file mode 100644 index ea9d275..0000000 --- a/test/fuzztest/security_component/registersecuritycomponent_fuzzer/registersecuritycomponent_fuzzer.cpp +++ /dev/null @@ -1,43 +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. - */ - -#include -#include -#include -#include -#include "accesstoken_kit.h" -#include "securec.h" -#include "token_setproc.h" -#include "registersecuritycomponent_fuzzer.h" - -using namespace OHOS::Security::SecurityComponent; -using namespace OHOS::Security::AccessToken; -namespace OHOS { -static void RegisterSecurityComponentFuzzTest(const uint8_t *data, size_t size) -{ - std::string componentInfo(reinterpret_cast(data), size); - int32_t scId = size; - enum SecCompType type = UNKNOWN_SC_TYPE; - SecCompKit::RegisterSecurityComponent(type, componentInfo, scId); -} -} // namespace OHOS - -/* Fuzzer entry point */ -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) -{ - /* Run your code on data */ - OHOS::RegisterSecurityComponentFuzzTest(data, size); - return 0; -} diff --git a/test/fuzztest/security_component/registersecuritycomponent_fuzzer/registersecuritycomponent_fuzzer.h b/test/fuzztest/security_component/registersecuritycomponent_fuzzer/registersecuritycomponent_fuzzer.h deleted file mode 100644 index 667b592..0000000 --- a/test/fuzztest/security_component/registersecuritycomponent_fuzzer/registersecuritycomponent_fuzzer.h +++ /dev/null @@ -1,21 +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. - */ - -#ifndef REGISTER_SECURITY_COMPONENT_FUZZER_H -#define REGISTER_SECURITY_COMPONENT_FUZZER_H - -#define FUZZ_PROJECT_NAME "securitycomponent_fuzzer" -#include "sec_comp_kit.h" -#endif diff --git a/test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/BUILD.gn b/test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/BUILD.gn deleted file mode 100644 index fa374fa..0000000 --- a/test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/BUILD.gn +++ /dev/null @@ -1,49 +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("//build/config/features.gni") -import("//build/test.gni") -import("../../../../security_component.gni") - -module_output_path = "security_component/security_component" - -ohos_fuzztest("ReportSecurityComponentClickEventInnerFuzzTest") { - module_out_path = module_output_path - fuzz_config_file = "${sec_comp_dir}/test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer" - - include_dirs = [ - "${sec_comp_dir}/frameworks/common/include", - "${sec_comp_dir}/services/security_component_service/sa/sa_main", - ] - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - configs = [ "${sec_comp_dir}/config:coverage_flags" ] - - cflags_cc = [ "-DHILOG_ENABLE" ] - sources = [ "reportsecuritycomponentclickeventInner_fuzzer.cpp" ] - - deps = [ "${sec_comp_dir}/services/security_component_service/sa:security_component_service" ] - - external_deps = [ - "ability_runtime:app_manager", - "access_token:libaccesstoken_sdk", - "access_token:libtoken_setproc", - "c_utils:utils", - "hilog:libhilog", - "ipc:ipc_core", - ] -} diff --git a/test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/corpus/init b/test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/corpus/init deleted file mode 100644 index bc977bd..0000000 --- a/test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/corpus/init +++ /dev/null @@ -1,14 +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. - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/project.xml b/test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/project.xml deleted file mode 100644 index 6e8ad2c..0000000 --- a/test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 1000 - - 300 - - 4096 - - diff --git a/test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/reportsecuritycomponentclickeventInner_fuzzer.cpp b/test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/reportsecuritycomponentclickeventInner_fuzzer.cpp deleted file mode 100644 index 5cea508..0000000 --- a/test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/reportsecuritycomponentclickeventInner_fuzzer.cpp +++ /dev/null @@ -1,49 +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. - */ - -#include -#include -#include -#include -#include "accesstoken_kit.h" -#include "securec.h" -#include "token_setproc.h" -#include "sec_comp_service.h" -#include "reportsecuritycomponentclickeventInner_fuzzer.h" - -using namespace OHOS::Security::SecurityComponent; -using namespace OHOS::Security::AccessToken; -namespace OHOS { -static void ReportSecurityComponentClickEventInnerFuzzTest(const uint8_t *data, size_t size) -{ - uint32_t code = SecurityComponentServiceInterfaceCode::REPORT_SECURITY_COMPONENT_CLICK_EVENT; - MessageParcel datas; - datas.WriteInterfaceToken(u"ohos.security.ISecCompService"); - datas.WriteBuffer(data, size); - datas.RewindRead(0); - MessageParcel reply; - MessageOption option; - auto service = std::make_shared(SA_ID_SECURITY_COMPONENT_SERVICE, true); - service->OnRemoteRequest(code, datas, reply, option); -} -} // namespace OHOS - -/* Fuzzer entry point */ -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) -{ - /* Run your code on data */ - OHOS::ReportSecurityComponentClickEventInnerFuzzTest(data, size); - return 0; -} diff --git a/test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/reportsecuritycomponentclickeventInner_fuzzer.h b/test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/reportsecuritycomponentclickeventInner_fuzzer.h deleted file mode 100644 index 8af2a89..0000000 --- a/test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/reportsecuritycomponentclickeventInner_fuzzer.h +++ /dev/null @@ -1,21 +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. - */ - -#ifndef REPORT_SECURITY_COMPONENT_CLICK_EVENT_INNER_FUZZER_H -#define REPORT_SECURITY_COMPONENT_CLICK_EVENT_INNER_FUZZER_H - -#define FUZZ_PROJECT_NAME "securitycomponent_fuzzer" -#include "sec_comp_stub.h" -#endif diff --git a/test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/BUILD.gn b/test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/BUILD.gn deleted file mode 100644 index 1ac949d..0000000 --- a/test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/BUILD.gn +++ /dev/null @@ -1,50 +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("//build/config/features.gni") -import("//build/test.gni") -import("../../../../security_component.gni") - -module_output_path = "security_component/security_component" - -ohos_fuzztest("ReportSecurityComponentClickEventFuzzTest") { - module_out_path = module_output_path - fuzz_config_file = "${sec_comp_dir}/test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer" - - include_dirs = [ - "${sec_comp_dir}/frameworks/common/include", - "${sec_comp_dir}/interfaces/inner_api/security_component/include", - "//third_party/json/include", - "//third_party/json/test/thirdparty/fifo_map", - ] - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - configs = [ "${sec_comp_dir}/config:coverage_flags" ] - - cflags_cc = [ "-DHILOG_ENABLE" ] - sources = [ "reportsecuritycomponentclickevent_fuzzer.cpp" ] - - deps = [ "${sec_comp_dir}/interfaces/inner_api/security_component:libsecurity_component_sdk" ] - - external_deps = [ - "ability_base:want", - "access_token:libaccesstoken_sdk", - "access_token:libtoken_setproc", - "c_utils:utils", - "hilog:libhilog", - ] -} diff --git a/test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/corpus/init b/test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/corpus/init deleted file mode 100644 index bc977bd..0000000 --- a/test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/corpus/init +++ /dev/null @@ -1,14 +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. - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/project.xml b/test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/project.xml deleted file mode 100644 index 6e8ad2c..0000000 --- a/test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 1000 - - 300 - - 4096 - - diff --git a/test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/reportsecuritycomponentclickevent_fuzzer.cpp b/test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/reportsecuritycomponentclickevent_fuzzer.cpp deleted file mode 100644 index 89477c3..0000000 --- a/test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/reportsecuritycomponentclickevent_fuzzer.cpp +++ /dev/null @@ -1,51 +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. - */ - -#include -#include -#include -#include -#include "accesstoken_kit.h" -#include "securec.h" -#include "token_setproc.h" -#include "reportsecuritycomponentclickevent_fuzzer.h" - -using namespace OHOS::Security::SecurityComponent; -using namespace OHOS::Security::AccessToken; -namespace OHOS { -static void ReportSecurityComponentClickEventFuzzTest(const uint8_t *data, size_t size) -{ - std::string componentInfo(reinterpret_cast(data), size); - uint8_t *data1 = const_cast(data); - const double touchX = size; - const double touchY = size; - const uint64_t timesStamp = size; - struct SecCompClickEvent touchInfo; - touchInfo.touchX = touchX; - touchInfo.touchY = touchY; - touchInfo.timestamp = timesStamp; - touchInfo.extraInfo.data = data1; - touchInfo.extraInfo.dataSize = size; - SecCompKit::ReportSecurityComponentClickEvent(size, componentInfo, touchInfo); -} -} // namespace OHOS - -/* Fuzzer entry point */ -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) -{ - /* Run your code on data */ - OHOS::ReportSecurityComponentClickEventFuzzTest(data, size); - return 0; -} diff --git a/test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/reportsecuritycomponentclickevent_fuzzer.h b/test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/reportsecuritycomponentclickevent_fuzzer.h deleted file mode 100644 index 989ec28..0000000 --- a/test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/reportsecuritycomponentclickevent_fuzzer.h +++ /dev/null @@ -1,23 +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. - */ - -#ifndef REPORT_SECURITY_COMPONENT_CLICK_EVENT_FUZZER_H -#define REPORT_SECURITY_COMPONENT_CLICK_EVENT_FUZZER_H - -#define FUZZ_PROJECT_NAME "securitycomponent_fuzzer" - -#include "sec_comp_kit.h" - -#endif diff --git a/test/fuzztest/security_component/setenhancecfg_fuzzer/BUILD.gn b/test/fuzztest/security_component/setenhancecfg_fuzzer/BUILD.gn deleted file mode 100644 index c7a950f..0000000 --- a/test/fuzztest/security_component/setenhancecfg_fuzzer/BUILD.gn +++ /dev/null @@ -1,49 +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("//build/config/features.gni") -import("//build/test.gni") -import("../../../../security_component.gni") - -module_output_path = "security_component/security_component" - -ohos_fuzztest("SetEnhanceCfgFuzzTest") { - module_out_path = module_output_path - fuzz_config_file = - "${sec_comp_dir}/test/fuzztest/security_component/setenhancecfg_fuzzer" - - include_dirs = [ - "${sec_comp_dir}/frameworks/common/include", - "${sec_comp_dir}/interfaces/inner_api/enhance_kits/include", - ] - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - configs = [ "${sec_comp_dir}/config:coverage_flags" ] - - cflags_cc = [ "-DHILOG_ENABLE" ] - sources = [ "setenhancecfg_fuzzer.cpp" ] - - deps = [ "${sec_comp_dir}/interfaces/inner_api/enhance_kits:libsecurity_component_enhance_sdk" ] - - external_deps = [ - "ability_base:want", - "access_token:libaccesstoken_sdk", - "access_token:libtoken_setproc", - "c_utils:utils", - "hilog:libhilog", - ] -} diff --git a/test/fuzztest/security_component/setenhancecfg_fuzzer/corpus/init b/test/fuzztest/security_component/setenhancecfg_fuzzer/corpus/init deleted file mode 100644 index bc977bd..0000000 --- a/test/fuzztest/security_component/setenhancecfg_fuzzer/corpus/init +++ /dev/null @@ -1,14 +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. - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/security_component/setenhancecfg_fuzzer/project.xml b/test/fuzztest/security_component/setenhancecfg_fuzzer/project.xml deleted file mode 100644 index 6e8ad2c..0000000 --- a/test/fuzztest/security_component/setenhancecfg_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 1000 - - 300 - - 4096 - - diff --git a/test/fuzztest/security_component/setenhancecfg_fuzzer/setenhancecfg_fuzzer.cpp b/test/fuzztest/security_component/setenhancecfg_fuzzer/setenhancecfg_fuzzer.cpp deleted file mode 100644 index be86e48..0000000 --- a/test/fuzztest/security_component/setenhancecfg_fuzzer/setenhancecfg_fuzzer.cpp +++ /dev/null @@ -1,41 +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. - */ - -#include -#include -#include -#include -#include "accesstoken_kit.h" -#include "securec.h" -#include "token_setproc.h" -#include "setenhancecfg_fuzzer.h" - -using namespace OHOS::Security::SecurityComponent; -using namespace OHOS::Security::AccessToken; -namespace OHOS { -static void SetEnhanceCfgFuzzTest(const uint8_t *data, size_t size) -{ - uint8_t *cfg = const_cast(data); - SecCompEnhanceKit::SetEnhanceCfg(cfg, size); -} -} // namespace OHOS - -/* Fuzzer entry point */ -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) -{ - /* Run your code on data */ - OHOS::SetEnhanceCfgFuzzTest(data, size); - return 0; -} diff --git a/test/fuzztest/security_component/setenhancecfg_fuzzer/setenhancecfg_fuzzer.h b/test/fuzztest/security_component/setenhancecfg_fuzzer/setenhancecfg_fuzzer.h deleted file mode 100644 index 47d46f1..0000000 --- a/test/fuzztest/security_component/setenhancecfg_fuzzer/setenhancecfg_fuzzer.h +++ /dev/null @@ -1,21 +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. - */ - -#ifndef SETENHANCE_CFG_FUZZER_H -#define SETENHANCE_CFG_FUZZER_H - -#define FUZZ_PROJECT_NAME "setenhancecfg_fuzzer" -#include "sec_comp_enhance_kit.h" -#endif diff --git a/test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/BUILD.gn b/test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/BUILD.gn deleted file mode 100644 index 02f554e..0000000 --- a/test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/BUILD.gn +++ /dev/null @@ -1,49 +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("//build/config/features.gni") -import("//build/test.gni") -import("../../../../security_component.gni") - -module_output_path = "security_component/security_component" - -ohos_fuzztest("UnregisterSecurityComponentInnerFuzzTest") { - module_out_path = module_output_path - fuzz_config_file = "${sec_comp_dir}/test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer" - - include_dirs = [ - "${sec_comp_dir}/frameworks/common/include", - "${sec_comp_dir}/services/security_component_service/sa/sa_main", - ] - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - configs = [ "${sec_comp_dir}/config:coverage_flags" ] - - cflags_cc = [ "-DHILOG_ENABLE" ] - sources = [ "unregistersecuritycomponentInner_fuzzer.cpp" ] - - deps = [ "${sec_comp_dir}/services/security_component_service/sa:security_component_service" ] - - external_deps = [ - "ability_runtime:app_manager", - "access_token:libaccesstoken_sdk", - "access_token:libtoken_setproc", - "c_utils:utils", - "hilog:libhilog", - "ipc:ipc_core", - ] -} diff --git a/test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/corpus/init b/test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/corpus/init deleted file mode 100644 index bc977bd..0000000 --- a/test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/corpus/init +++ /dev/null @@ -1,14 +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. - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/project.xml b/test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/project.xml deleted file mode 100644 index 6e8ad2c..0000000 --- a/test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 1000 - - 300 - - 4096 - - diff --git a/test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/unregistersecuritycomponentInner_fuzzer.cpp b/test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/unregistersecuritycomponentInner_fuzzer.cpp deleted file mode 100644 index 8eddb37..0000000 --- a/test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/unregistersecuritycomponentInner_fuzzer.cpp +++ /dev/null @@ -1,49 +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. - */ - -#include -#include -#include -#include -#include "accesstoken_kit.h" -#include "securec.h" -#include "token_setproc.h" -#include "sec_comp_service.h" -#include "unregistersecuritycomponentInner_fuzzer.h" - -using namespace OHOS::Security::SecurityComponent; -using namespace OHOS::Security::AccessToken; -namespace OHOS { -static void UnregisterSecurityComponentInnerFuzzTest(const uint8_t *data, size_t size) -{ - uint32_t code = SecurityComponentServiceInterfaceCode::UNREGISTER_SECURITY_COMPONENT; - MessageParcel datas; - datas.WriteInterfaceToken(u"ohos.security.ISecCompService"); - datas.WriteBuffer(data, size); - datas.RewindRead(0); - MessageParcel reply; - MessageOption option; - auto service = std::make_shared(SA_ID_SECURITY_COMPONENT_SERVICE, true); - service->OnRemoteRequest(code, datas, reply, option); -} -} // namespace OHOS - -/* Fuzzer entry point */ -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) -{ - /* Run your code on data */ - OHOS::UnregisterSecurityComponentInnerFuzzTest(data, size); - return 0; -} diff --git a/test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/unregistersecuritycomponentInner_fuzzer.h b/test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/unregistersecuritycomponentInner_fuzzer.h deleted file mode 100644 index 02a5307..0000000 --- a/test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/unregistersecuritycomponentInner_fuzzer.h +++ /dev/null @@ -1,21 +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. - */ - -#ifndef UNREGISTER_SECURITY_COMPONENT_INNER_FUZZER_H -#define UNREGISTER_SECURITY_COMPONENT_INNER_FUZZER_H - -#define FUZZ_PROJECT_NAME "securitycomponent_fuzzer" -#include "sec_comp_stub.h" -#endif diff --git a/test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/BUILD.gn b/test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/BUILD.gn deleted file mode 100644 index 2afbc27..0000000 --- a/test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/BUILD.gn +++ /dev/null @@ -1,48 +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("//build/config/features.gni") -import("//build/test.gni") -import("../../../../security_component.gni") - -module_output_path = "security_component/security_component" - -ohos_fuzztest("UnregisterSecurityComponentFuzzTest") { - module_out_path = module_output_path - fuzz_config_file = "${sec_comp_dir}/test/fuzztest/security_component/unregistersecuritycomponent_fuzzer" - - include_dirs = [ - "${sec_comp_dir}/frameworks/common/include", - "${sec_comp_dir}/interfaces/inner_api/security_component/include", - ] - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - configs = [ "${sec_comp_dir}/config:coverage_flags" ] - - cflags_cc = [ "-DHILOG_ENABLE" ] - sources = [ "unregistersecuritycomponent_fuzzer.cpp" ] - - deps = [ "${sec_comp_dir}/interfaces/inner_api/security_component:libsecurity_component_sdk" ] - - external_deps = [ - "ability_base:want", - "access_token:libaccesstoken_sdk", - "access_token:libtoken_setproc", - "c_utils:utils", - "hilog:libhilog", - ] -} diff --git a/test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/corpus/init b/test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/corpus/init deleted file mode 100644 index bc977bd..0000000 --- a/test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/corpus/init +++ /dev/null @@ -1,14 +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. - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/project.xml b/test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/project.xml deleted file mode 100644 index 6e8ad2c..0000000 --- a/test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 1000 - - 300 - - 4096 - - diff --git a/test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/unregistersecuritycomponent_fuzzer.cpp b/test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/unregistersecuritycomponent_fuzzer.cpp deleted file mode 100644 index 3219fb3..0000000 --- a/test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/unregistersecuritycomponent_fuzzer.cpp +++ /dev/null @@ -1,40 +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. - */ - -#include -#include -#include -#include -#include "accesstoken_kit.h" -#include "securec.h" -#include "token_setproc.h" -#include "unregistersecuritycomponent_fuzzer.h" - -using namespace OHOS::Security::SecurityComponent; -using namespace OHOS::Security::AccessToken; -namespace OHOS { -static void UnregisterSecurityComponentFuzzTest(const uint8_t *data, size_t size) -{ - SecCompKit::UnregisterSecurityComponent(size); -} -} // namespace OHOS - -/* Fuzzer entry point */ -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) -{ - /* Run your code on data */ - OHOS::UnregisterSecurityComponentFuzzTest(data, size); - return 0; -} diff --git a/test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/unregistersecuritycomponent_fuzzer.h b/test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/unregistersecuritycomponent_fuzzer.h deleted file mode 100644 index 794af54..0000000 --- a/test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/unregistersecuritycomponent_fuzzer.h +++ /dev/null @@ -1,21 +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. - */ - -#ifndef UNREGISTER_SECURITY_COMPONENT_FUZZER_H -#define UNREGISTER_SECURITY_COMPONENT_FUZZER_H - -#define FUZZ_PROJECT_NAME "securitycomponent_fuzzer" -#include "sec_comp_kit.h" -#endif diff --git a/test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/BUILD.gn b/test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/BUILD.gn deleted file mode 100644 index 061dcc7..0000000 --- a/test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/BUILD.gn +++ /dev/null @@ -1,49 +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("//build/config/features.gni") -import("//build/test.gni") -import("../../../../security_component.gni") - -module_output_path = "security_component/security_component" - -ohos_fuzztest("UpdateSecurityComponentInnerFuzzTest") { - module_out_path = module_output_path - fuzz_config_file = "${sec_comp_dir}/test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer" - - include_dirs = [ - "${sec_comp_dir}/frameworks/common/include", - "${sec_comp_dir}/services/security_component_service/sa/sa_main", - ] - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - configs = [ "${sec_comp_dir}/config:coverage_flags" ] - - cflags_cc = [ "-DHILOG_ENABLE" ] - sources = [ "updatesecuritycomponentInner_fuzzer.cpp" ] - - deps = [ "${sec_comp_dir}/services/security_component_service/sa:security_component_service" ] - - external_deps = [ - "ability_runtime:app_manager", - "access_token:libaccesstoken_sdk", - "access_token:libtoken_setproc", - "c_utils:utils", - "hilog:libhilog", - "ipc:ipc_core", - ] -} diff --git a/test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/corpus/init b/test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/corpus/init deleted file mode 100644 index bc977bd..0000000 --- a/test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/corpus/init +++ /dev/null @@ -1,14 +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. - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/project.xml b/test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/project.xml deleted file mode 100644 index 6e8ad2c..0000000 --- a/test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 1000 - - 300 - - 4096 - - diff --git a/test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/updatesecuritycomponentInner_fuzzer.cpp b/test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/updatesecuritycomponentInner_fuzzer.cpp deleted file mode 100644 index 7f1ab9f..0000000 --- a/test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/updatesecuritycomponentInner_fuzzer.cpp +++ /dev/null @@ -1,49 +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. - */ - -#include -#include -#include -#include -#include "accesstoken_kit.h" -#include "securec.h" -#include "token_setproc.h" -#include "sec_comp_service.h" -#include "updatesecuritycomponentInner_fuzzer.h" - -using namespace OHOS::Security::SecurityComponent; -using namespace OHOS::Security::AccessToken; -namespace OHOS { -static void UpdateSecurityComponentInnerFuzzTest(const uint8_t *data, size_t size) -{ - uint32_t code = SecurityComponentServiceInterfaceCode::UPDATE_SECURITY_COMPONENT; - MessageParcel datas; - datas.WriteInterfaceToken(u"ohos.security.ISecCompService"); - datas.WriteBuffer(data, size); - datas.RewindRead(0); - MessageParcel reply; - MessageOption option; - auto service = std::make_shared(SA_ID_SECURITY_COMPONENT_SERVICE, true); - service->OnRemoteRequest(code, datas, reply, option); -} -} // namespace OHOS - -/* Fuzzer entry point */ -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) -{ - /* Run your code on data */ - OHOS::UpdateSecurityComponentInnerFuzzTest(data, size); - return 0; -} diff --git a/test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/updatesecuritycomponentInner_fuzzer.h b/test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/updatesecuritycomponentInner_fuzzer.h deleted file mode 100644 index 2d25590..0000000 --- a/test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/updatesecuritycomponentInner_fuzzer.h +++ /dev/null @@ -1,21 +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. - */ - -#ifndef UPDATE_SECURITY_COMPONENT_INNER_FUZZER_H -#define UPDATE_SECURITY_COMPONENT_INNER_FUZZER_H - -#define FUZZ_PROJECT_NAME "securitycomponent_fuzzer" -#include "sec_comp_stub.h" -#endif diff --git a/test/fuzztest/security_component/updatesecuritycomponent_fuzzer/BUILD.gn b/test/fuzztest/security_component/updatesecuritycomponent_fuzzer/BUILD.gn deleted file mode 100644 index 0e675b2..0000000 --- a/test/fuzztest/security_component/updatesecuritycomponent_fuzzer/BUILD.gn +++ /dev/null @@ -1,52 +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("//build/config/features.gni") -import("//build/test.gni") -import("../../../../security_component.gni") - -module_output_path = "security_component/security_component" - -ohos_fuzztest("UpdateSecurityComponentFuzzTest") { - module_out_path = module_output_path - fuzz_config_file = "${sec_comp_dir}/test/fuzztest/security_component/updatesecuritycomponent_fuzzer" - - include_dirs = [ - "${sec_comp_dir}/frameworks/common/include", - "${sec_comp_dir}/services/security_component_service/sa/sa_main", - ] - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - configs = [ "${sec_comp_dir}/config:coverage_flags" ] - - cflags_cc = [ "-DHILOG_ENABLE" ] - sources = [ "updatesecuritycomponent_fuzzer.cpp" ] - - deps = [ - "${sec_comp_dir}/interfaces/inner_api/security_component:libsecurity_component_sdk", - "${sec_comp_dir}/services/security_component_service/sa:security_component_service", - ] - - external_deps = [ - "ability_runtime:app_manager", - "access_token:libaccesstoken_sdk", - "access_token:libtoken_setproc", - "c_utils:utils", - "hilog:libhilog", - "ipc:ipc_core", - ] -} diff --git a/test/fuzztest/security_component/updatesecuritycomponent_fuzzer/corpus/init b/test/fuzztest/security_component/updatesecuritycomponent_fuzzer/corpus/init deleted file mode 100644 index bc977bd..0000000 --- a/test/fuzztest/security_component/updatesecuritycomponent_fuzzer/corpus/init +++ /dev/null @@ -1,14 +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. - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/security_component/updatesecuritycomponent_fuzzer/project.xml b/test/fuzztest/security_component/updatesecuritycomponent_fuzzer/project.xml deleted file mode 100644 index 6e8ad2c..0000000 --- a/test/fuzztest/security_component/updatesecuritycomponent_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 1000 - - 300 - - 4096 - - diff --git a/test/fuzztest/security_component/updatesecuritycomponent_fuzzer/updatesecuritycomponent_fuzzer.cpp b/test/fuzztest/security_component/updatesecuritycomponent_fuzzer/updatesecuritycomponent_fuzzer.cpp deleted file mode 100644 index 0a15493..0000000 --- a/test/fuzztest/security_component/updatesecuritycomponent_fuzzer/updatesecuritycomponent_fuzzer.cpp +++ /dev/null @@ -1,41 +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. - */ - -#include -#include -#include -#include -#include "accesstoken_kit.h" -#include "securec.h" -#include "token_setproc.h" -#include "updatesecuritycomponent_fuzzer.h" - -using namespace OHOS::Security::SecurityComponent; -using namespace OHOS::Security::AccessToken; -namespace OHOS { -static void UpdateSecurityComponentFuzzTest(const uint8_t *data, size_t size) -{ - std::string str(reinterpret_cast(data), size); - SecCompKit::UpdateSecurityComponent(size, str); -} -} // namespace OHOS - -/* Fuzzer entry point */ -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) -{ - /* Run your code on data */ - OHOS::UpdateSecurityComponentFuzzTest(data, size); - return 0; -} diff --git a/test/fuzztest/security_component/updatesecuritycomponent_fuzzer/updatesecuritycomponent_fuzzer.h b/test/fuzztest/security_component/updatesecuritycomponent_fuzzer/updatesecuritycomponent_fuzzer.h deleted file mode 100644 index 85f7f16..0000000 --- a/test/fuzztest/security_component/updatesecuritycomponent_fuzzer/updatesecuritycomponent_fuzzer.h +++ /dev/null @@ -1,21 +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. - */ - -#ifndef UPDATE_SECURITY_COMPONENT_FUZZER_H -#define UPDATE_SECURITY_COMPONENT_FUZZER_H - -#define FUZZ_PROJECT_NAME "securitycomponent_fuzzer" -#include "sec_comp_kit.h" -#endif diff --git a/test/security_component/AppScope/app.json b/test/security_component/AppScope/app.json deleted file mode 100644 index bbf7ecc..0000000 --- a/test/security_component/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.securitycomponent", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon": "$media:icon", - "label": "$string:app_name", - "description": "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive": true, - "singleUser": true, - "minAPIVersion": 10, - "targetAPIVersion": 10, - "car": { - "apiCompatibleVersion": 10, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/test/security_component/AppScope/resources/base/element/string.json b/test/security_component/AppScope/resources/base/element/string.json deleted file mode 100644 index 633100a..0000000 --- a/test/security_component/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string":[ - { - "name":"app_name", - "value":"ohosProject" - } - ] -} \ No newline at end of file diff --git a/test/security_component/AppScope/resources/base/media/app_icon.png b/test/security_component/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4ZzgdeKtgoc+o5EvN9A1K1_<>M?MBqb#!ASf&# zEX?<)!RH(7>1P+j=jqG(58}TVN-$psA6K}atCuI!KTJD&FMmH-78ZejBm)0qc{ESp z|LuG1{QnBUJRg_E=h1#XMWt2%fcoN@l7eAS!Es?Q+;XsRNPhiiE=@AqlLkJzF`O18 zbsbSmKN=aaq8k3NFYZfDWpKmM!coBU0(XnL8R{4=i|wi{!uWYM2je{U{B*K2PVdu&=E zTq*-XsEsJ$u5H4g6DIm2Y!DN`>^v|AqlwuCD;w45K0@eqauiqWf7l&o)+YLHm~|L~ z7$0v5mkobriU!H<@mVJHLlmQqzQ3d6Rh_-|%Yy2li*tHO>_vcnuZ7OR_xkAIuIU&x z-|8Y0wj|6|a6_I(v91y%k_kNw6pnkNdxjqG8!%Vz_d%c_!X+6-;1`GC9_FpjoHev5fEV7RhJ>r=mh-jp$fqbqRJ=obwdgLDVP5+s zy1=_DWG0Y-Jb3t^WXmkr(d9~08k-|#Ly zaNOmT(^9tIb&eb4%CzIT zAm3CUtWSr1t4?h1kk#NBi{U|pJslvME{q|_eS^3En>SOq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mxYak6?`Pp#c;**_SYmi`&z23 z`p6_~ePvH)C6x-G9$hgL=eVALq`-AiamN>!3~Lxw&{H(b{B(7xSRm6<3<{%{yXiH# zos5Rv1L+8fUKJLo%P>4I&$}y { - - }) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/test/security_component/entry/src/main/ets/MainAbility/pages/locationButton.ets b/test/security_component/entry/src/main/ets/MainAbility/pages/locationButton.ets deleted file mode 100644 index ef207ff..0000000 --- a/test/security_component/entry/src/main/ets/MainAbility/pages/locationButton.ets +++ /dev/null @@ -1,241 +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 events_emitter from '@ohos.events.emitter' - -@Entry -@Component -struct locationButton { - @State bgType: ButtonType = ButtonType.Normal - @State iconSize: number = 16 - @State direct: SecurityComponentLayoutDirection = 0 - @State positionX: number = 0 - @State positionY: number = 0 - @State anchorX: number = 0 - @State anchorY: number = 0 - @State offsetX: number = 0 - @State offsetY: number = 0 - @State fontSize: number = 16 - @State fontStyle: FontStyle = FontStyle.Normal - @State fontWeight: FontWeight = FontWeight.Medium - @State fontFamily: string = 'HarmonyOS Sans' - @State fontColor: number = 0xffffffff - @State iconColor: number = 0xffffffff - @State bgColor: number = 0xff007dff - @State borderSty: BorderStyle = BorderStyle.Dashed - @State borderWid: number = 0 - @State borderCol: number = 0xffffffff - @State borderRad: number = 0 - @State left: number = 24 - @State right: number = 24 - @State top: number = 8 - @State bottom: number = 8 - @State middle: number = 4 - @State clipSet: boolean = false - @State columnWidth: string = '100%' - @State columnHeight: string = '100%' - private stateChangeCallBack = (eventData) => { - if (eventData != null) { - console.debug("====>page_locationButton page state change called:" + JSON.stringify(eventData)); - if (eventData.data.bgType != null) { - this.bgType = eventData.data.bgType; - } - if (eventData.data.iconSize != null) { - this.iconSize = eventData.data.iconSize; - } - if (eventData.data.direct != null) { - this.direct = eventData.data.direct; - } - if (eventData.data.positionX != null) { - this.positionX = eventData.data.positionX; - } - if (eventData.data.positionY != null) { - this.positionY = eventData.data.positionY; - } - if (eventData.data.anchorX != null) { - this.anchorX = eventData.data.anchorX; - } - if (eventData.data.anchorY != null) { - this.anchorY = eventData.data.anchorY; - } - if (eventData.data.offsetX != null) { - this.offsetX = eventData.data.offsetX; - } - if (eventData.data.offsetY != null) { - this.offsetY = eventData.data.offsetY; - } - if (eventData.data.fontSize != null) { - this.fontSize = eventData.data.fontSize; - } - if (eventData.data.fontStyle != null) { - this.fontStyle = eventData.data.fontStyle; - } - if (eventData.data.fontWeight != null) { - this.fontWeight = eventData.data.fontWeight; - } - if (eventData.data.fontFamily != null) { - this.fontFamily = eventData.data.fontFamily; - } - if (eventData.data.fontColor != null) { - this.fontColor = eventData.data.fontColor; - } - if (eventData.data.iconColor != null) { - this.iconColor = eventData.data.iconColor; - } - if (eventData.data.bgColor != null) { - this.bgColor = eventData.data.bgColor; - } - if (eventData.data.borderSty != null) { - this.borderSty = eventData.data.borderSty; - } - if (eventData.data.borderWid != null) { - this.borderWid = eventData.data.borderWid; - } - if (eventData.data.borderCol != null) { - this.borderCol = eventData.data.borderCol; - } - if (eventData.data.borderRad != null) { - this.borderRad = eventData.data.borderRad; - } - if (eventData.data.left != null) { - this.left = eventData.data.left; - } - if (eventData.data.right != null) { - this.right = eventData.data.right; - } - if (eventData.data.top != null) { - this.top = eventData.data.top; - } - if (eventData.data.bottom != null) { - this.bottom = eventData.data.bottom; - } - if (eventData.data.middle != null) { - this.middle = eventData.data.middle; - } - if (eventData.data.clipSet != null) { - this.clipSet = eventData.data.clipSet; - } - if (eventData.data.columnWidth != null) { - this.columnWidth = eventData.data.columnWidth; - } - if (eventData.data.columnHeight != null) { - this.columnHeight = eventData.data.columnHeight; - } - } - } - - onPageShow() { - console.debug('====>page_locationButton page show called'); - var stateChangeEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - events_emitter.on(stateChangeEvent, this.stateChangeCallBack); - } - - onPageHide() { - console.debug('====>page_locationButton page hide called'); - events_emitter.off(1); - } - - build() { - Row() { - Column() { - LocationButton({ icon: LocationIconStyle.FULL_FILLED, text: LocationDescription.CURRENT_LOCATION, buttonType: this.bgType }) - .onClick((event: ClickEvent, result: LocationButtonOnClickResult) => { - try { - var clickData = { - data: { - "clickResult": result, - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>page_locationButton onclick result:" + JSON.stringify(result)) - events_emitter.emit(clickEvent, clickData) - } catch (err) { - console.debug("====>page_locationButton emit action state err: " + JSON.stringify(err.message)) - } - }) - .iconSize(this.iconSize) - .layoutDirection(this.direct) - .position({ x: this.positionX, y: this.positionY }) - .markAnchor({ x: this.anchorX, y: this.anchorY }) - .offset({ x: this.offsetX, y: this.offsetY }) - .fontSize(this.fontSize) - .fontStyle(this.fontStyle) - .fontWeight(this.fontWeight) - .fontFamily(this.fontFamily) - .fontColor(this.fontColor) - .iconColor(this.iconColor) - .backgroundColor(this.bgColor) - .borderStyle(this.borderSty) - .borderWidth(this.borderWid) - .borderColor(this.borderCol) - .borderRadius(this.borderRad) - .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) - .textIconSpace(this.middle) - .key("keyLocation") - Button() { - Text('--------------------') - .fontSize(25) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 200, - bottom:60 - }).backgroundColor('#00000000') - LocationButton({ icon: LocationIconStyle.FULL_FILLED, text: LocationDescription.CURRENT_LOCATION, buttonType: this.bgType }) - .onClick((event: ClickEvent, result: LocationButtonOnClickResult) => { - try { - var clickData = { - data: { - "clickResult": result - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>page_LocationButton onclick result:" + JSON.stringify(result)) - events_emitter.emit(clickEvent, clickData) - } catch (err) { - console.debug("====>page_LocationButton emit action state err: " + JSON.stringify(err.message)) - } - }) - .iconSize(this.iconSize) - .layoutDirection(this.direct) - .markAnchor({ x: this.anchorX, y: this.anchorY }) - .offset({ x: this.offsetX, y: this.offsetY }) - .fontSize(this.fontSize) - .fontStyle(this.fontStyle) - .fontWeight(this.fontWeight) - .fontFamily(this.fontFamily) - .fontColor(this.fontColor) - .iconColor(this.iconColor) - .backgroundColor(this.bgColor) - .borderStyle(this.borderSty) - .borderWidth(this.borderWid) - .borderColor(this.borderCol) - .borderRadius(this.borderRad) - .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) - .textIconSpace(this.middle) - .key("keyLocation1") - }.width(this.columnWidth).height(this.columnHeight).clip(this.clipSet) - }.height('100%') - } -} diff --git a/test/security_component/entry/src/main/ets/MainAbility/pages/locationButton_1.ets b/test/security_component/entry/src/main/ets/MainAbility/pages/locationButton_1.ets deleted file mode 100644 index 9fe207c..0000000 --- a/test/security_component/entry/src/main/ets/MainAbility/pages/locationButton_1.ets +++ /dev/null @@ -1,432 +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 events_emitter from '@ohos.events.emitter' - -@Entry -@Component -struct locationButton_1 { - @State bgType: ButtonType = ButtonType.Normal - @State iconSize: number = 16 - @State positionX: number = 0 - @State positionY: number = 0 - @State anchorX: number = 0 - @State anchorY: number = 0 - @State offsetX: number = 0 - @State offsetY: number = 0 - @State fontSize: number = 16 - @State fontStyle: FontStyle = FontStyle.Normal - @State fontWeight: FontWeight = FontWeight.Medium - @State fontFamily: string = 'HarmonyOS Sans' - @State fontColor: number = 0xffffffff - @State iconColor: number = 0xffffffff - @State bgColor: number = 0x7dff - @State borderSty: BorderStyle = BorderStyle.Dashed - @State borderWid: number = 0 - @State borderCol: number = 0xffffffff - @State borderRad: number = 0 - @State left: number = 24 - @State right: number = 24 - @State top: number = 8 - @State bottom: number = 8 - @State middle: number = 4 - @State heightValue: number = 4 - marginValue = {top:30, bottom:30, left:10, right:10} - - build() { - Column() { - Row() { - LocationButton({ icon: LocationIconStyle.LINES, text: LocationDescription.ADD_LOCATION, buttonType: this.bgType }) - .onClick((event: ClickEvent, result: LocationButtonOnClickResult) => { - try { - var clickData = { - data: { - "clickResult": result, - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>page_LocationButton onclick result:" + JSON.stringify(result)) - events_emitter.emit(clickEvent, clickData) - } catch (err) { - console.debug("====>page_LocationButton emit action state err: " + JSON.stringify(err.message)) - } - }) - .iconSize(this.iconSize) - .layoutDirection(SecurityComponentLayoutDirection.HORIZONTAL) - .markAnchor({ x: this.anchorX, y: this.anchorY }) - .offset({ x: this.offsetX, y: 0 }) - .fontSize(this.fontSize) - .fontStyle(this.fontStyle) - .fontWeight(this.fontWeight) - .fontFamily(this.fontFamily) - .fontColor('0xFFFFF000') - .iconColor(this.iconColor) - .backgroundColor(this.bgColor) - .borderStyle(this.borderSty) - .borderWidth(this.borderWid) - .borderColor(this.borderCol) - .borderRadius(this.borderRad) - .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) - .textIconSpace(this.middle) - .key("keyLocation2") - }.width('100%').height(this.heightValue).margin(this.marginValue) - Row() { - LocationButton({ icon: LocationIconStyle.FULL_FILLED, text: LocationDescription.SELECT_LOCATION, buttonType: this.bgType }) - .onClick((event: ClickEvent, result: LocationButtonOnClickResult) => { - try { - var clickData = { - data: { - "clickResult": result, - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>page_LocationButton onclick result:" + JSON.stringify(result)) - events_emitter.emit(clickEvent, clickData) - } catch (err) { - console.debug("====>page_LocationButton emit action state err: " + JSON.stringify(err.message)) - } - }) - .iconSize(this.iconSize) - .layoutDirection(SecurityComponentLayoutDirection.VERTICAL) - .markAnchor({ x: this.anchorX, y: this.anchorY }) - .offset({ x: this.offsetX, y: 0 }) - .fontSize(this.fontSize) - .fontStyle(this.fontStyle) - .fontWeight(this.fontWeight) - .fontFamily(this.fontFamily) - .fontColor('0xFFFFF000') - .iconColor(this.iconColor) - .backgroundColor(this.bgColor) - .borderStyle(this.borderSty) - .borderWidth(this.borderWid) - .borderColor(this.borderCol) - .borderRadius(this.borderRad) - .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) - .textIconSpace(this.middle) - .key("keyLocation3") - }.width('100%').height(this.heightValue).margin(this.marginValue) - Row() { - LocationButton({ icon: LocationIconStyle.FULL_FILLED, text: LocationDescription.SHARE_LOCATION, buttonType: this.bgType }) - .onClick((event: ClickEvent, result: LocationButtonOnClickResult) => { - try { - var clickData = { - data: { - "clickResult": result, - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>page_LocationButton onclick result:" + JSON.stringify(result)) - events_emitter.emit(clickEvent, clickData) - } catch (err) { - console.debug("====>page_LocationButton emit action state err: " + JSON.stringify(err.message)) - } - }) - .iconSize(this.iconSize) - .layoutDirection(SecurityComponentLayoutDirection.HORIZONTAL) - .markAnchor({ x: this.anchorX, y: this.anchorY }) - .offset({ x: this.offsetX, y: 0 }) - .fontSize(this.fontSize) - .fontStyle(this.fontStyle) - .fontWeight(this.fontWeight) - .fontFamily(this.fontFamily) - .fontColor('0xFFFFF000') - .iconColor(this.iconColor) - .backgroundColor(this.bgColor) - .borderStyle(this.borderSty) - .borderWidth(this.borderWid) - .borderColor(this.borderCol) - .borderRadius(this.borderRad) - .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) - .textIconSpace(this.middle) - .key("keyLocation4") - }.width('100%').height(this.heightValue).margin(this.marginValue) - Row() { - LocationButton({ icon: LocationIconStyle.FULL_FILLED, text: LocationDescription.SEND_LOCATION, buttonType: this.bgType }) - .onClick((event: ClickEvent, result: LocationButtonOnClickResult) => { - try { - var clickData = { - data: { - "clickResult": result, - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>page_LocationButton onclick result:" + JSON.stringify(result)) - events_emitter.emit(clickEvent, clickData) - } catch (err) { - console.debug("====>page_LocationButton emit action state err: " + JSON.stringify(err.message)) - } - }) - .iconSize(this.iconSize) - .layoutDirection(SecurityComponentLayoutDirection.HORIZONTAL) - .markAnchor({ x: this.anchorX, y: this.anchorY }) - .offset({ x: this.offsetX, y: 0 }) - .fontSize(this.fontSize) - .fontStyle(this.fontStyle) - .fontWeight(this.fontWeight) - .fontFamily(this.fontFamily) - .fontColor('0xFFFFF000') - .iconColor(this.iconColor) - .backgroundColor(this.bgColor) - .borderStyle(this.borderSty) - .borderWidth(this.borderWid) - .borderColor(this.borderCol) - .borderRadius(this.borderRad) - .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) - .textIconSpace(this.middle) - .key("keyLocation5") - }.width('100%').height(this.heightValue).margin(this.marginValue) - Row() { - LocationButton({ icon: LocationIconStyle.FULL_FILLED, text: LocationDescription.LOCATING, buttonType: this.bgType }) - .onClick((event: ClickEvent, result: LocationButtonOnClickResult) => { - try { - var clickData = { - data: { - "clickResult": result, - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>page_LocationButton onclick result:" + JSON.stringify(result)) - events_emitter.emit(clickEvent, clickData) - } catch (err) { - console.debug("====>page_LocationButton emit action state err: " + JSON.stringify(err.message)) - } - }) - .iconSize(this.iconSize) - .layoutDirection(SecurityComponentLayoutDirection.HORIZONTAL) - .markAnchor({ x: this.anchorX, y: this.anchorY }) - .offset({ x: this.offsetX, y: 0 }) - .fontSize(this.fontSize) - .fontStyle(this.fontStyle) - .fontWeight(this.fontWeight) - .fontFamily(this.fontFamily) - .fontColor('0xFFFFF000') - .iconColor(this.iconColor) - .backgroundColor(this.bgColor) - .borderStyle(this.borderSty) - .borderWidth(this.borderWid) - .borderColor(this.borderCol) - .borderRadius(this.borderRad) - .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) - .textIconSpace(this.middle) - .key("keyLocation6") - }.width('100%').height(this.heightValue).margin(this.marginValue) - Row() { - LocationButton({ icon: LocationIconStyle.FULL_FILLED, text: LocationDescription.LOCATION, buttonType: this.bgType }) - .onClick((event: ClickEvent, result: LocationButtonOnClickResult) => { - try { - var clickData = { - data: { - "clickResult": result, - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>page_LocationButton onclick result:" + JSON.stringify(result)) - events_emitter.emit(clickEvent, clickData) - } catch (err) { - console.debug("====>page_LocationButton emit action state err: " + JSON.stringify(err.message)) - } - }) - .iconSize(this.iconSize) - .layoutDirection(SecurityComponentLayoutDirection.HORIZONTAL) - .markAnchor({ x: this.anchorX, y: this.anchorY }) - .offset({ x: this.offsetX, y: 0 }) - .fontSize(this.fontSize) - .fontStyle(this.fontStyle) - .fontWeight(this.fontWeight) - .fontFamily(this.fontFamily) - .fontColor('0xFFFFF000') - .iconColor(this.iconColor) - .backgroundColor(this.bgColor) - .borderStyle(this.borderSty) - .borderWidth(this.borderWid) - .borderColor(this.borderCol) - .borderRadius(this.borderRad) - .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) - .textIconSpace(this.middle) - .key("keyLocation7") - }.width('100%').height(this.heightValue).margin(this.marginValue) - Row() { - LocationButton({ icon: LocationIconStyle.FULL_FILLED, text: LocationDescription.SEND_CURRENT_LOCATION, buttonType: this.bgType }) - .onClick((event: ClickEvent, result: LocationButtonOnClickResult) => { - try { - var clickData = { - data: { - "clickResult": result, - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>page_LocationButton onclick result:" + JSON.stringify(result)) - events_emitter.emit(clickEvent, clickData) - } catch (err) { - console.debug("====>page_LocationButton emit action state err: " + JSON.stringify(err.message)) - } - }) - .iconSize(this.iconSize) - .layoutDirection(SecurityComponentLayoutDirection.HORIZONTAL) - .markAnchor({ x: this.anchorX, y: this.anchorY }) - .offset({ x: this.offsetX, y: 0 }) - .fontSize(this.fontSize) - .fontStyle(this.fontStyle) - .fontWeight(this.fontWeight) - .fontFamily(this.fontFamily) - .fontColor('0xFFFFF000') - .iconColor(this.iconColor) - .backgroundColor(this.bgColor) - .borderStyle(this.borderSty) - .borderWidth(this.borderWid) - .borderColor(this.borderCol) - .borderRadius(this.borderRad) - .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) - .textIconSpace(this.middle) - .key("keyLocation8") - }.width('100%').height(this.heightValue).margin(this.marginValue) - Row() { - LocationButton({ icon: LocationIconStyle.FULL_FILLED, text: LocationDescription.RELOCATION, buttonType: this.bgType }) - .onClick((event: ClickEvent, result: LocationButtonOnClickResult) => { - try { - var clickData = { - data: { - "clickResult": result, - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>page_LocationButton onclick result:" + JSON.stringify(result)) - events_emitter.emit(clickEvent, clickData) - } catch (err) { - console.debug("====>page_LocationButton emit action state err: " + JSON.stringify(err.message)) - } - }) - .iconSize(this.iconSize) - .layoutDirection(SecurityComponentLayoutDirection.HORIZONTAL) - .markAnchor({ x: this.anchorX, y: this.anchorY }) - .offset({ x: this.offsetX, y: 0 }) - .fontSize(this.fontSize) - .fontStyle(this.fontStyle) - .fontWeight(this.fontWeight) - .fontFamily(this.fontFamily) - .fontColor('0xFFFFF000') - .iconColor(this.iconColor) - .backgroundColor(this.bgColor) - .borderStyle(this.borderSty) - .borderWidth(this.borderWid) - .borderColor(this.borderCol) - .borderRadius(this.borderRad) - .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) - .textIconSpace(this.middle) - .key("keyLocation9") - }.width('100%').height(this.heightValue).margin(this.marginValue) - Row() { - LocationButton({ icon: LocationIconStyle.FULL_FILLED, text: LocationDescription.PUNCH_IN, buttonType: this.bgType }) - .onClick((event: ClickEvent, result: LocationButtonOnClickResult) => { - try { - var clickData = { - data: { - "clickResult": result, - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>page_LocationButton onclick result:" + JSON.stringify(result)) - events_emitter.emit(clickEvent, clickData) - } catch (err) { - console.debug("====>page_LocationButton emit action state err: " + JSON.stringify(err.message)) - } - }) - .iconSize(this.iconSize) - .layoutDirection(SecurityComponentLayoutDirection.HORIZONTAL) - .markAnchor({ x: this.anchorX, y: this.anchorY }) - .offset({ x: this.offsetX, y: 0 }) - .fontSize(this.fontSize) - .fontStyle(this.fontStyle) - .fontWeight(this.fontWeight) - .fontFamily(this.fontFamily) - .fontColor('0xFFFFF000') - .iconColor(this.iconColor) - .backgroundColor(this.bgColor) - .borderStyle(this.borderSty) - .borderWidth(this.borderWid) - .borderColor(this.borderCol) - .borderRadius(this.borderRad) - .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) - .textIconSpace(this.middle) - .key("keyLocation10") - }.width('100%').height(this.heightValue).margin(this.marginValue) - Row() { - LocationButton({ icon: LocationIconStyle.FULL_FILLED, text: LocationDescription.CURRENT_POSITION, buttonType: this.bgType }) - .onClick((event: ClickEvent, result: LocationButtonOnClickResult) => { - try { - var clickData = { - data: { - "clickResult": result, - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>page_LocationButton onclick result:" + JSON.stringify(result)) - events_emitter.emit(clickEvent, clickData) - } catch (err) { - console.debug("====>page_LocationButton emit action state err: " + JSON.stringify(err.message)) - } - }) - .iconSize(this.iconSize) - .layoutDirection(SecurityComponentLayoutDirection.HORIZONTAL) - .markAnchor({ x: this.anchorX, y: this.anchorY }) - .offset({ x: this.offsetX, y: 0 }) - .fontSize(this.fontSize) - .fontStyle(this.fontStyle) - .fontWeight(this.fontWeight) - .fontFamily(this.fontFamily) - .fontColor('0xFFFFF000') - .iconColor(this.iconColor) - .backgroundColor(this.bgColor) - .borderStyle(this.borderSty) - .borderWidth(this.borderWid) - .borderColor(this.borderCol) - .borderRadius(this.borderRad) - .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) - .textIconSpace(this.middle) - .key("keyLocation11") - }.width('100%').height(this.heightValue).margin(this.marginValue) - } - } -} diff --git a/test/security_component/entry/src/main/ets/MainAbility/pages/pasteButton.ets b/test/security_component/entry/src/main/ets/MainAbility/pages/pasteButton.ets deleted file mode 100644 index dc8e319..0000000 --- a/test/security_component/entry/src/main/ets/MainAbility/pages/pasteButton.ets +++ /dev/null @@ -1,241 +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 events_emitter from '@ohos.events.emitter' - -@Entry -@Component -struct pasteButton { - @State bgType: ButtonType = ButtonType.Normal - @State iconSize: number = 16 - @State direct: SecurityComponentLayoutDirection = 0 - @State positionX: number = 0 - @State positionY: number = 0 - @State anchorX: number = 0 - @State anchorY: number = 0 - @State offsetX: number = 0 - @State offsetY: number = 0 - @State fontSize: number = 16 - @State fontStyle: FontStyle = FontStyle.Normal - @State fontWeight: FontWeight = FontWeight.Medium - @State fontFamily: string = 'HarmonyOS Sans' - @State fontColor: number = 0xffffffff - @State iconColor: number = 0xffffffff - @State bgColor: number = 0xff007dff - @State borderSty: BorderStyle = BorderStyle.Dashed - @State borderWid: number = 0 - @State borderCol: number = 0xffffffff - @State borderRad: number = 0 - @State left: number = 24 - @State right: number = 24 - @State top: number = 8 - @State bottom: number = 8 - @State middle: number = 4 - @State clipSet: boolean = false - @State columnWidth: string = '100%' - @State columnHeight: string = '100%' - private stateChangeCallBack = (eventData) => { - if (eventData != null) { - console.debug("====>page_pasteButton page state change called:" + JSON.stringify(eventData)); - if (eventData.data.bgType != null) { - this.bgType = eventData.data.bgType; - } - if (eventData.data.iconSize != null) { - this.iconSize = eventData.data.iconSize; - } - if (eventData.data.direct != null) { - this.direct = eventData.data.direct; - } - if (eventData.data.positionX != null) { - this.positionX = eventData.data.positionX; - } - if (eventData.data.positionY != null) { - this.positionY = eventData.data.positionY; - } - if (eventData.data.anchorX != null) { - this.anchorX = eventData.data.anchorX; - } - if (eventData.data.anchorY != null) { - this.anchorY = eventData.data.anchorY; - } - if (eventData.data.offsetX != null) { - this.offsetX = eventData.data.offsetX; - } - if (eventData.data.offsetY != null) { - this.offsetY = eventData.data.offsetY; - } - if (eventData.data.fontSize != null) { - this.fontSize = eventData.data.fontSize; - } - if (eventData.data.fontStyle != null) { - this.fontStyle = eventData.data.fontStyle; - } - if (eventData.data.fontWeight != null) { - this.fontWeight = eventData.data.fontWeight; - } - if (eventData.data.fontFamily != null) { - this.fontFamily = eventData.data.fontFamily; - } - if (eventData.data.fontColor != null) { - this.fontColor = eventData.data.fontColor; - } - if (eventData.data.iconColor != null) { - this.iconColor = eventData.data.iconColor; - } - if (eventData.data.bgColor != null) { - this.bgColor = eventData.data.bgColor; - } - if (eventData.data.borderSty != null) { - this.borderSty = eventData.data.borderSty; - } - if (eventData.data.borderWid != null) { - this.borderWid = eventData.data.borderWid; - } - if (eventData.data.borderCol != null) { - this.borderCol = eventData.data.borderCol; - } - if (eventData.data.borderRad != null) { - this.borderRad = eventData.data.borderRad; - } - if (eventData.data.left != null) { - this.left = eventData.data.left; - } - if (eventData.data.right != null) { - this.right = eventData.data.right; - } - if (eventData.data.top != null) { - this.top = eventData.data.top; - } - if (eventData.data.bottom != null) { - this.bottom = eventData.data.bottom; - } - if (eventData.data.middle != null) { - this.middle = eventData.data.middle; - } - if (eventData.data.clipSet != null) { - this.clipSet = eventData.data.clipSet; - } - if (eventData.data.columnWidth != null) { - this.columnWidth = eventData.data.columnWidth; - } - if (eventData.data.columnHeight != null) { - this.columnHeight = eventData.data.columnHeight; - } - } - } - - onPageShow() { - console.debug('====>page_pasteButton page show called'); - var stateChangeEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - events_emitter.on(stateChangeEvent, this.stateChangeCallBack); - } - - onPageHide() { - console.debug('====>page_pasteButton page hide called'); - events_emitter.off(1); - } - - build() { - Row() { - Column() { - PasteButton({ icon: PasteIconStyle.LINES, text: PasteDescription.PASTE, buttonType: this.bgType }) - .onClick((event: ClickEvent, result: PasteButtonOnClickResult) => { - try { - var clickData = { - data: { - "clickResult": result, - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>page_pasteButton onclick result:" + JSON.stringify(result)) - events_emitter.emit(clickEvent, clickData) - } catch (err) { - console.debug("====>page_pasteButton emit action state err: " + JSON.stringify(err.message)) - } - }) - .iconSize(this.iconSize) - .layoutDirection(this.direct) - .position({ x: this.positionX, y: this.positionY }) - .markAnchor({ x: this.anchorX, y: this.anchorY }) - .offset({ x: this.offsetX, y: this.offsetY }) - .fontSize(this.fontSize) - .fontStyle(this.fontStyle) - .fontWeight(this.fontWeight) - .fontFamily(this.fontFamily) - .fontColor(this.fontColor) - .iconColor(this.iconColor) - .backgroundColor(this.bgColor) - .borderStyle(this.borderSty) - .borderWidth(this.borderWid) - .borderColor(this.borderCol) - .borderRadius(this.borderRad) - .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) - .textIconSpace(this.middle) - .key("keyPaste") - Button() { - Text('--------------------') - .fontSize(25) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 200, - bottom:60 - }).backgroundColor('#00000000') - PasteButton({ icon: PasteIconStyle.LINES, text: PasteDescription.PASTE, buttonType: this.bgType }) - .onClick((event: ClickEvent, result: PasteButtonOnClickResult) => { - try { - var clickData = { - data: { - "clickResult": result - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>page_pasteButton onclick result:" + JSON.stringify(result)) - events_emitter.emit(clickEvent, clickData) - } catch (err) { - console.debug("====>page_pasteButton emit action state err: " + JSON.stringify(err.message)) - } - }) - .iconSize(this.iconSize) - .layoutDirection(this.direct) - .markAnchor({ x: this.anchorX, y: this.anchorY }) - .offset({ x: this.offsetX, y: this.offsetY }) - .fontSize(this.fontSize) - .fontStyle(this.fontStyle) - .fontWeight(this.fontWeight) - .fontFamily(this.fontFamily) - .fontColor(this.fontColor) - .iconColor(this.iconColor) - .backgroundColor(this.bgColor) - .borderStyle(this.borderSty) - .borderWidth(this.borderWid) - .borderColor(this.borderCol) - .borderRadius(this.borderRad) - .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) - .textIconSpace(this.middle) - .key("keyPaste1") - }.width(this.columnWidth).height(this.columnHeight).clip(this.clipSet) - }.height('100%') - } -} diff --git a/test/security_component/entry/src/main/ets/MainAbility/pages/saveButton.ets b/test/security_component/entry/src/main/ets/MainAbility/pages/saveButton.ets deleted file mode 100644 index 4660b67..0000000 --- a/test/security_component/entry/src/main/ets/MainAbility/pages/saveButton.ets +++ /dev/null @@ -1,241 +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 events_emitter from '@ohos.events.emitter' - -@Entry -@Component -struct saveButton { - @State bgType: ButtonType = ButtonType.Normal - @State iconSize: number = 16 - @State direct: SecurityComponentLayoutDirection = 0 - @State positionX: number = 0 - @State positionY: number = 0 - @State anchorX: number = 0 - @State anchorY: number = 0 - @State offsetX: number = 0 - @State offsetY: number = 0 - @State fontSize: number = 16 - @State fontStyle: FontStyle = FontStyle.Normal - @State fontWeight: FontWeight = FontWeight.Medium - @State fontFamily: string = 'HarmonyOS Sans' - @State fontColor: number = 0xffffffff - @State iconColor: number = 0xffffffff - @State bgColor: number = 0xff007dff - @State borderSty: BorderStyle = BorderStyle.Dashed - @State borderWid: number = 0 - @State borderCol: number = 0xffffffff - @State borderRad: number = 0 - @State left: number = 24 - @State right: number = 24 - @State top: number = 8 - @State bottom: number = 8 - @State middle: number = 4 - @State clipSet: boolean = false - @State columnWidth: string = '100%' - @State columnHeight: string = '100%' - private stateChangeCallBack = (eventData) => { - if (eventData != null) { - console.debug("====>page_saveButton page state change called:" + JSON.stringify(eventData)); - if (eventData.data.bgType != null) { - this.bgType = eventData.data.bgType; - } - if (eventData.data.iconSize != null) { - this.iconSize = eventData.data.iconSize; - } - if (eventData.data.direct != null) { - this.direct = eventData.data.direct; - } - if (eventData.data.positionX != null) { - this.positionX = eventData.data.positionX; - } - if (eventData.data.positionY != null) { - this.positionY = eventData.data.positionY; - } - if (eventData.data.anchorX != null) { - this.anchorX = eventData.data.anchorX; - } - if (eventData.data.anchorY != null) { - this.anchorY = eventData.data.anchorY; - } - if (eventData.data.offsetX != null) { - this.offsetX = eventData.data.offsetX; - } - if (eventData.data.offsetY != null) { - this.offsetY = eventData.data.offsetY; - } - if (eventData.data.fontSize != null) { - this.fontSize = eventData.data.fontSize; - } - if (eventData.data.fontStyle != null) { - this.fontStyle = eventData.data.fontStyle; - } - if (eventData.data.fontWeight != null) { - this.fontWeight = eventData.data.fontWeight; - } - if (eventData.data.fontFamily != null) { - this.fontFamily = eventData.data.fontFamily; - } - if (eventData.data.fontColor != null) { - this.fontColor = eventData.data.fontColor; - } - if (eventData.data.iconColor != null) { - this.iconColor = eventData.data.iconColor; - } - if (eventData.data.bgColor != null) { - this.bgColor = eventData.data.bgColor; - } - if (eventData.data.borderSty != null) { - this.borderSty = eventData.data.borderSty; - } - if (eventData.data.borderWid != null) { - this.borderWid = eventData.data.borderWid; - } - if (eventData.data.borderCol != null) { - this.borderCol = eventData.data.borderCol; - } - if (eventData.data.borderRad != null) { - this.borderRad = eventData.data.borderRad; - } - if (eventData.data.left != null) { - this.left = eventData.data.left; - } - if (eventData.data.right != null) { - this.right = eventData.data.right; - } - if (eventData.data.top != null) { - this.top = eventData.data.top; - } - if (eventData.data.bottom != null) { - this.bottom = eventData.data.bottom; - } - if (eventData.data.middle != null) { - this.middle = eventData.data.middle; - } - if (eventData.data.clipSet != null) { - this.clipSet = eventData.data.clipSet; - } - if (eventData.data.columnWidth != null) { - this.columnWidth = eventData.data.columnWidth; - } - if (eventData.data.columnHeight != null) { - this.columnHeight = eventData.data.columnHeight; - } - } - } - - onPageShow() { - console.debug('====>page_saveButton page show called'); - var stateChangeEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - events_emitter.on(stateChangeEvent, this.stateChangeCallBack); - } - - onPageHide() { - console.debug('====>page_saveButton page hide called'); - events_emitter.off(1); - } - - build() { - Row() { - Column() { - SaveButton({ icon: SaveIconStyle.FULL_FILLED, text: SaveDescription.DOWNLOAD, buttonType: this.bgType }) - .onClick((event: ClickEvent, result: SaveButtonOnClickResult) => { - try { - var clickData = { - data: { - "clickResult": result, - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>page_saveButton onclick result:" + JSON.stringify(result)) - events_emitter.emit(clickEvent, clickData) - } catch (err) { - console.debug("====>page_saveButton emit action state err: " + JSON.stringify(err.message)) - } - }) - .iconSize(this.iconSize) - .layoutDirection(this.direct) - .position({ x: this.positionX, y: this.positionY }) - .markAnchor({ x: this.anchorX, y: this.anchorY }) - .offset({ x: this.offsetX, y: this.offsetY }) - .fontSize(this.fontSize) - .fontStyle(this.fontStyle) - .fontWeight(this.fontWeight) - .fontFamily(this.fontFamily) - .fontColor(this.fontColor) - .iconColor(this.iconColor) - .backgroundColor(this.bgColor) - .borderStyle(this.borderSty) - .borderWidth(this.borderWid) - .borderColor(this.borderCol) - .borderRadius(this.borderRad) - .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) - .textIconSpace(this.middle) - .key("keySave") - Button() { - Text('--------------------') - .fontSize(25) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 200, - bottom:60 - }).backgroundColor('#00000000') - SaveButton({ icon: SaveIconStyle.FULL_FILLED, text: SaveDescription.DOWNLOAD, buttonType: this.bgType }) - .onClick((event: ClickEvent, result: SaveButtonOnClickResult) => { - try { - var clickData = { - data: { - "clickResult": result, - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>page_saveButton onclick result:" + JSON.stringify(result)) - events_emitter.emit(clickEvent, clickData) - } catch (err) { - console.debug("====>page_saveButton emit action state err: " + JSON.stringify(err.message)) - } - }) - .iconSize(this.iconSize) - .layoutDirection(this.direct) - .markAnchor({ x: this.anchorX, y: this.anchorY }) - .offset({ x: this.offsetX, y: this.offsetY }) - .fontSize(this.fontSize) - .fontStyle(this.fontStyle) - .fontWeight(this.fontWeight) - .fontFamily(this.fontFamily) - .fontColor(this.fontColor) - .iconColor(this.iconColor) - .backgroundColor(this.bgColor) - .borderStyle(this.borderSty) - .borderWidth(this.borderWid) - .borderColor(this.borderCol) - .borderRadius(this.borderRad) - .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) - .textIconSpace(this.middle) - .key("keySave1") - }.width(this.columnWidth).height(this.columnHeight).clip(this.clipSet) - }.height('100%') - } -} diff --git a/test/security_component/entry/src/main/ets/MainAbility/pages/saveButton_1.ets b/test/security_component/entry/src/main/ets/MainAbility/pages/saveButton_1.ets deleted file mode 100644 index 7414dbd..0000000 --- a/test/security_component/entry/src/main/ets/MainAbility/pages/saveButton_1.ets +++ /dev/null @@ -1,320 +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 events_emitter from '@ohos.events.emitter' - -@Entry -@Component -struct saveButton_1 { - @State icon: SaveIconStyle = 0 - @State textType: SaveDescription = 0 - @State bgType: ButtonType = ButtonType.Normal - @State iconSize: number = 16 - @State positionX: number = 0 - @State positionY: number = 0 - @State anchorX: number = 0 - @State anchorY: number = 0 - @State offsetX: number = 0 - @State offsetY: number = 0 - @State fontSize: number = 16 - @State fontStyle: FontStyle = FontStyle.Normal - @State fontWeight: FontWeight = FontWeight.Medium - @State fontFamily: string = 'HarmonyOS Sans' - @State fontColor: number = 0xffffffff - @State iconColor: number = 0xffffffff - @State bgColor: number = 0x7dff - @State borderSty: BorderStyle = BorderStyle.Dashed - @State borderWid: number = 0 - @State borderCol: number = 0xffffffff - @State borderRad: number = 0 - @State left: number = 24 - @State right: number = 24 - @State top: number = 8 - @State bottom: number = 8 - @State middle: number = 4 - @State heightValue: number = 4 - marginValue = {top:30, bottom:30, left:10, right:10} - - build() { - Column() { - Row() { - SaveButton({ icon: SaveIconStyle.LINES, text: SaveDescription.DOWNLOAD_FILE, buttonType: this.bgType }) - .onClick((event: ClickEvent, result: SaveButtonOnClickResult) => { - try { - var clickData = { - data: { - "clickResult": result, - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>page_SaveButton onclick result:" + JSON.stringify(result)) - events_emitter.emit(clickEvent, clickData) - } catch (err) { - console.debug("====>page_SaveButton emit action state err: " + JSON.stringify(err.message)) - } - }) - .iconSize(this.iconSize) - .layoutDirection(SecurityComponentLayoutDirection.HORIZONTAL) - .markAnchor({ x: this.anchorX, y: this.anchorY }) - .offset({ x: this.offsetX, y: 0 }) - .fontSize(this.fontSize) - .fontStyle(this.fontStyle) - .fontWeight(this.fontWeight) - .fontFamily(this.fontFamily) - .fontColor('0xFFFFF000') - .iconColor(this.iconColor) - .backgroundColor(this.bgColor) - .borderStyle(this.borderSty) - .borderWidth(this.borderWid) - .borderColor(this.borderCol) - .borderRadius(this.borderRad) - .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) - .textIconSpace(this.middle) - .key("keySave2") - }.width('100%').height(this.heightValue).margin(this.marginValue) - Row() { - SaveButton({ icon: SaveIconStyle.FULL_FILLED, text: SaveDescription.SAVE, buttonType: this.bgType }) - .onClick((event: ClickEvent, result: SaveButtonOnClickResult) => { - try { - var clickData = { - data: { - "clickResult": result, - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>page_SaveButton onclick result:" + JSON.stringify(result)) - events_emitter.emit(clickEvent, clickData) - } catch (err) { - console.debug("====>page_SaveButton emit action state err: " + JSON.stringify(err.message)) - } - }) - .iconSize(this.iconSize) - .layoutDirection(SecurityComponentLayoutDirection.VERTICAL) - .markAnchor({ x: this.anchorX, y: this.anchorY }) - .offset({ x: this.offsetX, y: 0 }) - .fontSize(this.fontSize) - .fontStyle(this.fontStyle) - .fontWeight(this.fontWeight) - .fontFamily(this.fontFamily) - .fontColor('0xFFFFF000') - .iconColor(this.iconColor) - .backgroundColor(this.bgColor) - .borderStyle(this.borderSty) - .borderWidth(this.borderWid) - .borderColor(this.borderCol) - .borderRadius(this.borderRad) - .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) - .textIconSpace(this.middle) - .key("keySave3") - }.width('100%').height(this.heightValue).margin(this.marginValue) - Row() { - SaveButton({ icon: SaveIconStyle.FULL_FILLED, text: SaveDescription.SAVE_IMAGE, buttonType: this.bgType }) - .onClick((event: ClickEvent, result: SaveButtonOnClickResult) => { - try { - var clickData = { - data: { - "clickResult": result, - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>page_SaveButton onclick result:" + JSON.stringify(result)) - events_emitter.emit(clickEvent, clickData) - } catch (err) { - console.debug("====>page_SaveButton emit action state err: " + JSON.stringify(err.message)) - } - }) - .iconSize(this.iconSize) - .layoutDirection(SecurityComponentLayoutDirection.HORIZONTAL) - .markAnchor({ x: this.anchorX, y: this.anchorY }) - .offset({ x: this.offsetX, y: 0 }) - .fontSize(this.fontSize) - .fontStyle(this.fontStyle) - .fontWeight(this.fontWeight) - .fontFamily(this.fontFamily) - .fontColor('0xFFFFF000') - .iconColor(this.iconColor) - .backgroundColor(this.bgColor) - .borderStyle(this.borderSty) - .borderWidth(this.borderWid) - .borderColor(this.borderCol) - .borderRadius(this.borderRad) - .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) - .textIconSpace(this.middle) - .key("keySave4") - }.width('100%').height(this.heightValue).margin(this.marginValue) - Row() { - SaveButton({ icon: SaveIconStyle.FULL_FILLED, text: SaveDescription.SAVE_FILE, buttonType: this.bgType }) - .onClick((event: ClickEvent, result: SaveButtonOnClickResult) => { - try { - var clickData = { - data: { - "clickResult": result, - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>page_SaveButton onclick result:" + JSON.stringify(result)) - events_emitter.emit(clickEvent, clickData) - } catch (err) { - console.debug("====>page_SaveButton emit action state err: " + JSON.stringify(err.message)) - } - }) - .iconSize(this.iconSize) - .layoutDirection(SecurityComponentLayoutDirection.HORIZONTAL) - .markAnchor({ x: this.anchorX, y: this.anchorY }) - .offset({ x: this.offsetX, y: 0 }) - .fontSize(this.fontSize) - .fontStyle(this.fontStyle) - .fontWeight(this.fontWeight) - .fontFamily(this.fontFamily) - .fontColor('0xFFFFF000') - .iconColor(this.iconColor) - .backgroundColor(this.bgColor) - .borderStyle(this.borderSty) - .borderWidth(this.borderWid) - .borderColor(this.borderCol) - .borderRadius(this.borderRad) - .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) - .textIconSpace(this.middle) - .key("keySave5") - }.width('100%').height(this.heightValue).margin(this.marginValue) - Row() { - SaveButton({ icon: SaveIconStyle.FULL_FILLED, text: SaveDescription.DOWNLOAD_AND_SHARE, buttonType: this.bgType }) - .onClick((event: ClickEvent, result: SaveButtonOnClickResult) => { - try { - var clickData = { - data: { - "clickResult": result, - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>page_SaveButton onclick result:" + JSON.stringify(result)) - events_emitter.emit(clickEvent, clickData) - } catch (err) { - console.debug("====>page_SaveButton emit action state err: " + JSON.stringify(err.message)) - } - }) - .iconSize(this.iconSize) - .layoutDirection(SecurityComponentLayoutDirection.HORIZONTAL) - .markAnchor({ x: this.anchorX, y: this.anchorY }) - .offset({ x: this.offsetX, y: 0 }) - .fontSize(this.fontSize) - .fontStyle(this.fontStyle) - .fontWeight(this.fontWeight) - .fontFamily(this.fontFamily) - .fontColor('0xFFFFF000') - .iconColor(this.iconColor) - .backgroundColor(this.bgColor) - .borderStyle(this.borderSty) - .borderWidth(this.borderWid) - .borderColor(this.borderCol) - .borderRadius(this.borderRad) - .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) - .textIconSpace(this.middle) - .key("keySave6") - }.width('100%').height(this.heightValue).margin(this.marginValue) - Row() { - SaveButton({ icon: SaveIconStyle.FULL_FILLED, text: SaveDescription.RECEIVE, buttonType: this.bgType }) - .onClick((event: ClickEvent, result: SaveButtonOnClickResult) => { - try { - var clickData = { - data: { - "clickResult": result, - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>page_SaveButton onclick result:" + JSON.stringify(result)) - events_emitter.emit(clickEvent, clickData) - } catch (err) { - console.debug("====>page_SaveButton emit action state err: " + JSON.stringify(err.message)) - } - }) - .iconSize(this.iconSize) - .layoutDirection(SecurityComponentLayoutDirection.HORIZONTAL) - .markAnchor({ x: this.anchorX, y: this.anchorY }) - .offset({ x: this.offsetX, y: 0 }) - .fontSize(this.fontSize) - .fontStyle(this.fontStyle) - .fontWeight(this.fontWeight) - .fontFamily(this.fontFamily) - .fontColor('0xFFFFF000') - .iconColor(this.iconColor) - .backgroundColor(this.bgColor) - .borderStyle(this.borderSty) - .borderWidth(this.borderWid) - .borderColor(this.borderCol) - .borderRadius(this.borderRad) - .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) - .textIconSpace(this.middle) - .key("keySave7") - }.width('100%').height(this.heightValue).margin(this.marginValue) - Row() { - SaveButton({ icon: SaveIconStyle.FULL_FILLED, text: SaveDescription.CONTINUE_TO_RECEIVE, buttonType: this.bgType }) - .onClick((event: ClickEvent, result: SaveButtonOnClickResult) => { - try { - var clickData = { - data: { - "clickResult": result, - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>page_SaveButton onclick result:" + JSON.stringify(result)) - events_emitter.emit(clickEvent, clickData) - } catch (err) { - console.debug("====>page_SaveButton emit action state err: " + JSON.stringify(err.message)) - } - }) - .iconSize(this.iconSize) - .layoutDirection(SecurityComponentLayoutDirection.HORIZONTAL) - .markAnchor({ x: this.anchorX, y: this.anchorY }) - .offset({ x: this.offsetX, y: 0 }) - .fontSize(this.fontSize) - .fontStyle(this.fontStyle) - .fontWeight(this.fontWeight) - .fontFamily(this.fontFamily) - .fontColor('0xFFFFF000') - .iconColor(this.iconColor) - .backgroundColor(this.bgColor) - .borderStyle(this.borderSty) - .borderWidth(this.borderWid) - .borderColor(this.borderCol) - .borderRadius(this.borderRad) - .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) - .textIconSpace(this.middle) - .key("keySave8") - }.width('100%').height(this.heightValue).margin(this.marginValue) - } - } -} diff --git a/test/security_component/entry/src/main/ets/TestAbility/TestAbility.ts b/test/security_component/entry/src/main/ets/TestAbility/TestAbility.ts deleted file mode 100644 index 368bbfc..0000000 --- a/test/security_component/entry/src/main/ets/TestAbility/TestAbility.ts +++ /dev/null @@ -1,50 +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 Ability from '@ohos.app.ability.UIAbility' - -export default class TestAbility extends Ability { - onCreate(want, launchParam) { - console.log('TestAbility onCreate') - } - - onDestroy() { - console.log('TestAbility onDestroy') - } - - onWindowStageCreate(windowStage) { - console.log('TestAbility onWindowStageCreate') - windowStage.loadContent("TestAbility/pages/index", (err, data) => { - if (err.code) { - console.error('Failed to load the content. Cause:' + JSON.stringify(err)); - return; - } - console.info('Succeeded in loading the content. Data: ' + JSON.stringify(data)) - }); - - globalThis.abilityContext = this.context; - } - - onWindowStageDestroy() { - console.log('TestAbility onWindowStageDestroy') - } - - onForeground() { - console.log('TestAbility onForeground') - } - - onBackground() { - console.log('TestAbility onBackground') - } -}; \ No newline at end of file diff --git a/test/security_component/entry/src/main/ets/TestAbility/pages/index.ets b/test/security_component/entry/src/main/ets/TestAbility/pages/index.ets deleted file mode 100644 index 441f240..0000000 --- a/test/security_component/entry/src/main/ets/TestAbility/pages/index.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. - */ -import router from '@ohos.router'; - -@Entry -@Component -struct Index { - aboutToAppear() { - console.info('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/test/security_component/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/test/security_component/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index bf0d2c2..0000000 --- a/test/security_component/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,79 +0,0 @@ -// @ts-nocheck -/** - * 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 TestRunner from '@ohos.application.testRunner' -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry' - -var abilityDelegator = undefined -var 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() { - console.log("onAbilityCreateCallback"); -} - -async function addAbilityMonitorCallback(err: any) { - console.info("addAbilityMonitorCallback : " + JSON.stringify(err)) -} - -export default class OpenHarmonyTestRunner implements TestRunner { - constructor() { - } - - onPrepare() { - console.info("OpenHarmonyTestRunner OnPrepare ") - } - - async onRun() { - console.log('OpenHarmonyTestRunner onRun run') - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var testAbilityName = abilityDelegatorArguments.bundleName + '.MainAbility' - let lMonitor = { - abilityName: testAbilityName, - onAbilityCreate: onAbilityCreateCallback, - }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a com.example.securitycomponent.MainAbility' + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + d.stdResult); - console.info('executeShellCommand : data : ' + d.exitCode); - }) - console.info('OpenHarmonyTestRunner onRun end') - } -}; \ No newline at end of file diff --git a/test/security_component/entry/src/main/ets/test/List.test.ets b/test/security_component/entry/src/main/ets/test/List.test.ets deleted file mode 100644 index 9043208..0000000 --- a/test/security_component/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,28 +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 pasteComponentTest from './PasteComponentTest.test.ets'; -import locationComponentTest from './LocationComponentTest.test.ets'; -import locationComponentTest_1 from './LocationComponentTest_1.test.ets'; -import saveComponentTest from './SaveComponentTest.test.ets'; -import saveComponentTest_1 from './SaveComponentTest_1.test.ets'; - -export default function testsuite() { - pasteComponentTest(); - locationComponentTest(); - locationComponentTest_1(); - saveComponentTest(); - saveComponentTest_1(); -} \ No newline at end of file diff --git a/test/security_component/entry/src/main/ets/test/LocationComponentTest.test.ets b/test/security_component/entry/src/main/ets/test/LocationComponentTest.test.ets deleted file mode 100644 index b1b39ba..0000000 --- a/test/security_component/entry/src/main/ets/test/LocationComponentTest.test.ets +++ /dev/null @@ -1,1927 +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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" -import router from '@ohos.router'; -import events_emitter from '@ohos.events.emitter'; -import { Driver, ON } from '@ohos.UiTest' -import Utils from './Utils'; - -export default function locationComponentTest() { - describe('locationComponentTest', function () { - beforeAll(async function (done) { - let options = { - url: 'MainAbility/pages/locationButton', - } - try { - router.clear(); - let pages = router.getState(); - console.debug("====>locationComponentTest get state success " + JSON.stringify(pages)); - if (!("locationButton" == pages.name)) { - console.debug("====>locationComponentTest get state success " + JSON.stringify(pages.name)); - let result = await router.pushUrl(options); - await Utils.sleep(2000); - console.debug("====>locationComponentTest push page success " + JSON.stringify(result)); - } - } catch (err) { - console.error("====>locationComponentTest push page error: " + err); - } - done() - }); - - afterEach(async function () { - await Utils.sleep(1000); - console.debug("====>locationComponentTest after each called"); - }); - - it('Test_Security_Button_Location_0100', 0, async function (done) { - console.debug('====>[Test_Security_Button_Location_0100] START===='); - let strJson = getInspectorByKey('keyLocation'); - let obj = JSON.parse(strJson); - expect(obj.$attrs.icon).assertEqual(0); - expect(obj.$attrs.text).assertEqual(0); - expect(obj.$attrs.buttonType).assertEqual(0); - expect(obj.$attrs.iconSize).assertEqual('16.00vp'); - expect(obj.$attrs.layoutDirection).assertEqual(0); - expect(obj.$attrs.position.x).assertEqual('0.00vp'); - expect(obj.$attrs.position.y).assertEqual('0.00vp'); - expect(obj.$attrs.markAnchor.x).assertEqual('0.00vp'); - expect(obj.$attrs.markAnchor.y).assertEqual('0.00vp'); - expect(obj.$attrs.offset.x).assertEqual('0.00vp'); - expect(obj.$attrs.offset.y).assertEqual('0.00vp'); - expect(obj.$attrs.fontSize).assertEqual('16.00fp'); - expect(obj.$attrs.fontStyle).assertEqual(0); - expect(obj.$attrs.fontWeight).assertEqual('FontWeight.Medium'); - expect(obj.$attrs.fontFamily).assertEqual('HarmonyOS Sans'); - expect(obj.$attrs.fontColor).assertEqual('#FFFFFFFF'); - expect(obj.$attrs.iconColor).assertEqual('#FFFFFFFF'); - expect(obj.$attrs.backgroundColor).assertEqual('#FF007DFF'); - expect(obj.$attrs.borderStyle).assertEqual(1); - expect(obj.$attrs.borderWidth).assertEqual('0.00vp'); - expect(obj.$attrs.borderColor).assertEqual('#FFFFFFFF'); - expect(obj.$attrs.borderRadius).assertEqual('0.00vp'); - expect(obj.$attrs.padding.left).assertEqual('24.00vp'); - expect(obj.$attrs.padding.right).assertEqual('24.00vp'); - expect(obj.$attrs.padding.top).assertEqual('8.00vp'); - expect(obj.$attrs.padding.bottom).assertEqual('8.00vp'); - expect(obj.$attrs.textIconSpace).assertEqual('4.00vp'); - await Utils.sleep(1000); - try { - let clickCallback = async (clickData) => { - console.debug("====>[Test_Security_Button_Location_0100] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Location_0100] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Location_0100] 设置权限成功"); - expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); - await Utils.sleep(500); - let driver = Driver.create(); - let textComponent = await driver.findComponent(ON.type('Button')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Location_0100] textComponent is:" + JSON.stringify(textComponent)); - await textComponent.click(); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Location_0100] END===="); - done() - } else { - console.debug("====>[Test_Security_Button_Location_0100] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Location_0100] END===="); - done() - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_0100] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('LocationButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Location_0100] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_0100] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Location_0200', 0, async function (done) { - console.debug('====>[Test_Security_Button_Location_0200] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": SecurityComponentLayoutDirection.VERTICAL, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Location_0200] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_0200] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyLocation'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.layoutDirection).assertEqual(SecurityComponentLayoutDirection.VERTICAL); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Location_0200] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Location_0200] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Location_0200] 设置权限成功"); - expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Location_0200] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Location_0200] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Location_0200] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_0200] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('LocationButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Location_0200] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_0200] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Location_0300', 0, async function (done) { - console.debug('====>[Test_Security_Button_Location_0300] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 150, - "positionY": 20, - "anchorX": 20, - "anchorY": 20, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Location_0300] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_0300] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyLocation'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.position.x).assertEqual('150.00vp'); - expect(obj.$attrs.position.y).assertEqual('20.00vp'); - expect(obj.$attrs.markAnchor.x).assertEqual('20.00vp'); - expect(obj.$attrs.markAnchor.y).assertEqual('20.00vp'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Location_0300] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Location_0300] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Location_0300] 设置权限成功"); - expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Location_0300] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Location_0300] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Location_0300] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_0300] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('LocationButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Location_0300] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_0300] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Location_0400', 0, async function (done) { - console.debug('====>[Test_Security_Button_Location_0400] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 1, - "positionX": 0, - "positionY": 0, - "anchorX": 20, - "anchorY": 20, - "offsetX": 100, - "offsetY": 100, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Location_0400] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_0400] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyLocation1'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.offset.x).assertEqual('100.00vp'); - expect(obj.$attrs.offset.y).assertEqual('100.00vp'); - expect(obj.$attrs.markAnchor.x).assertEqual('20.00vp'); - expect(obj.$attrs.markAnchor.y).assertEqual('20.00vp'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Location_0400] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Location_0400] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Location_0400] 设置权限成功"); - expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Location_0400] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Location_0400] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Location_0400] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_0400] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponents(ON.type('LocationButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Location_0400] button is:" + JSON.stringify(button)); - await button[1].click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_0400] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Location_0500', 0, async function (done) { - console.debug('====>[Test_Security_Button_Location_0500] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Italic, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Location_0500] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_0500] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyLocation'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.fontStyle).assertEqual(1); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Location_0500] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Location_0500] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Location_0500] 设置权限成功"); - expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Location_0500] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Location_0500] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Location_0500] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_0500] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('LocationButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Location_0500] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_0500] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Location_0600', 0, async function (done) { - console.debug('====>[Test_Security_Button_Location_0600] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Lighter, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Location_0600] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_0600] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyLocation'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.fontWeight).assertEqual('FontWeight.Lighter'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Location_0600] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Location_0600] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Location_0600] 设置权限成功"); - expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Location_0600] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Location_0600] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Location_0600] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_0600] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('LocationButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Location_0600] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_0600] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Location_0700', 0, async function (done) { - console.debug('====>[Test_Security_Button_Location_0700] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Normal, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Location_0700] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_0700] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyLocation'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.fontWeight).assertEqual('FontWeight.Normal'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Location_0700] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Location_0700] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Location_0700] 设置权限成功"); - expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Location_0700] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Location_0700] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Location_0700] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_0700] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('LocationButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Location_0700] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_0700] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Location_0800', 0, async function (done) { - console.debug('====>[Test_Security_Button_Location_0800] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Regular, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Location_0800] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_0800] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyLocation'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.fontWeight).assertEqual('FontWeight.Regular'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Location_0800] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Location_0800] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Location_0800] 设置权限成功"); - expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Location_0800] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Location_0800] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Location_0800] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_0800] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('LocationButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Location_0800] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_0800] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Location_0900', 0, async function (done) { - console.debug('====>[Test_Security_Button_Location_0900] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Bold, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Location_0900] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_0900] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyLocation'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.fontWeight).assertEqual('FontWeight.Bold'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Location_0900] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Location_0900] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Location_0900] 设置权限成功"); - expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Location_0900] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Location_0900] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Location_0900] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_0900] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('LocationButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Location_0900] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_0900] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Location_1000', 0, async function (done) { - console.debug('====>[Test_Security_Button_Location_1000] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Bolder, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Location_1000] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_1000] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyLocation'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.fontWeight).assertEqual('FontWeight.Bolder'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Location_1000] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Location_1000] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Location_1000] 设置权限成功"); - expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Location_1000] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Location_1000] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Location_1000] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_1000] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('LocationButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Location_1000] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_1000] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Location_1100', 0, async function (done) { - console.debug('====>[Test_Security_Button_Location_1100] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dotted, - "borderWid": 5, - "borderCol": 0xffffffff, - "borderRad": 5, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Location_1100] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_1100] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyLocation'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.borderStyle).assertEqual(2); - expect(obj.$attrs.borderWidth).assertEqual('5.00vp'); - expect(obj.$attrs.borderColor).assertEqual('#FFFFFFFF'); - expect(obj.$attrs.borderRadius).assertEqual('5.00vp'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Location_1100] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Location_1100] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Location_1100] 设置权限成功"); - expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Location_1100] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Location_1100] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Location_1100] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_1100] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('LocationButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Location_1100] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_1100] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Location_1200', 0, async function (done) { - console.debug('====>[Test_Security_Button_Location_1200] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 5, - "borderCol": 0xffffffff, - "borderRad": 5, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Location_1200] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_1200] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyLocation'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.borderStyle).assertEqual(1); - expect(obj.$attrs.borderWidth).assertEqual('5.00vp'); - expect(obj.$attrs.borderColor).assertEqual('#FFFFFFFF'); - expect(obj.$attrs.borderRadius).assertEqual('5.00vp'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Location_1200] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Location_1200] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Location_1200] 设置权限成功"); - expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Location_1200] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Location_1200] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Location_1200] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_1200] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('LocationButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Location_1200] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_1200] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Location_1300', 0, async function (done) { - console.debug('====>[Test_Security_Button_Location_1300] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Solid, - "borderWid": 5, - "borderCol": 0xffffffff, - "borderRad": 5, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Location_1300] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_1300] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyLocation'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.borderStyle).assertEqual(0); - expect(obj.$attrs.borderWidth).assertEqual('5.00vp'); - expect(obj.$attrs.borderColor).assertEqual('#FFFFFFFF'); - expect(obj.$attrs.borderRadius).assertEqual('5.00vp'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Location_1300] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Location_1300] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Location_1300] 设置权限成功"); - expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Location_1300] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Location_1300] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Location_1300] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_1300] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('LocationButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Location_1300] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_1300] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Location_1400', 0, async function (done) { - console.debug('====>[Test_Security_Button_Location_1400] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 200, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Location_1400] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_1400] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyLocation1'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.offset.x).assertEqual('200.00vp'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Location_1400] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Location_1400] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == LocationButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { - console.debug("====>[Test_Security_Button_Location_1400] ERR CASE 成功"); - expect(clickData.data.clickResult == LocationButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); - console.debug("====>[Test_Security_Button_Location_1400] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Location_1400] ERR CASE 失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Location_1400] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_1400] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponents(ON.type('LocationButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Location_1400] button is:" + JSON.stringify(button)); - await button[1].click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_1400] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Location_1500', 0, async function (done) { - console.debug('====>[Test_Security_Button_Location_1500] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": -200, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Location_1500] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_1500] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyLocation1'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.offset.x).assertEqual('-200.00vp'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Location_1500] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Location_1500] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == LocationButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { - console.debug("====>[Test_Security_Button_Location_1500] ERR CASE 成功"); - expect(clickData.data.clickResult == LocationButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); - console.debug("====>[Test_Security_Button_Location_1500] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Location_1500] ERR CASE 失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Location_1500] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_1500] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponents(ON.type('LocationButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Location_1500] button is:" + JSON.stringify(button)); - await button[1].click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_1500] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Location_1600', 0, async function (done) { - console.debug('====>[Test_Security_Button_Location_1600] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 150, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Location_1600] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_1600] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyLocation'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.iconSize).assertEqual('150.00vp'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Location_1600] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Location_1600] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == LocationButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { - console.debug("====>[Test_Security_Button_Location_1600] ERR CASE 成功"); - expect(clickData.data.clickResult == LocationButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); - console.debug("====>[Test_Security_Button_Location_1600] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Location_1600] ERR CASE 失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Location_1600] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_1600] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('LocationButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Location_1600] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_1600] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Location_1700', 0, async function (done) { - console.debug('====>[Test_Security_Button_Location_1700] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0x10ff0000, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Location_1700] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_1700] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyLocation'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.iconColor).assertEqual('#10FF0000'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Location_1700] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Location_1700] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == LocationButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { - console.debug("====>[Test_Security_Button_Location_1700] ERR CASE 成功"); - expect(clickData.data.clickResult == LocationButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); - console.debug("====>[Test_Security_Button_Location_1700] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Location_1700] ERR CASE 失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Location_1700] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_1700] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('LocationButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Location_1700] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_1700] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Location_1800', 0, async function (done) { - console.debug('====>[Test_Security_Button_Location_1800] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 20, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xfffa0050, - "bgColor": 0xffff0000, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Location_1800] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_1800] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyLocation'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.buttonType).assertEqual(0); - expect(obj.$attrs.iconSize).assertEqual('20.00vp'); - expect(obj.$attrs.iconColor).assertEqual('#FFFA0050'); - expect(obj.$attrs.backgroundColor).assertEqual('#FFFF0000'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Location_1800] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Location_1800] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == LocationButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { - console.debug("====>[Test_Security_Button_Location_1800] ERR CASE 成功"); - expect(clickData.data.clickResult == LocationButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); - console.debug("====>[Test_Security_Button_Location_1800] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Location_1800] ERR CASE 失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Location_1800] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_1800] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('LocationButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Location_1800] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_1800] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Location_1900', 0, async function (done) { - console.debug('====>[Test_Security_Button_Location_1900] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 1, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 20, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Location_1900] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_1900] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyLocation'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.iconSize).assertEqual('1.00vp'); - expect(obj.$attrs.fontSize).assertEqual('20.00fp'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Location_1900] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Location_1900] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == LocationButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { - console.debug("====>[Test_Security_Button_Location_1900] ERR CASE 成功"); - expect(clickData.data.clickResult == LocationButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); - console.debug("====>[Test_Security_Button_Location_1900] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Location_1900] ERR CASE 失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Location_1900] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_1900] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('LocationButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Location_1900] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_1900] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Location_2000', 0, async function (done) { - console.debug('====>[Test_Security_Button_Location_2000] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": Color.Transparent, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Location_2000] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_2000] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyLocation'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.iconColor).assertEqual('#00000000'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Location_2000] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Location_2000] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == LocationButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { - console.debug("====>[Test_Security_Button_Location_2000] ERR CASE 成功"); - expect(clickData.data.clickResult == LocationButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); - console.debug("====>[Test_Security_Button_Location_2000] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Location_2000] ERR CASE 失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Location_2000] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_2000] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('LocationButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Location_2000] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_2000] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Location_2100', 0, async function (done) { - console.debug('====>[Test_Security_Button_Location_2100] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": Color.Transparent, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Location_2100] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_2100] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyLocation'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.fontColor).assertEqual('#00000000'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Location_2100] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Location_2100] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == LocationButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { - console.debug("====>[Test_Security_Button_Location_2100] ERR CASE 成功"); - expect(clickData.data.clickResult == LocationButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); - console.debug("====>[Test_Security_Button_Location_2100] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Location_2100] ERR CASE 失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Location_2100] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_2100] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('LocationButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Location_2100] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_2100] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Location_2200', 0, async function (done) { - console.debug('====>[Test_Security_Button_Location_2200] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 20, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": Color.Transparent, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Location_2200] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_2200] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyLocation'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.backgroundColor).assertEqual('#00000000'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Location_2200] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Location_2200] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == LocationButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { - console.debug("====>[Test_Security_Button_Location_2200] ERR CASE 成功"); - expect(clickData.data.clickResult == LocationButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); - console.debug("====>[Test_Security_Button_Location_2200] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Location_2200] ERR CASE 失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Location_2200] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_2200] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('LocationButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Location_2200] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_2200] clickSecComponent err : " + JSON.stringify(err)); - } - }); - }) -} \ No newline at end of file diff --git a/test/security_component/entry/src/main/ets/test/LocationComponentTest_1.test.ets b/test/security_component/entry/src/main/ets/test/LocationComponentTest_1.test.ets deleted file mode 100644 index dad8ed8..0000000 --- a/test/security_component/entry/src/main/ets/test/LocationComponentTest_1.test.ets +++ /dev/null @@ -1,490 +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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" -import router from '@ohos.router'; -import events_emitter from '@ohos.events.emitter'; -import { Driver, ON } from '@ohos.UiTest' -import Utils from './Utils'; - -export default function locationComponentTest_1() { - describe('locationComponentTest_1', function () { - beforeAll(async function (done) { - let options = { - url: 'MainAbility/pages/locationButton_1', - } - try { - router.clear(); - let pages = router.getState(); - console.debug("====>locationComponentTest_1 get state success " + JSON.stringify(pages)); - if (!("locationButton_1" == pages.name)) { - console.debug("====>locationComponentTest_1 get state success " + JSON.stringify(pages.name)); - let result = await router.pushUrl(options); - await Utils.sleep(2000); - console.debug("====>locationComponentTest_1 push page success " + JSON.stringify(result)); - } - } catch (err) { - console.error("====>locationComponentTest_1 push page error: " + err); - } - done() - }); - - afterEach(async function () { - await Utils.sleep(1000); - console.debug("====>locationComponentTest_1 after each called"); - }); - - it('Test_Security_Button_Location_2300', 0, async function (done) { - console.debug('====>[Test_Security_Button_Location_2300] START===='); - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyLocation2'); - let obj = JSON.parse(strJsonNew); - console.debug("====>component obj.$attrs.icon:" + obj.$attrs.icon); - console.debug("====>component obj.$attrs.text:" + obj.$attrs.text); - expect(obj.$attrs.icon).assertEqual(1); - expect(obj.$attrs.text).assertEqual(1); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Location_2300] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Location_2300] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Location_2300] 设置权限成功"); - expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Location_2300] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Location_2300] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Location_2300] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_2300] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponents(ON.type('LocationButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Location_2300] button is:" + JSON.stringify(button)); - await button[0].click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_2300] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Location_2400', 0, async function (done) { - console.debug('====>[Test_Security_Button_Location_2400] START===='); - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyLocation3'); - let obj = JSON.parse(strJsonNew); - console.debug("====>component obj.$attrs.text:" + obj.$attrs.text); - expect(obj.$attrs.text).assertEqual(2); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Location_2400] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Location_2400] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Location_2400] 设置权限成功"); - expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Location_2400] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Location_2400] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Location_2400] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_2400] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponents(ON.type('LocationButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Location_2400] button is:" + JSON.stringify(button)); - await button[1].click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_2400] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Location_2500', 0, async function (done) { - console.debug('====>[Test_Security_Button_Location_2500] START===='); - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyLocation4'); - let obj = JSON.parse(strJsonNew); - console.debug("====>component obj.$attrs.text:" + obj.$attrs.text); - expect(obj.$attrs.text).assertEqual(3); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Location_2500] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Location_2500] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Location_2500] 设置权限成功"); - expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Location_2500] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Location_2500] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Location_2500] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_2500] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponents(ON.type('LocationButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Location_2500] button is:" + JSON.stringify(button)); - await button[2].click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_2500] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Location_2600', 0, async function (done) { - console.debug('====>[Test_Security_Button_Location_2600] START===='); - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyLocation5'); - let obj = JSON.parse(strJsonNew); - console.debug("====>component obj.$attrs.text:" + obj.$attrs.text); - expect(obj.$attrs.text).assertEqual(4); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Location_2600] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Location_2600] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Location_2600] 设置权限成功"); - expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Location_2600] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Location_2600] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Location_2600] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_2600] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponents(ON.type('LocationButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Location_2600] button is:" + JSON.stringify(button)); - await button[3].click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_2600] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Location_2700', 0, async function (done) { - console.debug('====>[Test_Security_Button_Location_2700] START===='); - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyLocation6'); - let obj = JSON.parse(strJsonNew); - console.debug("====>component obj.$attrs.text:" + obj.$attrs.text); - expect(obj.$attrs.text).assertEqual(5); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Location_2700] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Location_2700] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Location_2700] 设置权限成功"); - expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Location_2700] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Location_2700] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Location_2700] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_2700] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponents(ON.type('LocationButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Location_2700] button is:" + JSON.stringify(button)); - await button[4].click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_2700] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Location_2800', 0, async function (done) { - console.debug('====>[Test_Security_Button_Location_2800] START===='); - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyLocation7'); - let obj = JSON.parse(strJsonNew); - console.debug("====>component obj.$attrs.text:" + obj.$attrs.text); - expect(obj.$attrs.text).assertEqual(6); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Location_2800] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Location_2800] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Location_2800] 设置权限成功"); - expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Location_2800] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Location_2800] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Location_2800] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_2800] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponents(ON.type('LocationButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Location_2800] button is:" + JSON.stringify(button)); - await button[5].click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_2800] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Location_2900', 0, async function (done) { - console.debug('====>[Test_Security_Button_Location_2900] START===='); - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyLocation8'); - let obj = JSON.parse(strJsonNew); - console.debug("====>component obj.$attrs.text:" + obj.$attrs.text); - expect(obj.$attrs.text).assertEqual(7); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Location_2900] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Location_2900] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Location_2900] 设置权限成功"); - expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Location_2900] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Location_2900] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Location_2900] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_2900] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponents(ON.type('LocationButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Location_2900] button is:" + JSON.stringify(button)); - await button[6].click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_2900] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Location_3000', 0, async function (done) { - console.debug('====>[Test_Security_Button_Location_3000] START===='); - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyLocation9'); - let obj = JSON.parse(strJsonNew); - console.debug("====>component obj.$attrs.text:" + obj.$attrs.text); - expect(obj.$attrs.text).assertEqual(8); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Location_3000] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Location_3000] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Location_3000] 设置权限成功"); - expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Location_3000] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Location_3000] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Location_3000] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_3000] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponents(ON.type('LocationButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Location_3000] button is:" + JSON.stringify(button)); - await button[7].click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_3000] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Location_3100', 0, async function (done) { - console.debug('====>[Test_Security_Button_Location_3100] START===='); - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyLocation10'); - let obj = JSON.parse(strJsonNew); - console.debug("====>component obj.$attrs.text:" + obj.$attrs.text); - expect(obj.$attrs.text).assertEqual(9); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Location_3100] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Location_3100] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Location_3100] 设置权限成功"); - expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Location_3100] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Location_3100] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Location_3100] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_3100] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponents(ON.type('LocationButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Location_3100] button is:" + JSON.stringify(button)); - await button[8].click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_3100] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Location_3200', 0, async function (done) { - console.debug('====>[Test_Security_Button_Location_3200] START===='); - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyLocation11'); - let obj = JSON.parse(strJsonNew); - console.debug("====>component obj.$attrs.text:" + obj.$attrs.text); - expect(obj.$attrs.text).assertEqual(10); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Location_3200] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Location_3200] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Location_3200] 设置权限成功"); - expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Location_3200] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Location_3200] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Location_3200] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_3200] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponents(ON.type('LocationButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Location_3200] button is:" + JSON.stringify(button)); - await button[9].click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Location_3200] clickSecComponent err : " + JSON.stringify(err)); - } - }); - }) -} \ No newline at end of file diff --git a/test/security_component/entry/src/main/ets/test/PasteComponentTest.test.ets b/test/security_component/entry/src/main/ets/test/PasteComponentTest.test.ets deleted file mode 100644 index fbf134d..0000000 --- a/test/security_component/entry/src/main/ets/test/PasteComponentTest.test.ets +++ /dev/null @@ -1,1923 +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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" -import router from '@ohos.router'; -import events_emitter from '@ohos.events.emitter'; -import { Driver, ON } from '@ohos.UiTest' -import Utils from './Utils'; - -export default function pasteComponentTest() { - describe('pasteComponentTest', function () { - beforeAll(async function (done) { - let options = { - url: 'MainAbility/pages/pasteButton', - } - try { - router.clear(); - let pages = router.getState(); - console.debug("====>pasteComponentTest get state success " + JSON.stringify(pages)); - if (!("pasteButton" == pages.name)) { - console.debug("====>pasteComponentTest get state success " + JSON.stringify(pages.name)); - let result = await router.pushUrl(options); - await Utils.sleep(2000); - console.debug("====>pasteComponentTest push page success " + JSON.stringify(result)); - } - } catch (err) { - console.error("====>pasteComponentTest push page error: " + err); - } - done() - }); - - afterEach(async function () { - await Utils.sleep(1000); - console.debug("====>pasteComponentTest after each called"); - }); - - it('Test_Security_Button_Paste_0100', 0, async function (done) { - console.debug('====>[Test_Security_Button_Paste_0100] START'); - let strJson = getInspectorByKey('keyPaste'); - let obj = JSON.parse(strJson); - expect(obj.$attrs.icon).assertEqual(0); - expect(obj.$attrs.text).assertEqual(0); - expect(obj.$attrs.buttonType).assertEqual(0); - expect(obj.$attrs.iconSize).assertEqual('16.00vp'); - expect(obj.$attrs.layoutDirection).assertEqual(0); - expect(obj.$attrs.position.x).assertEqual('0.00vp'); - expect(obj.$attrs.position.y).assertEqual('0.00vp'); - expect(obj.$attrs.markAnchor.x).assertEqual('0.00vp'); - expect(obj.$attrs.markAnchor.y).assertEqual('0.00vp'); - expect(obj.$attrs.offset.x).assertEqual('0.00vp'); - expect(obj.$attrs.offset.y).assertEqual('0.00vp'); - expect(obj.$attrs.fontSize).assertEqual('16.00fp'); - expect(obj.$attrs.fontStyle).assertEqual(0); - expect(obj.$attrs.fontWeight).assertEqual('FontWeight.Medium'); - expect(obj.$attrs.fontFamily).assertEqual('HarmonyOS Sans'); - expect(obj.$attrs.fontColor).assertEqual('#FFFFFFFF'); - expect(obj.$attrs.iconColor).assertEqual('#FFFFFFFF'); - expect(obj.$attrs.backgroundColor).assertEqual('#FF007DFF'); - expect(obj.$attrs.borderStyle).assertEqual(1); - expect(obj.$attrs.borderWidth).assertEqual('0.00vp'); - expect(obj.$attrs.borderColor).assertEqual('#FFFFFFFF'); - expect(obj.$attrs.borderRadius).assertEqual('0.00vp'); - expect(obj.$attrs.padding.left).assertEqual('24.00vp'); - expect(obj.$attrs.padding.right).assertEqual('24.00vp'); - expect(obj.$attrs.padding.top).assertEqual('8.00vp'); - expect(obj.$attrs.padding.bottom).assertEqual('8.00vp'); - expect(obj.$attrs.textIconSpace).assertEqual('4.00vp'); - await Utils.sleep(1000); - try { - let clickCallback = async (clickData) => { - console.debug("====>[Test_Security_Button_Paste_0100] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Paste_0100] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Paste_0100] 设置权限成功"); - expect(clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS).assertTrue(); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Paste_0100] END===="); - done() - } else { - console.debug("====>[Test_Security_Button_Paste_0100] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Paste_0100] END===="); - done() - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_0100] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('PasteButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Paste_0100] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_0100] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - - it('Test_Security_Button_Paste_0200', 0, async function (done) { - console.debug('====>[Test_Security_Button_Paste_0200] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": SecurityComponentLayoutDirection.VERTICAL, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Paste_0200] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_0200] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyPaste'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.layoutDirection).assertEqual(SecurityComponentLayoutDirection.VERTICAL); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Paste_0200] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Paste_0200] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Paste_0200] 设置权限成功"); - expect(clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Paste_0200] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Paste_0200] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Paste_0200] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_0200] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('PasteButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Paste_0200] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_0200] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Paste_0300', 0, async function (done) { - console.debug('====>[Test_Security_Button_Paste_0300] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 150, - "positionY": 20, - "anchorX": 20, - "anchorY": 20, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Paste_0300] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_0300] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyPaste'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.position.x).assertEqual('150.00vp'); - expect(obj.$attrs.position.y).assertEqual('20.00vp'); - expect(obj.$attrs.markAnchor.x).assertEqual('20.00vp'); - expect(obj.$attrs.markAnchor.y).assertEqual('20.00vp'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Paste_0300] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Paste_0300] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Paste_0300] 设置权限成功"); - expect(clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Paste_0300] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Paste_0300] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Paste_0300] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_0300] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('PasteButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Paste_0300] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_0300] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - - it('Test_Security_Button_Paste_0400', 0, async function (done) { - console.debug('====>[Test_Security_Button_Paste_0400] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 1, - "positionX": 0, - "positionY": 0, - "anchorX": 20, - "anchorY": 20, - "offsetX": 100, - "offsetY": 100, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Paste_0400] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_0400] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyPaste1'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.offset.x).assertEqual('100.00vp'); - expect(obj.$attrs.offset.y).assertEqual('100.00vp'); - expect(obj.$attrs.markAnchor.x).assertEqual('20.00vp'); - expect(obj.$attrs.markAnchor.y).assertEqual('20.00vp'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Paste_0400] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Paste_0400] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Paste_0400] 设置权限成功"); - expect(clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Paste_0400] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Paste_0400] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Paste_0400] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_0400] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponents(ON.type('PasteButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Paste_0400] button is:" + JSON.stringify(button)); - await button[1].click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_0400] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Paste_0500', 0, async function (done) { - console.debug('====>[Test_Security_Button_Paste_0500] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Italic, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Paste_0500] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_0500] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyPaste'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.fontStyle).assertEqual(1); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Paste_0500] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Paste_0500] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Paste_0500] 设置权限成功"); - expect(clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Paste_0500] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Paste_0500] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Paste_0500] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_0500] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('PasteButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Paste_0500] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_0500] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Paste_0600', 0, async function (done) { - console.debug('====>[Test_Security_Button_Paste_0600] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Lighter, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Paste_0600] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_0600] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyPaste'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.fontWeight).assertEqual('FontWeight.Lighter'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Paste_0600] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Paste_0600] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Paste_0600] 设置权限成功"); - expect(clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Paste_0600] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Paste_0600] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Paste_0600] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_0600] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('PasteButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Paste_0600] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_0600] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Paste_0700', 0, async function (done) { - console.debug('====>[Test_Security_Button_Paste_0700] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Normal, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Paste_0700] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_0700] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyPaste'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.fontWeight).assertEqual('FontWeight.Normal'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Paste_0700] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Paste_0700] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Paste_0700] 设置权限成功"); - expect(clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Paste_0700] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Paste_0700] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Paste_0700] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_0700] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('PasteButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Paste_0700] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_0700] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Paste_0800', 0, async function (done) { - console.debug('====>[Test_Security_Button_Paste_0800] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Regular, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Paste_0800] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_0800] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyPaste'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.fontWeight).assertEqual('FontWeight.Regular'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Paste_0800] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Paste_0800] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Paste_0800] 设置权限成功"); - expect(clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Paste_0800] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Paste_0800] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Paste_0800] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_0800] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('PasteButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Paste_0800] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_0800] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Paste_0900', 0, async function (done) { - console.debug('====>[Test_Security_Button_Paste_0900] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Bold, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Paste_0900] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_0900] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyPaste'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.fontWeight).assertEqual('FontWeight.Bold'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Paste_0900] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Paste_0900] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Paste_0900] 设置权限成功"); - expect(clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Paste_0900] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Paste_0900] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Paste_0900] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_0900] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('PasteButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Paste_0900] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_0900] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Paste_1000', 0, async function (done) { - console.debug('====>[Test_Security_Button_Paste_1000] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Bolder, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Paste_1000] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_1000] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyPaste'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.fontWeight).assertEqual('FontWeight.Bolder'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Paste_1000] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Paste_1000] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Paste_1000] 设置权限成功"); - expect(clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Paste_1000] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Paste_1000] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Paste_1000] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_1000] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('PasteButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Paste_1000] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_1000] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Paste_1100', 0, async function (done) { - console.debug('====>[Test_Security_Button_Paste_1100] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dotted, - "borderWid": 5, - "borderCol": 0xffffffff, - "borderRad": 5, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Paste_1100] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_1100] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyPaste'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.borderStyle).assertEqual(2); - expect(obj.$attrs.borderWidth).assertEqual('5.00vp'); - expect(obj.$attrs.borderColor).assertEqual('#FFFFFFFF'); - expect(obj.$attrs.borderRadius).assertEqual('5.00vp'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Paste_1100] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Paste_1100] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Paste_1100] 设置权限成功"); - expect(clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Paste_1100] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Paste_1100] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Paste_1100] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_1100] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('PasteButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Paste_1100] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_1100] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Paste_1200', 0, async function (done) { - console.debug('====>[Test_Security_Button_Paste_1200] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 5, - "borderCol": 0xffffffff, - "borderRad": 5, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Paste_1200] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_1200] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyPaste'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.borderStyle).assertEqual(1); - expect(obj.$attrs.borderWidth).assertEqual('5.00vp'); - expect(obj.$attrs.borderColor).assertEqual('#FFFFFFFF'); - expect(obj.$attrs.borderRadius).assertEqual('5.00vp'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Paste_1200] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Paste_1200] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Paste_1200] 设置权限成功"); - expect(clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Paste_1200] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Paste_1200] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Paste_1200] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_1200] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('PasteButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Paste_1200] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_1200] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Paste_1300', 0, async function (done) { - console.debug('====>[Test_Security_Button_Paste_1300] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Solid, - "borderWid": 5, - "borderCol": 0xffffffff, - "borderRad": 5, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Paste_1300] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_1300] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyPaste'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.borderStyle).assertEqual(0); - expect(obj.$attrs.borderWidth).assertEqual('5.00vp'); - expect(obj.$attrs.borderColor).assertEqual('#FFFFFFFF'); - expect(obj.$attrs.borderRadius).assertEqual('5.00vp'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Paste_1300] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Paste_1300] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Paste_1300] 设置权限成功"); - expect(clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Paste_1300] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Paste_1300] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Paste_1300] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_1300] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('PasteButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Paste_1300] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_1300] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Paste_1400', 0, async function (done) { - console.debug('====>[Test_Security_Button_Paste_1400] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 200, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Paste_1400] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_1400] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyPaste1'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.offset.x).assertEqual('200.00vp'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Paste_1400] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Paste_1400] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == PasteButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { - console.debug("====>[Test_Security_Button_Paste_1400] ERR CASE 成功"); - expect(clickData.data.clickResult == PasteButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); - console.debug("====>[Test_Security_Button_Paste_1400] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Paste_1400] ERR CASE 失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Paste_1400] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_1400] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponents(ON.type('PasteButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Paste_1400] button is:" + JSON.stringify(button)); - await button[1].click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_1400] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Paste_1500', 0, async function (done) { - console.debug('====>[Test_Security_Button_Paste_1500] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": -200, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Paste_1500] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_1500] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyPaste1'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.offset.x).assertEqual('-200.00vp'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Paste_1500] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Paste_1500] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == PasteButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { - console.debug("====>[Test_Security_Button_Paste_1500] ERR CASE 成功"); - expect(clickData.data.clickResult == PasteButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); - console.debug("====>[Test_Security_Button_Paste_1500] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Paste_1500] ERR CASE 失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Paste_1500] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_1500] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponents(ON.type('PasteButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Paste_1500] button is:" + JSON.stringify(button)); - await button[1].click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_1500] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Paste_1600', 0, async function (done) { - console.debug('====>[Test_Security_Button_Paste_1600] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 150, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Paste_1600] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_1600] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyPaste'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.iconSize).assertEqual('150.00vp'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Paste_1600] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Paste_1600] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == PasteButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { - console.debug("====>[Test_Security_Button_Paste_1600] ERR CASE 成功"); - expect(clickData.data.clickResult == PasteButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); - console.debug("====>[Test_Security_Button_Paste_1600] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Paste_1600] ERR CASE 失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Paste_1600] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_1600] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('PasteButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Paste_1600] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_1600] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Paste_1700', 0, async function (done) { - console.debug('====>[Test_Security_Button_Paste_1700] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0x10ff0000, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Paste_1700] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_1700] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyPaste'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.iconColor).assertEqual('#10FF0000'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Paste_1700] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Paste_1700] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == PasteButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { - console.debug("====>[Test_Security_Button_Paste_1700] ERR CASE 成功"); - expect(clickData.data.clickResult == PasteButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); - console.debug("====>[Test_Security_Button_Paste_1700] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Paste_1700] ERR CASE 失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Paste_1700] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_1700] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('PasteButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Paste_1700] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_1700] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Paste_1800', 0, async function (done) { - console.debug('====>[Test_Security_Button_Paste_1800] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 20, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xfffa0050, - "bgColor": 0xffff0000, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Paste_1800] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_1800] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyPaste'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.buttonType).assertEqual(0); - expect(obj.$attrs.iconSize).assertEqual('20.00vp'); - expect(obj.$attrs.iconColor).assertEqual('#FFFA0050'); - expect(obj.$attrs.backgroundColor).assertEqual('#FFFF0000'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Paste_1800] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Paste_1800] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == PasteButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { - console.debug("====>[Test_Security_Button_Paste_1800] ERR CASE 成功"); - expect(clickData.data.clickResult == PasteButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); - console.debug("====>[Test_Security_Button_Paste_1800] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Paste_1800] ERR CASE 失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Paste_1800] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_1800] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('PasteButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Paste_1800] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_1800] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Paste_1900', 0, async function (done) { - console.debug('====>[Test_Security_Button_Paste_1900] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 1, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 20, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Paste_1900] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_1900] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyPaste'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.iconSize).assertEqual('1.00vp'); - expect(obj.$attrs.fontSize).assertEqual('20.00fp'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Paste_1900] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Paste_1900] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == PasteButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { - console.debug("====>[Test_Security_Button_Paste_1900] ERR CASE 成功"); - expect(clickData.data.clickResult == PasteButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); - console.debug("====>[Test_Security_Button_Paste_1900] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Paste_1900] ERR CASE 失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Paste_1900] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_1900] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('PasteButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Paste_1900] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_1900] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Paste_2000', 0, async function (done) { - console.debug('====>[Test_Security_Button_Paste_2000] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor":Color.Transparent, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Paste_2000] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_2000] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyPaste'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.iconColor).assertEqual('#00000000'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Paste_2000] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Paste_2000] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == PasteButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { - console.debug("====>[Test_Security_Button_Paste_2000] ERR CASE 成功"); - expect(clickData.data.clickResult == PasteButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); - console.debug("====>[Test_Security_Button_Paste_2000] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Paste_2000] ERR CASE 失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Paste_2000] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_2000] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('PasteButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Paste_2000] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_2000] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Paste_2100', 0, async function (done) { - console.debug('====>[Test_Security_Button_Paste_2100] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": Color.Transparent, - "iconColor":0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Paste_2100] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_2100] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyPaste'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.fontColor).assertEqual('#00000000'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Paste_2100] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Paste_2100] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == PasteButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { - console.debug("====>[Test_Security_Button_Paste_2100] ERR CASE 成功"); - expect(clickData.data.clickResult == PasteButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); - console.debug("====>[Test_Security_Button_Paste_2100] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Paste_2100] ERR CASE 失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Paste_2100] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_2100] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('PasteButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Paste_2100] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_2100] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Paste_2200', 0, async function (done) { - console.debug('====>[Test_Security_Button_Paste_2200] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 20, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor":0xffffffff, - "bgColor": Color.Transparent, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Paste_2200] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_2200] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keyPaste'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.backgroundColor).assertEqual('#00000000'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Paste_2200] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Paste_2200] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == PasteButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { - console.debug("====>[Test_Security_Button_Paste_2200] ERR CASE 成功"); - expect(clickData.data.clickResult == PasteButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); - console.debug("====>[Test_Security_Button_Paste_2200] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Paste_2200] ERR CASE 失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Paste_2200] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_2200] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('PasteButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Paste_2200] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Paste_2200] clickSecComponent err : " + JSON.stringify(err)); - } - }); - }) -} \ No newline at end of file diff --git a/test/security_component/entry/src/main/ets/test/SaveComponentTest.test.ets b/test/security_component/entry/src/main/ets/test/SaveComponentTest.test.ets deleted file mode 100644 index 112b6bb..0000000 --- a/test/security_component/entry/src/main/ets/test/SaveComponentTest.test.ets +++ /dev/null @@ -1,1926 +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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" -import router from '@ohos.router'; -import events_emitter from '@ohos.events.emitter'; -import { Driver, ON } from '@ohos.UiTest' -import Utils from './Utils'; - -export default function saveComponentTest() { - describe('saveComponentTest', function () { - beforeAll(async function (done) { - let options = { - url: 'MainAbility/pages/saveButton', - } - try { - router.clear(); - let pages = router.getState(); - console.debug("====>saveComponentTest get state success " + JSON.stringify(pages)); - if (!("saveButton" == pages.name)) { - console.debug("====>saveComponentTest get state success " + JSON.stringify(pages.name)); - let result = await router.pushUrl(options); - await Utils.sleep(2000); - console.debug("====>saveComponentTest push page success " + JSON.stringify(result)); - } - } catch (err) { - console.error("====>saveComponentTest push page error: " + err); - } - done() - }); - - afterEach(async function () { - await Utils.sleep(1000); - console.debug("====>saveComponentTest after each called"); - }); - - it('Test_Security_Button_Save_0100', 0, async function (done) { - console.debug('====>[Test_Security_Button_Save_0100] START===='); - let strJson = getInspectorByKey('keySave'); - let obj = JSON.parse(strJson); - expect(obj.$attrs.icon).assertEqual(0); - expect(obj.$attrs.text).assertEqual(0); - expect(obj.$attrs.buttonType).assertEqual(0); - expect(obj.$attrs.iconSize).assertEqual('16.00vp'); - expect(obj.$attrs.layoutDirection).assertEqual(0); - expect(obj.$attrs.position.x).assertEqual('0.00vp'); - expect(obj.$attrs.position.y).assertEqual('0.00vp'); - expect(obj.$attrs.markAnchor.x).assertEqual('0.00vp'); - expect(obj.$attrs.markAnchor.y).assertEqual('0.00vp'); - expect(obj.$attrs.offset.x).assertEqual('0.00vp'); - expect(obj.$attrs.offset.y).assertEqual('0.00vp'); - expect(obj.$attrs.fontSize).assertEqual('16.00fp'); - expect(obj.$attrs.fontStyle).assertEqual(0); - expect(obj.$attrs.fontWeight).assertEqual('FontWeight.Medium'); - expect(obj.$attrs.fontFamily).assertEqual('HarmonyOS Sans'); - expect(obj.$attrs.fontColor).assertEqual('#FFFFFFFF'); - expect(obj.$attrs.iconColor).assertEqual('#FFFFFFFF'); - expect(obj.$attrs.backgroundColor).assertEqual('#FF007DFF'); - expect(obj.$attrs.borderStyle).assertEqual(1); - expect(obj.$attrs.borderWidth).assertEqual('0.00vp'); - expect(obj.$attrs.borderColor).assertEqual('#FFFFFFFF'); - expect(obj.$attrs.borderRadius).assertEqual('0.00vp'); - expect(obj.$attrs.padding.left).assertEqual('24.00vp'); - expect(obj.$attrs.padding.right).assertEqual('24.00vp'); - expect(obj.$attrs.padding.top).assertEqual('8.00vp'); - expect(obj.$attrs.padding.bottom).assertEqual('8.00vp'); - expect(obj.$attrs.textIconSpace).assertEqual('4.00vp'); - await Utils.sleep(1000); - try { - let clickCallback = async (clickData) => { - console.debug("====>[Test_Security_Button_Save_0100] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Save_0100] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Save_0100] 设置权限成功"); - expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); - await Utils.sleep(500); - let driver = Driver.create(); - let textComponent = await driver.findComponent(ON.type('Button')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Save_0100] textComponent is:" + JSON.stringify(textComponent)); - await textComponent.click(); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Save_0100] END===="); - done() - } else { - console.debug("====>[Test_Security_Button_Save_0100] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Save_0100] END===="); - done() - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_0100] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('SaveButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Save_0100] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_0100] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Save_0200', 0, async function (done) { - console.debug('====>[Test_Security_Button_Save_0200] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": SecurityComponentLayoutDirection.VERTICAL, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Save_0200] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_0200] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keySave'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.layoutDirection).assertEqual(SecurityComponentLayoutDirection.VERTICAL); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Save_0200] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Save_0200] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Save_0200] 设置权限成功"); - expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Save_0200] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Save_0200] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Save_0200] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_0200] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('SaveButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Save_0200] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_0200] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Save_0300', 0, async function (done) { - console.debug('====>[Test_Security_Button_Save_0300] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 150, - "positionY": 20, - "anchorX": 20, - "anchorY": 20, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Save_0300] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_0300] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keySave'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.position.x).assertEqual('150.00vp'); - expect(obj.$attrs.position.y).assertEqual('20.00vp'); - expect(obj.$attrs.markAnchor.x).assertEqual('20.00vp'); - expect(obj.$attrs.markAnchor.y).assertEqual('20.00vp'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Save_0300] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Save_0300] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Save_0300] 设置权限成功"); - expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Save_0300] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Save_0300] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Save_0300] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_0300] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('SaveButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Save_0300] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_0300] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Save_0400', 0, async function (done) { - console.debug('====>[Test_Security_Button_Save_0400] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 1, - "positionX": 0, - "positionY": 0, - "anchorX": 20, - "anchorY": 20, - "offsetX": 100, - "offsetY": 100, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Save_0400] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_0400] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keySave1'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.offset.x).assertEqual('100.00vp'); - expect(obj.$attrs.offset.y).assertEqual('100.00vp'); - expect(obj.$attrs.markAnchor.x).assertEqual('20.00vp'); - expect(obj.$attrs.markAnchor.y).assertEqual('20.00vp'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Save_0400] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Save_0400] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Save_0400] 设置权限成功"); - expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Save_0400] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Save_0400] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Save_0400] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_0400] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponents(ON.type('SaveButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Save_0400] button is:" + JSON.stringify(button)); - await button[1].click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_0400] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Save_0500', 0, async function (done) { - console.debug('====>[Test_Security_Button_Save_0500] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Italic, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Save_0500] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_0500] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keySave'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.fontStyle).assertEqual(1); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Save_0500] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Save_0500] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Save_0500] 设置权限成功"); - expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Save_0500] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Save_0500] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Save_0500] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_0500] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('SaveButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Save_0500] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_0500] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Save_0600', 0, async function (done) { - console.debug('====>[Test_Security_Button_Save_0600] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Lighter, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Save_0600] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_0600] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keySave'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.fontWeight).assertEqual('FontWeight.Lighter'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Save_0600] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Save_0600] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Save_0600] 设置权限成功"); - expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Save_0600] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Save_0600] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Save_0600] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_0600] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('SaveButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Save_0600] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_0600] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Save_0700', 0, async function (done) { - console.debug('====>[Test_Security_Button_Save_0700] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Normal, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Save_0700] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_0700] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keySave'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.fontWeight).assertEqual('FontWeight.Normal'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Save_0700] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Save_0700] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Save_0700] 设置权限成功"); - expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Save_0700] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Save_0700] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Save_0700] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_0700] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('SaveButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Save_0700] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_0700] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Save_0800', 0, async function (done) { - console.debug('====>[Test_Security_Button_Save_0800] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Regular, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Save_0800] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_0800] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keySave'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.fontWeight).assertEqual('FontWeight.Regular'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Save_0800] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Save_0800] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Save_0800] 设置权限成功"); - expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Save_0800] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Save_0800] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Save_0800] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_0800] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('SaveButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Save_0800] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_0800] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Save_0900', 0, async function (done) { - console.debug('====>[Test_Security_Button_Save_0900] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Bold, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Save_0900] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_0900] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keySave'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.fontWeight).assertEqual('FontWeight.Bold'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Save_0900] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Save_0900] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Save_0900] 设置权限成功"); - expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Save_0900] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Save_0900] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Save_0900] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_0900] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('SaveButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Save_0900] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_0900] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Save_1000', 0, async function (done) { - console.debug('====>[Test_Security_Button_Save_1000] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Bolder, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Save_1000] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_1000] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keySave'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.fontWeight).assertEqual('FontWeight.Bolder'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Save_1000] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Save_1000] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Save_1000] 设置权限成功"); - expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Save_1000] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Save_1000] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Save_1000] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_1000] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('SaveButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Save_1000] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_1000] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Save_1100', 0, async function (done) { - console.debug('====>[Test_Security_Button_Save_1100] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dotted, - "borderWid": 5, - "borderCol": 0xffffffff, - "borderRad": 5, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Save_1100] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_1100] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keySave'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.borderStyle).assertEqual(2); - expect(obj.$attrs.borderWidth).assertEqual('5.00vp'); - expect(obj.$attrs.borderColor).assertEqual('#FFFFFFFF'); - expect(obj.$attrs.borderRadius).assertEqual('5.00vp'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Save_1100] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Save_1100] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Save_1100] 设置权限成功"); - expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Save_1100] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Save_1100] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Save_1100] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_1100] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('SaveButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Save_1100] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_1100] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Save_1200', 0, async function (done) { - console.debug('====>[Test_Security_Button_Save_1200] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 5, - "borderCol": 0xffffffff, - "borderRad": 5, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Save_1200] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_1200] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keySave'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.borderStyle).assertEqual(1); - expect(obj.$attrs.borderWidth).assertEqual('5.00vp'); - expect(obj.$attrs.borderColor).assertEqual('#FFFFFFFF'); - expect(obj.$attrs.borderRadius).assertEqual('5.00vp'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Save_1200] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Save_1200] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Save_1200] 设置权限成功"); - expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Save_1200] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Save_1200] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Save_1200] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_1200] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('SaveButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Save_1200] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_1200] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Save_1300', 0, async function (done) { - console.debug('====>[Test_Security_Button_Save_1300] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Solid, - "borderWid": 5, - "borderCol": 0xffffffff, - "borderRad": 5, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Save_1300] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_1300] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keySave'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.borderStyle).assertEqual(0); - expect(obj.$attrs.borderWidth).assertEqual('5.00vp'); - expect(obj.$attrs.borderColor).assertEqual('#FFFFFFFF'); - expect(obj.$attrs.borderRadius).assertEqual('5.00vp'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Save_1300] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Save_1300] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Save_1300] 设置权限成功"); - expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Save_1300] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Save_1300] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Save_1300] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_1300] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('SaveButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Save_1300] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_1300] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Save_1400', 0, async function (done) { - console.debug('====>[Test_Security_Button_Save_1400] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 200, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Save_1400] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_1400] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keySave1'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.offset.x).assertEqual('200.00vp'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Save_1400] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Save_1400] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == SaveButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { - console.debug("====>[Test_Security_Button_Save_1400] 设置权限成功"); - expect(clickData.data.clickResult == SaveButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); - console.debug("====>[Test_Security_Button_Save_1400] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Save_1400] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Save_1400] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_1400] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponents(ON.type('SaveButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Save_1400] button is:" + JSON.stringify(button)); - await button[1].click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_1400] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Save_1500', 0, async function (done) { - console.debug('====>[Test_Security_Button_Save_1500] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": -200, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Save_1500] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_1500] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keySave1'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.offset.x).assertEqual('-200.00vp'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Save_1500] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Save_1500] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == SaveButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { - console.debug("====>[Test_Security_Button_Save_1500] 设置权限成功"); - expect(clickData.data.clickResult == SaveButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); - console.debug("====>[Test_Security_Button_Save_1500] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Save_1500] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Save_1500] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_1500] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponents(ON.type('SaveButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Save_1500] button is:" + JSON.stringify(button)); - await button[1].click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_1500] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Save_1600', 0, async function (done) { - console.debug('====>[Test_Security_Button_Save_1600] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 150, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Save_1600] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_1600] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keySave'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.iconSize).assertEqual('150.00vp'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Save_1600] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Save_1600] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == SaveButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { - console.debug("====>[Test_Security_Button_Save_1600] 设置权限成功"); - expect(clickData.data.clickResult == SaveButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); - console.debug("====>[Test_Security_Button_Save_1600] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Save_1600] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Save_1600] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_1600] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('SaveButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Save_1600] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_1600] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Save_1700', 0, async function (done) { - console.debug('====>[Test_Security_Button_Save_1700] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0x10ff0000, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Save_1700] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_1700] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keySave'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.iconColor).assertEqual('#10FF0000'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Save_1700] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Save_1700] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == SaveButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { - console.debug("====>[Test_Security_Button_Save_1700] 设置权限成功"); - expect(clickData.data.clickResult == SaveButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); - console.debug("====>[Test_Security_Button_Save_1700] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Save_1700] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Save_1700] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_1700] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('SaveButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Save_1700] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_1700] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Save_1800', 0, async function (done) { - console.debug('====>[Test_Security_Button_Save_1800] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 20, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xfffa0050, - "bgColor": 0xffff0000, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Save_1800] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_1800] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keySave'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.iconSize).assertEqual('20.00vp'); - expect(obj.$attrs.iconColor).assertEqual('#FFFA0050'); - expect(obj.$attrs.backgroundColor).assertEqual('#FFFF0000'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Save_1800] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Save_1800] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == SaveButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { - console.debug("====>[Test_Security_Button_Save_1800] 设置权限成功"); - expect(clickData.data.clickResult == SaveButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); - console.debug("====>[Test_Security_Button_Save_1800] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Save_1800] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Save_1800] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_1800] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('SaveButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Save_1800] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_1800] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Save_1900', 0, async function (done) { - console.debug('====>[Test_Security_Button_Save_1900] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 1, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 20, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Save_1900] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_1900] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keySave'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.iconSize).assertEqual('1.00vp'); - expect(obj.$attrs.fontSize).assertEqual('20.00fp'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Save_1900] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Save_1900] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == SaveButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { - console.debug("====>[Test_Security_Button_Save_1900] 设置权限成功"); - expect(clickData.data.clickResult == SaveButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); - console.debug("====>[Test_Security_Button_Save_1900] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Save_1900] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Save_1900] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_1900] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('SaveButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Save_1900] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_1900] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Save_2000', 0, async function (done) { - console.debug('====>[Test_Security_Button_Save_2000] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": Color.Transparent, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Save_2000] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_2000] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keySave'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.iconColor).assertEqual('#00000000'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Save_2000] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Save_2000] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == SaveButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { - console.debug("====>[Test_Security_Button_Save_2000] 设置权限成功"); - expect(clickData.data.clickResult == SaveButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); - console.debug("====>[Test_Security_Button_Save_2000] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Save_2000] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Save_2000] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_2000] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('SaveButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Save_2000] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_2000] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Save_2100', 0, async function (done) { - console.debug('====>[Test_Security_Button_Save_2100] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 16, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": Color.Transparent, - "iconColor": 0xffffffff, - "bgColor": 0xff007dff, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Save_2100] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_2100] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keySave'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.fontColor).assertEqual('#00000000'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Save_2100] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Save_2100] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == SaveButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { - console.debug("====>[Test_Security_Button_Save_2100] 设置权限成功"); - expect(clickData.data.clickResult == SaveButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); - console.debug("====>[Test_Security_Button_Save_2100] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Save_2100] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Save_2100] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_2100] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('SaveButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Save_2100] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_2100] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Save_2200', 0, async function (done) { - console.debug('====>[Test_Security_Button_Save_2200] START===='); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "icon": 0, - "textType": 0, - "bgType": ButtonType.Normal, - "iconSize": 16, - "direct": 0, - "positionX": 0, - "positionY": 0, - "anchorX": 0, - "anchorY": 0, - "offsetX": 0, - "offsetY": 0, - "fontSize": 20, - "fontStyle": FontStyle.Normal, - "fontWeight": FontWeight.Medium, - "fontFamily": 'HarmonyOS Sans', - "fontColor": 0xffffffff, - "iconColor": 0xffffffff, - "bgColor": Color.Transparent, - "borderSty": BorderStyle.Dashed, - "borderWid": 0, - "borderCol": 0xffffffff, - "borderRad": 0, - "left": 24, - "right": 24, - "top": 8, - "bottom": 8, - "middle": 4 - } - } - var innerEvent = { - eventId: 1, - priority: events_emitter.EventPriority.LOW - } - console.debug("====>[Test_Security_Button_Save_2200] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_2200] change component data error: " + err.message); - } - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keySave'); - let obj = JSON.parse(strJsonNew); - expect(obj.$attrs.backgroundColor).assertEqual('#00000000'); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Save_2200] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Save_2200] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == SaveButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { - console.debug("====>[Test_Security_Button_Save_2200] 设置权限成功"); - expect(clickData.data.clickResult == SaveButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); - console.debug("====>[Test_Security_Button_Save_2200] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Save_2200] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Save_2200] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_2200] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponent(ON.type('SaveButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Save_2200] button is:" + JSON.stringify(button)); - await button.click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_2200] clickSecComponent err : " + JSON.stringify(err)); - } - }); - }) -} \ No newline at end of file diff --git a/test/security_component/entry/src/main/ets/test/SaveComponentTest_1.test.ets b/test/security_component/entry/src/main/ets/test/SaveComponentTest_1.test.ets deleted file mode 100644 index 6ac33ad..0000000 --- a/test/security_component/entry/src/main/ets/test/SaveComponentTest_1.test.ets +++ /dev/null @@ -1,358 +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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" -import router from '@ohos.router'; -import events_emitter from '@ohos.events.emitter'; -import { Driver, ON } from '@ohos.UiTest' -import Utils from './Utils'; - -export default function saveComponentTest_1() { - describe('saveComponentTest_1', function () { - beforeAll(async function (done) { - let options = { - url: 'MainAbility/pages/saveButton_1', - } - try { - router.clear(); - let pages = router.getState(); - console.debug("====>saveComponentTest_1 get state success " + JSON.stringify(pages)); - if (!("saveButton_1" == pages.name)) { - console.debug("====>saveComponentTest_1 get state success " + JSON.stringify(pages.name)); - let result = await router.pushUrl(options); - await Utils.sleep(2000); - console.debug("====>saveComponentTest_1 push page success " + JSON.stringify(result)); - } - } catch (err) { - console.error("====>saveComponentTest_1 push page error: " + err); - } - done() - }); - - afterEach(async function () { - await Utils.sleep(1000); - console.debug("====>saveComponentTest_1 after each called"); - }); - - it('Test_Security_Button_Save_2300', 0, async function (done) { - console.debug('====>[Test_Security_Button_Save_2300] START===='); - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keySave2'); - let obj = JSON.parse(strJsonNew); - console.debug("====>component obj.$attrs.icon:" + obj.$attrs.icon); - console.debug("====>component obj.$attrs.text:" + obj.$attrs.text); - expect(obj.$attrs.icon).assertEqual(1); - expect(obj.$attrs.text).assertEqual(1); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Save_2300] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Save_2300] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Save_2300] 设置权限成功"); - expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Save_2300] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Save_2300] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Save_2300] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_2300] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponents(ON.type('SaveButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Save_2300] button is:" + JSON.stringify(button)); - await button[0].click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_2300] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Save_2400', 0, async function (done) { - console.debug('====>[Test_Security_Button_Save_2400] START===='); - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keySave3'); - let obj = JSON.parse(strJsonNew); - console.debug("====>component obj.$attrs.text:" + obj.$attrs.text); - expect(obj.$attrs.text).assertEqual(2); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Save_2400] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Save_2400] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Save_2400] 设置权限成功"); - expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Save_2400] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Save_2400] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Save_2400] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_2400] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponents(ON.type('SaveButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Save_2400] button is:" + JSON.stringify(button)); - await button[1].click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_2400] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Save_2500', 0, async function (done) { - console.debug('====>[Test_Security_Button_Save_2500] START===='); - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keySave4'); - let obj = JSON.parse(strJsonNew); - console.debug("====>component obj.$attrs.text:" + obj.$attrs.text); - expect(obj.$attrs.text).assertEqual(3); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Save_2500] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Save_2500] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Save_2500] 设置权限成功"); - expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Save_2500] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Save_2500] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Save_2500] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_2500] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponents(ON.type('SaveButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Save_2500] button is:" + JSON.stringify(button)); - await button[2].click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_2500] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Save_2600', 0, async function (done) { - console.debug('====>[Test_Security_Button_Save_2600] START===='); - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keySave5'); - let obj = JSON.parse(strJsonNew); - console.debug("====>component obj.$attrs.text:" + obj.$attrs.text); - expect(obj.$attrs.text).assertEqual(4); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Save_2600] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Save_2600] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Save_2600] 设置权限成功"); - expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Save_2600] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Save_2600] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Save_2600] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_2600] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponents(ON.type('SaveButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Save_2600] button is:" + JSON.stringify(button)); - await button[3].click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_2600] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Save_2700', 0, async function (done) { - console.debug('====>[Test_Security_Button_Save_2700] START===='); - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keySave6'); - let obj = JSON.parse(strJsonNew); - console.debug("====>component obj.$attrs.text:" + obj.$attrs.text); - expect(obj.$attrs.text).assertEqual(5); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Save_2700] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Save_2700] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Save_2700] 设置权限成功"); - expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Save_2700] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Save_2700] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Save_2700] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_2700] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponents(ON.type('SaveButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Save_2700] button is:" + JSON.stringify(button)); - await button[4].click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_2700] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Save_2800', 0, async function (done) { - console.debug('====>[Test_Security_Button_Save_2800] START===='); - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keySave7'); - let obj = JSON.parse(strJsonNew); - console.debug("====>component obj.$attrs.text:" + obj.$attrs.text); - expect(obj.$attrs.text).assertEqual(6); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Save_2800] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Save_2800] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Save_2800] 设置权限成功"); - expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Save_2800] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Save_2800] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Save_2800] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_2800] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponents(ON.type('SaveButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Save_2800] button is:" + JSON.stringify(button)); - await button[5].click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_2800] clickSecComponent err : " + JSON.stringify(err)); - } - }); - - it('Test_Security_Button_Save_2900', 0, async function (done) { - console.debug('====>[Test_Security_Button_Save_2900] START===='); - await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('keySave8'); - let obj = JSON.parse(strJsonNew); - console.debug("====>component obj.$attrs.text:" + obj.$attrs.text); - expect(obj.$attrs.text).assertEqual(7); - await Utils.sleep(1000); - try { - let clickCallback = (clickData) => { - console.debug("====>[Test_Security_Button_Save_2900] get clickEvent result is: " + JSON.stringify(clickEvent)); - console.debug("====>[Test_Security_Button_Save_2900] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); - if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { - console.debug("====>[Test_Security_Button_Save_2900] 设置权限成功"); - expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); - console.debug("====>[Test_Security_Button_Save_2900] END===="); - done(); - } else { - console.debug("====>[Test_Security_Button_Save_2900] 设置权限失败"); - expect().assertFail() - console.debug("====>[Test_Security_Button_Save_2900] END===="); - done(); - } - } - var clickEvent = { - eventId: 2, - priority: events_emitter.EventPriority.LOW - } - events_emitter.once(clickEvent, clickCallback); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_2900] once clickEvent err : " + JSON.stringify(err)); - } - try { - let driver = Driver.create(); - let button = await driver.findComponents(ON.type('SaveButton')); - await Utils.sleep(500); - console.debug("====>[Test_Security_Button_Save_2900] button is:" + JSON.stringify(button)); - await button[6].click(); - await Utils.sleep(1000); - } catch (err) { - console.debug("====>[Test_Security_Button_Save_2900] clickSecComponent err : " + JSON.stringify(err)); - } - }); - }) -} \ No newline at end of file diff --git a/test/security_component/entry/src/main/ets/test/Utils.ets b/test/security_component/entry/src/main/ets/test/Utils.ets deleted file mode 100644 index bb1f4a4..0000000 --- a/test/security_component/entry/src/main/ets/test/Utils.ets +++ /dev/null @@ -1,118 +0,0 @@ -// @ts-nocheck -/** - * 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 Utils { - static rect_left; - static rect_top; - static rect_right; - static rect_bottom; - static rect_value; - - static sleep(time) { - return new Promise((resolve, reject) => { - setTimeout(() => { - resolve() - }, time) - }).then(() => { - console.info(`sleep ${time} over...`) - }) - } - - static getComponentRect(key) { - let strJson = getInspectorByKey(key); - let obj = JSON.parse(strJson); - console.info("[getInspectorByKey] current component obj is: " + JSON.stringify(obj)); - let rectInfo = JSON.parse('[' + obj.$rect + ']') - console.info("[getInspectorByKey] rectInfo is: " + rectInfo); - this.rect_left = JSON.parse('[' + rectInfo[0] + ']')[0] - this.rect_top = JSON.parse('[' + rectInfo[0] + ']')[1] - this.rect_right = JSON.parse('[' + rectInfo[1] + ']')[0] - this.rect_bottom = JSON.parse('[' + rectInfo[1] + ']')[1] - return this.rect_value = { - "left": this.rect_left, "top": this.rect_top, "right": this.rect_right, "bottom": this.rect_bottom - } - } - - static async swipe(downX, downY, upX, upY, steps) { - console.info('start to swipe') - this.drags(downX, downY, upX, upY, steps, false) - } - - static async drag(downX, downY, upX, upY, steps) { - console.info('start to drag') - this.drags(downX, downY, upX, upY, steps, true) - } - - static async drags(downX, downY, upX, upY, steps, drag) { - var xStep; - var yStep; - var swipeSteps; - var ret; - xStep = 0; - yStep = 0; - ret = false; - swipeSteps = steps; - if (swipeSteps == 0) { - swipeSteps = 1; - } - xStep = (upX - downX) / swipeSteps; - yStep = (upY - downY) / swipeSteps; - console.info('move step is: ' + 'xStep: ' + xStep + ' yStep: ' + yStep) - var downPonit: TouchObject = { - id: 1, - x: downX, - y: downY, - type: TouchType.Down, - } - console.info('down touch started: ' + JSON.stringify(downPonit)) - sendTouchEvent(downPonit); - console.info('start to move') - if (drag) { - await this.sleep(500) - } - for (var i = 1;i <= swipeSteps; i++) { - var movePoint: TouchObject = { - id: 1, - x: downX + (xStep * i), - y: downY + (yStep * i), - type: TouchType.Move - } - console.info('move touch started: ' + JSON.stringify(movePoint)) - ret = sendTouchEvent(movePoint) - if (ret == false) { - break; - } - await this.sleep(5) - } - console.info('start to up') - if (drag) { - await this.sleep(100) - } - var upPoint: TouchObject = { - id: 1, - x: upX, - y: upY, - type: TouchType.Up, - } - console.info('up touch started: ' + JSON.stringify(upPoint)) - sendTouchEvent(upPoint) - await this.sleep(500) - } -} - - - - diff --git a/test/security_component/entry/src/main/module.json b/test/security_component/entry/src/main/module.json deleted file mode 100644 index 0db2097..0000000 --- a/test/security_component/entry/src/main/module.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "tablet", - "default", - "phone", - "2in1" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "metadata": [ - { - "name": "ArkTSPartialUpdate", - "value": "true" - } - ], - "abilities": [ - { - "name": "com.example.securitycomponent.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ] - } -} \ No newline at end of file diff --git a/test/security_component/entry/src/main/resources/base/element/color.json b/test/security_component/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 07a14d2..0000000 --- a/test/security_component/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "color": [ - { - "name": "color_hello", - "value": "#ffff0000" - }, - { - "name": "color_world", - "value": "#ff0000ff" - } - ] -} \ No newline at end of file diff --git a/test/security_component/entry/src/main/resources/base/element/float.json b/test/security_component/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 26a0491..0000000 --- a/test/security_component/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "float":[ - { - "name":"font_hello", - "value":"28.0fp" - }, - { - "name":"font_world", - "value":"20.0fp" - } - ] -} \ No newline at end of file diff --git a/test/security_component/entry/src/main/resources/base/element/string.json b/test/security_component/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f9f9529..0000000 --- a/test/security_component/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "entry_MainAbility" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - }, - { - "name":"string_hello", - "value":"Hello" - }, - { - "name":"string_world", - "value":"World" - }, - { - "name":"message_arrive", - "value":"We will arrive at %s." - }, - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsContextTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - } - ] -} \ No newline at end of file diff --git a/test/security_component/entry/src/main/resources/base/media/icon.png b/test/security_component/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?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y_QscYSV zw1l(ifNstNaz& zzj`pX1in6Jaar=L)qm(%Q2{Qg{X!NJm{J)-os#t#PU_A`sN?tD4%!~5s#eC--k+Zx)0 z?CEO1-BWwd+%a}suj|eAf6-3Z^@iZ`kv%)_)lR-QH)jpioBPul#;{$#T$ZZ+b{7I( z2IEB%E z7g?!1(3$ex{u_DOpIvxM@Vg_j-OEGOt4=KcN$6l>$NPUa0o&m(H_t1se6Rc6kG5vF z?YXsTRmQC|t+Q6$eQn9%{G7W3C;Qg@AhPUo0c?~xJy9e7hsK_0Zlg{ZUR@HvxgdDy z75U0vM{d0K+q)%owfjyKZ@+pp-<3XPDbu8 WUdSHf-&-pCeSg&C`9gc{>;D3_`BVD< -- Gitee From 6190a592d9bb9ba21898459864a8ed420e02bafe Mon Sep 17 00:00:00 2001 From: y1585740638 Date: Mon, 21 Aug 2023 20:24:26 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dtdd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: y1585740638 --- BUILD.gn | 45 + LICENSE | 177 ++ README_zh.md | 47 + bundle.json | 106 + config/BUILD.gn | 23 + .../figures/zh-cn_image_0000001593518280.png | Bin 64148 -> 0 bytes .../figures/zh-cn_image_0000001593677984.png | Bin 26150 -> 0 bytes .../figures/zh-cn_image_0000001643038221.png | Bin 26031 -> 0 bytes .../figures/zh-cn_image_0000001643320073.png | Bin 24287 -> 0 bytes .../ts-basic-components-seclocationbutton.md | 137 -- .../ts-basic-components-secpastebutton.md | 96 - .../ts-basic-components-secsavebutton.md | 104 - ...-universal-attributes-securitycomponent.md | 76 - .../figures/zh-cn_image_0000001566651300.png | Bin 72286 -> 0 bytes .../security-components-guidelines.md | 128 -- docs/security/security-components-overview.md | 63 - frameworks/BUILD.gn | 94 + frameworks/common/include/sec_comp_err.h | 54 + frameworks/common/include/sec_comp_log.h | 62 + frameworks/common/include/sec_comp_tool.h | 28 + frameworks/common/src/sec_comp_tool.cpp | 142 ++ .../include/sec_comp_enhance_adapter.h | 122 ++ .../src/sec_comp_enhance_adapter.cpp | 235 ++ .../include/sec_comp_click_event_parcel.h | 38 + .../src/location_button.cpp | 53 + .../security_component/src/paste_button.cpp | 53 + .../security_component/src/save_button.cpp | 53 + .../security_component/src/sec_comp_base.cpp | 369 ++++ .../src/sec_comp_click_event_parcel.cpp | 102 + hisysevent.yaml | 94 + interfaces/inner_api/enhance_kits/BUILD.gn | 55 + .../include/sec_comp_enhance_kit.h | 32 + .../include/sec_comp_enhance_kit_c.h | 21 + .../enhance_kits/src/sec_comp_enhance_kit.cpp | 45 + .../inner_api/enhance_kits/test/BUILD.gn | 48 + .../unittest/src/sec_comp_enhance_test.cpp | 135 ++ .../test/unittest/src/sec_comp_enhance_test.h | 38 + .../inner_api/security_component/BUILD.gn | 67 + .../include/i_sec_comp_probe.h | 30 + .../include/i_sec_comp_service.h | 45 + .../include/location_button.h | 57 + .../security_component/include/paste_button.h | 46 + .../security_component/include/save_button.h | 54 + .../include/sec_comp_base.h | 139 ++ .../include/sec_comp_caller_authorization.h | 43 + .../include/sec_comp_client.h | 68 + .../include/sec_comp_death_recipient.h | 32 + .../include/sec_comp_info.h | 130 ++ .../security_component/include/sec_comp_kit.h | 40 + .../include/sec_comp_load_callback.h | 33 + .../include/sec_comp_proxy.h | 43 + .../include/sec_comp_ui_register.h | 33 + ...ity_component_service_ipc_interface_code.h | 43 + .../src/sec_comp_caller_authorization.cpp | 67 + .../src/sec_comp_client.cpp | 258 +++ .../src/sec_comp_death_recipient.cpp | 28 + .../security_component/src/sec_comp_kit.cpp | 138 ++ .../src/sec_comp_load_callback.cpp | 61 + .../security_component/src/sec_comp_proxy.cpp | 274 +++ .../src/sec_comp_ui_register.cpp | 39 + .../security_component/test/BUILD.gn | 93 + .../unittest/src/location_button_test.cpp | 551 +++++ .../test/unittest/src/location_button_test.h | 38 + .../test/unittest/src/paste_button_test.cpp | 198 ++ .../test/unittest/src/paste_button_test.h | 38 + .../test/unittest/src/save_button_test.cpp | 198 ++ .../test/unittest/src/save_button_test.h | 38 + .../test/unittest/src/sec_comp_kit_test.cpp | 191 ++ .../test/unittest/src/sec_comp_kit_test.h | 37 + .../src/sec_comp_register_callback_test.cpp | 307 +++ .../test/unittest/src/test_common.cpp | 168 ++ .../test/unittest/src/test_common.h | 47 + security_component.gni | 14 + .../security_component_service/sa/BUILD.gn | 91 + .../sa/sa_main/app_mgr_death_recipient.cpp | 28 + .../sa/sa_main/app_mgr_death_recipient.h | 33 + .../sa/sa_main/app_state_observer.cpp | 129 ++ .../sa/sa_main/app_state_observer.h | 57 + .../sa/sa_main/delay_exit_task.cpp | 72 + .../sa/sa_main/delay_exit_task.h | 44 + .../sa/sa_main/first_use_dialog.cpp | 297 +++ .../sa/sa_main/first_use_dialog.h | 64 + .../sa/sa_main/sec_comp_entity.cpp | 85 + .../sa/sa_main/sec_comp_entity.h | 80 + .../sa/sa_main/sec_comp_info_helper.cpp | 272 +++ .../sa/sa_main/sec_comp_info_helper.h | 51 + .../sa/sa_main/sec_comp_manager.cpp | 519 +++++ .../sa/sa_main/sec_comp_manager.h | 101 + .../sa/sa_main/sec_comp_perm_manager.cpp | 132 ++ .../sa/sa_main/sec_comp_perm_manager.h | 57 + .../sa/sa_main/sec_comp_service.cpp | 284 +++ .../sa/sa_main/sec_comp_service.h | 65 + .../sa/sa_main/sec_comp_stub.cpp | 244 +++ .../sa/sa_main/sec_comp_stub.h | 49 + .../sa/sa_main/sec_event_handler.cpp | 40 + .../sa/sa_main/sec_event_handler.h | 37 + .../sa/sa_profile/3506.json | 12 + .../sa/sa_profile/BUILD.gn | 19 + .../sa/security_component_service.cfg | 24 + .../sa/security_component_service.rc | 19 + .../sa/test/BUILD.gn | 147 ++ .../sa/test/mock/include/access_token.h | 57 + .../sa/test/mock/include/accesstoken_kit.h | 58 + .../sa/test/mock/include/app_mgr_interface.h | 38 + .../include/application_state_observer_stub.h | 73 + .../mock/include/if_system_ability_manager.h | 51 + .../sa/test/mock/include/ipc_mock_skeleton.h | 38 + .../sa/test/mock/include/iservice_registry.h | 33 + .../sa/test/mock/include/mock_app_mgr_proxy.h | 37 + .../mock/include/mock_system_ability_proxy.h | 32 + .../sa/test/mock/include/system_ability.h | 47 + .../sa/test/mock/src/mock_app_mgr_proxy.cpp | 20 + .../sa/test/mock/src/mock_ipc_skeleton.cpp | 20 + .../test/mock/src/mock_iservice_registry.cpp | 34 + .../mock/src/sec_comp_enhance_adapter.cpp | 110 + .../unittest/src/app_state_observer_test.cpp | 179 ++ .../unittest/src/app_state_observer_test.h | 41 + .../unittest/src/sec_comp_entity_test.cpp | 156 ++ .../test/unittest/src/sec_comp_entity_test.h | 42 + .../src/sec_comp_info_helper_test.cpp | 654 ++++++ .../unittest/src/sec_comp_info_helper_test.h | 37 + .../unittest/src/sec_comp_manager_test.cpp | 342 +++ .../test/unittest/src/sec_comp_manager_test.h | 39 + .../src/sec_comp_service_mock_test.cpp | 323 +++ .../unittest/src/sec_comp_service_mock_test.h | 42 + .../unittest/src/sec_comp_service_test.cpp | 271 +++ .../test/unittest/src/sec_comp_service_test.h | 42 + .../test/unittest/src/sec_comp_stub_test.cpp | 177 ++ .../sa/test/unittest/src/sec_comp_stub_test.h | 79 + .../test/unittest/src/service_test_common.cpp | 168 ++ .../test/unittest/src/service_test_common.h | 66 + docs/Readme-CN.md => test/dts/README_zh.md | 41 +- test/dts/location_button.d.ts | 263 +++ test/dts/paste_button.d.ts | 175 ++ test/dts/save_button.d.ts | 239 ++ test/dts/security_component.d.ts | 242 +++ test/fuzztest/security_component/BUILD.gn | 34 + .../BUILD.gn | 49 + .../corpus/init | 14 + .../getenhanceremoteobjectInner_fuzzer.cpp | 49 + .../getenhanceremoteobjectInner_fuzzer.h | 24 + .../project.xml | 25 + .../getenhanceremoteobject_fuzzer/BUILD.gn | 48 + .../getenhanceremoteobject_fuzzer/corpus/init | 14 + .../getenhanceremoteobject_fuzzer.cpp | 41 + .../getenhanceremoteobject_fuzzer.h | 23 + .../getenhanceremoteobject_fuzzer/project.xml | 25 + .../BUILD.gn | 48 + .../corpus/init | 14 + .../getpointereventenhancedata_fuzzer.cpp | 43 + .../getpointereventenhancedata_fuzzer.h | 23 + .../project.xml | 25 + .../BUILD.gn | 49 + .../corpus/init | 14 + .../project.xml | 25 + ...eafterverifysavepermissionInner_fuzzer.cpp | 48 + ...uceafterverifysavepermissionInner_fuzzer.h | 24 + .../BUILD.gn | 48 + .../corpus/init | 14 + .../project.xml | 25 + ...reduceafterverifysavepermission_fuzzer.cpp | 40 + .../reduceafterverifysavepermission_fuzzer.h | 23 + .../BUILD.gn | 49 + .../corpus/init | 14 + .../project.xml | 25 + .../registersecuritycomponentInner_fuzzer.cpp | 51 + .../registersecuritycomponentInner_fuzzer.h | 21 + .../registersecuritycomponent_fuzzer/BUILD.gn | 50 + .../corpus/init | 14 + .../project.xml | 25 + .../registersecuritycomponent_fuzzer.cpp | 43 + .../registersecuritycomponent_fuzzer.h | 21 + .../BUILD.gn | 49 + .../corpus/init | 14 + .../project.xml | 25 + ...ecuritycomponentclickeventInner_fuzzer.cpp | 49 + ...tsecuritycomponentclickeventInner_fuzzer.h | 21 + .../BUILD.gn | 50 + .../corpus/init | 14 + .../project.xml | 25 + ...portsecuritycomponentclickevent_fuzzer.cpp | 51 + ...reportsecuritycomponentclickevent_fuzzer.h | 23 + .../setenhancecfg_fuzzer/BUILD.gn | 49 + .../setenhancecfg_fuzzer/corpus/init | 14 + .../setenhancecfg_fuzzer/project.xml | 25 + .../setenhancecfg_fuzzer.cpp | 41 + .../setenhancecfg_fuzzer.h | 21 + .../BUILD.gn | 49 + .../corpus/init | 14 + .../project.xml | 25 + ...nregistersecuritycomponentInner_fuzzer.cpp | 49 + .../unregistersecuritycomponentInner_fuzzer.h | 21 + .../BUILD.gn | 48 + .../corpus/init | 14 + .../project.xml | 25 + .../unregistersecuritycomponent_fuzzer.cpp | 40 + .../unregistersecuritycomponent_fuzzer.h | 21 + .../BUILD.gn | 49 + .../corpus/init | 14 + .../project.xml | 25 + .../updatesecuritycomponentInner_fuzzer.cpp | 49 + .../updatesecuritycomponentInner_fuzzer.h | 21 + .../updatesecuritycomponent_fuzzer/BUILD.gn | 52 + .../corpus/init | 14 + .../project.xml | 25 + .../updatesecuritycomponent_fuzzer.cpp | 41 + .../updatesecuritycomponent_fuzzer.h | 21 + test/security_component/AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin 0 -> 6790 bytes test/security_component/BUILD.gn | 41 + test/security_component/Test.json | 20 + .../src/main/ets/Application/AbilityStage.ts | 9 + .../src/main/ets/MainAbility/MainAbility.ts | 37 + .../ets/MainAbility/pages/index/index.ets | 56 + .../ets/MainAbility/pages/locationButton.ets | 241 +++ .../MainAbility/pages/locationButton_1.ets | 432 ++++ .../ets/MainAbility/pages/pasteButton.ets | 241 +++ .../main/ets/MainAbility/pages/saveButton.ets | 241 +++ .../ets/MainAbility/pages/saveButton_1.ets | 320 +++ .../src/main/ets/TestAbility/TestAbility.ts | 50 + .../src/main/ets/TestAbility/pages/index.ets | 48 + .../ets/TestRunner/OpenHarmonyTestRunner.ts | 79 + .../entry/src/main/ets/test/List.test.ets | 28 + .../ets/test/LocationComponentTest.test.ets | 1927 +++++++++++++++++ .../ets/test/LocationComponentTest_1.test.ets | 490 +++++ .../main/ets/test/PasteComponentTest.test.ets | 1923 ++++++++++++++++ .../main/ets/test/SaveComponentTest.test.ets | 1926 ++++++++++++++++ .../ets/test/SaveComponentTest_1.test.ets | 358 +++ .../entry/src/main/ets/test/Utils.ets | 118 + .../entry/src/main/module.json | 46 + .../main/resources/base/element/color.json | 12 + .../main/resources/base/element/float.json | 12 + .../main/resources/base/element/string.json | 60 + .../src/main/resources/base/media/icon.png | Bin 0 -> 6790 bytes .../resources/base/profile/main_pages.json | 10 + .../signature/openharmony_sx.p7b | Bin 0 -> 3431 bytes 237 files changed, 24214 insertions(+), 629 deletions(-) create mode 100644 BUILD.gn create mode 100644 LICENSE create mode 100644 README_zh.md create mode 100644 bundle.json create mode 100644 config/BUILD.gn delete mode 100644 docs/arkui-ts/figures/zh-cn_image_0000001593518280.png delete mode 100644 docs/arkui-ts/figures/zh-cn_image_0000001593677984.png delete mode 100644 docs/arkui-ts/figures/zh-cn_image_0000001643038221.png delete mode 100644 docs/arkui-ts/figures/zh-cn_image_0000001643320073.png delete mode 100644 docs/arkui-ts/ts-basic-components-seclocationbutton.md delete mode 100644 docs/arkui-ts/ts-basic-components-secpastebutton.md delete mode 100644 docs/arkui-ts/ts-basic-components-secsavebutton.md delete mode 100644 docs/arkui-ts/ts-universal-attributes-securitycomponent.md delete mode 100644 docs/security/figures/zh-cn_image_0000001566651300.png delete mode 100644 docs/security/security-components-guidelines.md delete mode 100644 docs/security/security-components-overview.md create mode 100644 frameworks/BUILD.gn create mode 100644 frameworks/common/include/sec_comp_err.h create mode 100644 frameworks/common/include/sec_comp_log.h create mode 100644 frameworks/common/include/sec_comp_tool.h create mode 100644 frameworks/common/src/sec_comp_tool.cpp create mode 100644 frameworks/enhance_adapter/include/sec_comp_enhance_adapter.h create mode 100644 frameworks/enhance_adapter/src/sec_comp_enhance_adapter.cpp create mode 100644 frameworks/security_component/include/sec_comp_click_event_parcel.h create mode 100644 frameworks/security_component/src/location_button.cpp create mode 100644 frameworks/security_component/src/paste_button.cpp create mode 100644 frameworks/security_component/src/save_button.cpp create mode 100644 frameworks/security_component/src/sec_comp_base.cpp create mode 100644 frameworks/security_component/src/sec_comp_click_event_parcel.cpp create mode 100644 hisysevent.yaml create mode 100644 interfaces/inner_api/enhance_kits/BUILD.gn create mode 100644 interfaces/inner_api/enhance_kits/include/sec_comp_enhance_kit.h create mode 100644 interfaces/inner_api/enhance_kits/include/sec_comp_enhance_kit_c.h create mode 100644 interfaces/inner_api/enhance_kits/src/sec_comp_enhance_kit.cpp create mode 100644 interfaces/inner_api/enhance_kits/test/BUILD.gn create mode 100644 interfaces/inner_api/enhance_kits/test/unittest/src/sec_comp_enhance_test.cpp create mode 100644 interfaces/inner_api/enhance_kits/test/unittest/src/sec_comp_enhance_test.h create mode 100644 interfaces/inner_api/security_component/BUILD.gn create mode 100644 interfaces/inner_api/security_component/include/i_sec_comp_probe.h create mode 100644 interfaces/inner_api/security_component/include/i_sec_comp_service.h create mode 100644 interfaces/inner_api/security_component/include/location_button.h create mode 100644 interfaces/inner_api/security_component/include/paste_button.h create mode 100644 interfaces/inner_api/security_component/include/save_button.h create mode 100644 interfaces/inner_api/security_component/include/sec_comp_base.h create mode 100644 interfaces/inner_api/security_component/include/sec_comp_caller_authorization.h create mode 100644 interfaces/inner_api/security_component/include/sec_comp_client.h create mode 100644 interfaces/inner_api/security_component/include/sec_comp_death_recipient.h create mode 100644 interfaces/inner_api/security_component/include/sec_comp_info.h create mode 100644 interfaces/inner_api/security_component/include/sec_comp_kit.h create mode 100644 interfaces/inner_api/security_component/include/sec_comp_load_callback.h create mode 100644 interfaces/inner_api/security_component/include/sec_comp_proxy.h create mode 100644 interfaces/inner_api/security_component/include/sec_comp_ui_register.h create mode 100644 interfaces/inner_api/security_component/include/security_component_service_ipc_interface_code.h create mode 100644 interfaces/inner_api/security_component/src/sec_comp_caller_authorization.cpp create mode 100644 interfaces/inner_api/security_component/src/sec_comp_client.cpp create mode 100644 interfaces/inner_api/security_component/src/sec_comp_death_recipient.cpp create mode 100644 interfaces/inner_api/security_component/src/sec_comp_kit.cpp create mode 100644 interfaces/inner_api/security_component/src/sec_comp_load_callback.cpp create mode 100644 interfaces/inner_api/security_component/src/sec_comp_proxy.cpp create mode 100644 interfaces/inner_api/security_component/src/sec_comp_ui_register.cpp create mode 100644 interfaces/inner_api/security_component/test/BUILD.gn create mode 100644 interfaces/inner_api/security_component/test/unittest/src/location_button_test.cpp create mode 100644 interfaces/inner_api/security_component/test/unittest/src/location_button_test.h create mode 100644 interfaces/inner_api/security_component/test/unittest/src/paste_button_test.cpp create mode 100644 interfaces/inner_api/security_component/test/unittest/src/paste_button_test.h create mode 100644 interfaces/inner_api/security_component/test/unittest/src/save_button_test.cpp create mode 100644 interfaces/inner_api/security_component/test/unittest/src/save_button_test.h create mode 100644 interfaces/inner_api/security_component/test/unittest/src/sec_comp_kit_test.cpp create mode 100644 interfaces/inner_api/security_component/test/unittest/src/sec_comp_kit_test.h create mode 100644 interfaces/inner_api/security_component/test/unittest/src/sec_comp_register_callback_test.cpp create mode 100644 interfaces/inner_api/security_component/test/unittest/src/test_common.cpp create mode 100644 interfaces/inner_api/security_component/test/unittest/src/test_common.h create mode 100644 security_component.gni create mode 100644 services/security_component_service/sa/BUILD.gn create mode 100644 services/security_component_service/sa/sa_main/app_mgr_death_recipient.cpp create mode 100644 services/security_component_service/sa/sa_main/app_mgr_death_recipient.h create mode 100644 services/security_component_service/sa/sa_main/app_state_observer.cpp create mode 100644 services/security_component_service/sa/sa_main/app_state_observer.h create mode 100644 services/security_component_service/sa/sa_main/delay_exit_task.cpp create mode 100644 services/security_component_service/sa/sa_main/delay_exit_task.h create mode 100644 services/security_component_service/sa/sa_main/first_use_dialog.cpp create mode 100644 services/security_component_service/sa/sa_main/first_use_dialog.h create mode 100644 services/security_component_service/sa/sa_main/sec_comp_entity.cpp create mode 100644 services/security_component_service/sa/sa_main/sec_comp_entity.h create mode 100644 services/security_component_service/sa/sa_main/sec_comp_info_helper.cpp create mode 100644 services/security_component_service/sa/sa_main/sec_comp_info_helper.h create mode 100644 services/security_component_service/sa/sa_main/sec_comp_manager.cpp create mode 100644 services/security_component_service/sa/sa_main/sec_comp_manager.h create mode 100644 services/security_component_service/sa/sa_main/sec_comp_perm_manager.cpp create mode 100644 services/security_component_service/sa/sa_main/sec_comp_perm_manager.h create mode 100644 services/security_component_service/sa/sa_main/sec_comp_service.cpp create mode 100644 services/security_component_service/sa/sa_main/sec_comp_service.h create mode 100644 services/security_component_service/sa/sa_main/sec_comp_stub.cpp create mode 100644 services/security_component_service/sa/sa_main/sec_comp_stub.h create mode 100644 services/security_component_service/sa/sa_main/sec_event_handler.cpp create mode 100644 services/security_component_service/sa/sa_main/sec_event_handler.h create mode 100644 services/security_component_service/sa/sa_profile/3506.json create mode 100644 services/security_component_service/sa/sa_profile/BUILD.gn create mode 100644 services/security_component_service/sa/security_component_service.cfg create mode 100644 services/security_component_service/sa/security_component_service.rc create mode 100644 services/security_component_service/sa/test/BUILD.gn create mode 100644 services/security_component_service/sa/test/mock/include/access_token.h create mode 100644 services/security_component_service/sa/test/mock/include/accesstoken_kit.h create mode 100644 services/security_component_service/sa/test/mock/include/app_mgr_interface.h create mode 100644 services/security_component_service/sa/test/mock/include/application_state_observer_stub.h create mode 100644 services/security_component_service/sa/test/mock/include/if_system_ability_manager.h create mode 100644 services/security_component_service/sa/test/mock/include/ipc_mock_skeleton.h create mode 100644 services/security_component_service/sa/test/mock/include/iservice_registry.h create mode 100644 services/security_component_service/sa/test/mock/include/mock_app_mgr_proxy.h create mode 100644 services/security_component_service/sa/test/mock/include/mock_system_ability_proxy.h create mode 100644 services/security_component_service/sa/test/mock/include/system_ability.h create mode 100644 services/security_component_service/sa/test/mock/src/mock_app_mgr_proxy.cpp create mode 100644 services/security_component_service/sa/test/mock/src/mock_ipc_skeleton.cpp create mode 100644 services/security_component_service/sa/test/mock/src/mock_iservice_registry.cpp create mode 100644 services/security_component_service/sa/test/mock/src/sec_comp_enhance_adapter.cpp create mode 100644 services/security_component_service/sa/test/unittest/src/app_state_observer_test.cpp create mode 100644 services/security_component_service/sa/test/unittest/src/app_state_observer_test.h create mode 100644 services/security_component_service/sa/test/unittest/src/sec_comp_entity_test.cpp create mode 100644 services/security_component_service/sa/test/unittest/src/sec_comp_entity_test.h create mode 100644 services/security_component_service/sa/test/unittest/src/sec_comp_info_helper_test.cpp create mode 100644 services/security_component_service/sa/test/unittest/src/sec_comp_info_helper_test.h create mode 100644 services/security_component_service/sa/test/unittest/src/sec_comp_manager_test.cpp create mode 100644 services/security_component_service/sa/test/unittest/src/sec_comp_manager_test.h create mode 100644 services/security_component_service/sa/test/unittest/src/sec_comp_service_mock_test.cpp create mode 100644 services/security_component_service/sa/test/unittest/src/sec_comp_service_mock_test.h create mode 100644 services/security_component_service/sa/test/unittest/src/sec_comp_service_test.cpp create mode 100644 services/security_component_service/sa/test/unittest/src/sec_comp_service_test.h create mode 100644 services/security_component_service/sa/test/unittest/src/sec_comp_stub_test.cpp create mode 100644 services/security_component_service/sa/test/unittest/src/sec_comp_stub_test.h create mode 100644 services/security_component_service/sa/test/unittest/src/service_test_common.cpp create mode 100644 services/security_component_service/sa/test/unittest/src/service_test_common.h rename docs/Readme-CN.md => test/dts/README_zh.md (55%) create mode 100644 test/dts/location_button.d.ts create mode 100644 test/dts/paste_button.d.ts create mode 100644 test/dts/save_button.d.ts create mode 100644 test/dts/security_component.d.ts create mode 100644 test/fuzztest/security_component/BUILD.gn create mode 100644 test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/BUILD.gn create mode 100644 test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/corpus/init create mode 100644 test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/getenhanceremoteobjectInner_fuzzer.cpp create mode 100644 test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/getenhanceremoteobjectInner_fuzzer.h create mode 100644 test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/project.xml create mode 100644 test/fuzztest/security_component/getenhanceremoteobject_fuzzer/BUILD.gn create mode 100644 test/fuzztest/security_component/getenhanceremoteobject_fuzzer/corpus/init create mode 100644 test/fuzztest/security_component/getenhanceremoteobject_fuzzer/getenhanceremoteobject_fuzzer.cpp create mode 100644 test/fuzztest/security_component/getenhanceremoteobject_fuzzer/getenhanceremoteobject_fuzzer.h create mode 100644 test/fuzztest/security_component/getenhanceremoteobject_fuzzer/project.xml create mode 100644 test/fuzztest/security_component/getpointereventenhancedata_fuzzer/BUILD.gn create mode 100644 test/fuzztest/security_component/getpointereventenhancedata_fuzzer/corpus/init create mode 100644 test/fuzztest/security_component/getpointereventenhancedata_fuzzer/getpointereventenhancedata_fuzzer.cpp create mode 100644 test/fuzztest/security_component/getpointereventenhancedata_fuzzer/getpointereventenhancedata_fuzzer.h create mode 100644 test/fuzztest/security_component/getpointereventenhancedata_fuzzer/project.xml create mode 100644 test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/BUILD.gn create mode 100644 test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/corpus/init create mode 100644 test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/project.xml create mode 100644 test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/reduceafterverifysavepermissionInner_fuzzer.cpp create mode 100644 test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/reduceafterverifysavepermissionInner_fuzzer.h create mode 100644 test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/BUILD.gn create mode 100644 test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/corpus/init create mode 100644 test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/project.xml create mode 100644 test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/reduceafterverifysavepermission_fuzzer.cpp create mode 100644 test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/reduceafterverifysavepermission_fuzzer.h create mode 100644 test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/BUILD.gn create mode 100644 test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/corpus/init create mode 100644 test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/project.xml create mode 100644 test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/registersecuritycomponentInner_fuzzer.cpp create mode 100644 test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/registersecuritycomponentInner_fuzzer.h create mode 100644 test/fuzztest/security_component/registersecuritycomponent_fuzzer/BUILD.gn create mode 100644 test/fuzztest/security_component/registersecuritycomponent_fuzzer/corpus/init create mode 100644 test/fuzztest/security_component/registersecuritycomponent_fuzzer/project.xml create mode 100644 test/fuzztest/security_component/registersecuritycomponent_fuzzer/registersecuritycomponent_fuzzer.cpp create mode 100644 test/fuzztest/security_component/registersecuritycomponent_fuzzer/registersecuritycomponent_fuzzer.h create mode 100644 test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/BUILD.gn create mode 100644 test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/corpus/init create mode 100644 test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/project.xml create mode 100644 test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/reportsecuritycomponentclickeventInner_fuzzer.cpp create mode 100644 test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/reportsecuritycomponentclickeventInner_fuzzer.h create mode 100644 test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/BUILD.gn create mode 100644 test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/corpus/init create mode 100644 test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/project.xml create mode 100644 test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/reportsecuritycomponentclickevent_fuzzer.cpp create mode 100644 test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/reportsecuritycomponentclickevent_fuzzer.h create mode 100644 test/fuzztest/security_component/setenhancecfg_fuzzer/BUILD.gn create mode 100644 test/fuzztest/security_component/setenhancecfg_fuzzer/corpus/init create mode 100644 test/fuzztest/security_component/setenhancecfg_fuzzer/project.xml create mode 100644 test/fuzztest/security_component/setenhancecfg_fuzzer/setenhancecfg_fuzzer.cpp create mode 100644 test/fuzztest/security_component/setenhancecfg_fuzzer/setenhancecfg_fuzzer.h create mode 100644 test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/BUILD.gn create mode 100644 test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/corpus/init create mode 100644 test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/project.xml create mode 100644 test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/unregistersecuritycomponentInner_fuzzer.cpp create mode 100644 test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/unregistersecuritycomponentInner_fuzzer.h create mode 100644 test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/BUILD.gn create mode 100644 test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/corpus/init create mode 100644 test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/project.xml create mode 100644 test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/unregistersecuritycomponent_fuzzer.cpp create mode 100644 test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/unregistersecuritycomponent_fuzzer.h create mode 100644 test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/BUILD.gn create mode 100644 test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/corpus/init create mode 100644 test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/project.xml create mode 100644 test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/updatesecuritycomponentInner_fuzzer.cpp create mode 100644 test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/updatesecuritycomponentInner_fuzzer.h create mode 100644 test/fuzztest/security_component/updatesecuritycomponent_fuzzer/BUILD.gn create mode 100644 test/fuzztest/security_component/updatesecuritycomponent_fuzzer/corpus/init create mode 100644 test/fuzztest/security_component/updatesecuritycomponent_fuzzer/project.xml create mode 100644 test/fuzztest/security_component/updatesecuritycomponent_fuzzer/updatesecuritycomponent_fuzzer.cpp create mode 100644 test/fuzztest/security_component/updatesecuritycomponent_fuzzer/updatesecuritycomponent_fuzzer.h create mode 100644 test/security_component/AppScope/app.json create mode 100644 test/security_component/AppScope/resources/base/element/string.json create mode 100644 test/security_component/AppScope/resources/base/media/app_icon.png create mode 100644 test/security_component/BUILD.gn create mode 100644 test/security_component/Test.json create mode 100644 test/security_component/entry/src/main/ets/Application/AbilityStage.ts create mode 100644 test/security_component/entry/src/main/ets/MainAbility/MainAbility.ts create mode 100644 test/security_component/entry/src/main/ets/MainAbility/pages/index/index.ets create mode 100644 test/security_component/entry/src/main/ets/MainAbility/pages/locationButton.ets create mode 100644 test/security_component/entry/src/main/ets/MainAbility/pages/locationButton_1.ets create mode 100644 test/security_component/entry/src/main/ets/MainAbility/pages/pasteButton.ets create mode 100644 test/security_component/entry/src/main/ets/MainAbility/pages/saveButton.ets create mode 100644 test/security_component/entry/src/main/ets/MainAbility/pages/saveButton_1.ets create mode 100644 test/security_component/entry/src/main/ets/TestAbility/TestAbility.ts create mode 100644 test/security_component/entry/src/main/ets/TestAbility/pages/index.ets create mode 100644 test/security_component/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts create mode 100644 test/security_component/entry/src/main/ets/test/List.test.ets create mode 100644 test/security_component/entry/src/main/ets/test/LocationComponentTest.test.ets create mode 100644 test/security_component/entry/src/main/ets/test/LocationComponentTest_1.test.ets create mode 100644 test/security_component/entry/src/main/ets/test/PasteComponentTest.test.ets create mode 100644 test/security_component/entry/src/main/ets/test/SaveComponentTest.test.ets create mode 100644 test/security_component/entry/src/main/ets/test/SaveComponentTest_1.test.ets create mode 100644 test/security_component/entry/src/main/ets/test/Utils.ets create mode 100644 test/security_component/entry/src/main/module.json create mode 100644 test/security_component/entry/src/main/resources/base/element/color.json create mode 100644 test/security_component/entry/src/main/resources/base/element/float.json create mode 100644 test/security_component/entry/src/main/resources/base/element/string.json create mode 100644 test/security_component/entry/src/main/resources/base/media/icon.png create mode 100644 test/security_component/entry/src/main/resources/base/profile/main_pages.json create mode 100644 test/security_component/signature/openharmony_sx.p7b diff --git a/BUILD.gn b/BUILD.gn new file mode 100644 index 0000000..1f7cd3c --- /dev/null +++ b/BUILD.gn @@ -0,0 +1,45 @@ +# 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("//build/ohos.gni") + +group("security_component_build_module") { + if (is_standard_system) { + deps = [ + "interfaces/inner_api/enhance_kits:libsecurity_component_enhance_sdk", + "interfaces/inner_api/security_component:libsecurity_component_sdk", + "services/security_component_service/sa:security_component_service", + "services/security_component_service/sa/sa_profile:security_component_sa_profile_standard", + ] + } +} + +group("security_component_build_module_test") { + testonly = true + deps = [] + if (is_standard_system) { + deps += [ + "interfaces/inner_api/enhance_kits/test:unittest", + "interfaces/inner_api/security_component/test:unittest", + "services/security_component_service/sa/test:unittest", + ] + } +} + +group("security_component_build_fuzz_test") { + testonly = true + deps = [] + if (is_standard_system) { + deps += [ "test/fuzztest/security_component:fuzztest" ] + } +} diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..4a45986 --- /dev/null +++ b/LICENSE @@ -0,0 +1,177 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + 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: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) 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 + + (d) 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/README_zh.md b/README_zh.md new file mode 100644 index 0000000..141edb1 --- /dev/null +++ b/README_zh.md @@ -0,0 +1,47 @@ +# 安全控件管理服务 + +## 简介 + +安全控件是OpenHarmony提供的一组系统实现的ArkUI基础组件。当用户点击了这类组件后,应用将被授予临时授权,应用开发者仅需要像使用Button等组件那样集成到应用自己的页面即可。 +安全控件管理服务主要提供如下功能: + +- 提供应用安全控件的注册、临时授权、取消注册等Native接口实现。 +- 负责安全控件的合法性检查,只有合法的安全控件才能授权成功。 +- 提供其他SA查询临时授权的Native接口实现。提供安全增强相关接口及适配层,供厂商定制安全增强功能使用。 + +## 目录 + +``` +/base/security/security_component +├── frameworks # 框架层,基础功能代码存放目录 +│ ├── common # 框架公共代码存放目录 +│ ├── enhance_adapter # 能力增强适配代码存放目录 +│ └── security_component # 安全控件服务框架代码存放目录 +├── interfaces # 接口层 +│ └── inner_api # 内部接口层 +│ ├── enhance_kits # 安全控件配置接口代码存放目录 +│ └── security_component # 安全控件服务接口层代码存放目录 +└── services # 服务层 + └── security_component_service/sa + └── sa_main # 安全控件服务侧代码存放目录 + +``` + +## 使用 +### 接口说明 + +| **接口申明** | **接口描述** | +| --- | --- | +| int32_t RegisterSecurityComponent(SecCompType type, const std::string& componentInfo, int32_t& scId); | 注册安全控件 | +| int32_t UpdateSecurityComponent(int32_t scId, const std::string& componentInfo); | 更新安全控件信息 | +| int32_t UnregisterSecurityComponent(int32_t scId); | 取消注册安全控件 | +| int32_t ReportSecurityComponentClickEvent(int32_t scId, const std::string& componentInfo, const SecCompClickEvent& touchInfo); | 上报点击事件,申请临时授权 | +| int32_t SetEnhanceCfg(uint8_t* cfg, uint32_t cfgLen); | 设置安全控件增强的配置,供多模服务使用 | +| int32_t GetPointerEventEnhanceData(void* data, uint32_t dataLen, uint8_t* enhanceData, uint32_t& enHancedataLen); | 获取点击事件的安全增强数据,供多模服务使用 | +| bool ReduceAfterVerifySavePermission(AccessToken::AccessTokenID tokenId); | 校验后取消保存控件权限 | + +## 相关仓 + +**[arkui\_ace\_engine](https://gitee.com/openharmony/arkui_ace_engine/blob/master/README_zh.md)** + +**[multimodalinput\_input](https://gitee.com/openharmony/multimodalinput_input/blob/master/README_zh.md)** diff --git a/bundle.json b/bundle.json new file mode 100644 index 0000000..f9134f4 --- /dev/null +++ b/bundle.json @@ -0,0 +1,106 @@ +{ + "name": "@openharmony/security_component", + "description": "security_component", + "version": "4.0.0", + "license": "Apache License 2.0", + "publishAs": "code-segment", + "segment": { + "destPath": "base/security/security_component" + }, + "dirs": {}, + "scripts": {}, + "component": { + "name": "security_component", + "subsystem": "security", + "syscap": [], + "hisysevent_config": [ + "//base/security/security_component/hisysevent.yaml" + ], + "features": [ "security_component_feature_coverage = false" ], + "adapted_system_type": [ + "standard" + ], + "rom": "2048KB", + "ram": "5102KB", + "deps": { + "components": [ + "ability_base", + "ability_runtime", + "access_token", + "c_utils", + "eventhandler", + "hilog", + "hisysevent", + "hitrace", + "graphic_2d", + "ipc", + "safwk", + "samgr", + "window_manager" + ], + "third_party": [ + "cJSON", + "googletest" + ] + }, + "build": { + "sub_component": [ + "//base/security/security_component:security_component_build_module" + ], + "inner_kits": [ + { + "name": "//base/security/security_component/interfaces/inner_api/security_component:libsecurity_component_sdk", + "header": { + "header_files": [ + "i_sec_comp_probe.h", + "sec_comp_kit.h" + ], + "header_base": "//base/security/security_component/interfaces/inner_api/security_component/include" + } + }, + { + "name": "//base/security/security_component/interfaces/inner_api/enhance_kits:libsecurity_component_enhance_sdk", + "header": { + "header_files": [ + "sec_comp_enhance_kit.h" + ], + "header_base": "//base/security/security_component/interfaces/inner_api/enhance_kits/include" + } + }, + { + "name": "//base/security/security_component/frameworks:libsecurity_component_framework", + "header": { + "header_files": [ + "location_button.h", + "paste_button.h", + "save_button.h" + ], + "header_base": "//base/security/security_component/interfaces/inner_api/security_component/include" + } + }, + { + "name": "//base/security/security_component/frameworks:libsecurity_component_enhance_adapter", + "header": { + "header_files": [ + "sec_comp_enhance_adapter.h" + ], + "header_base": "//base/security/security_component/frameworks/enhance_adapter/include" + } + }, + { + "name": "//base/security/security_component/services/security_component_service/sa:security_component_service", + "header": { + "header_files": [ + "sec_comp_manager.h" + ], + "header_base": "//base/security/security_component/services/security_component_service/sa/sa_main" + } + } + ], + "test": [ + "//base/security/security_component:security_component_build_module_test", + "//base/security/security_component:security_component_build_fuzz_test" + ] + } + } +} diff --git a/config/BUILD.gn b/config/BUILD.gn new file mode 100644 index 0000000..9cf7554 --- /dev/null +++ b/config/BUILD.gn @@ -0,0 +1,23 @@ +# 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. + +declare_args() { + security_component_feature_coverage = false +} + +config("coverage_flags") { + if (security_component_feature_coverage) { + cflags = [ "--coverage" ] + ldflags = [ "--coverage" ] + } +} diff --git a/docs/arkui-ts/figures/zh-cn_image_0000001593518280.png b/docs/arkui-ts/figures/zh-cn_image_0000001593518280.png deleted file mode 100644 index acaa811077eec62791dcfefd3acfd6fc9f9b18d6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 64148 zcmdpe^-~8Tr|+FJ=S;YYk~9Dj9}x-)3Lq;Zp#}v7Z36}M>C+duk0S`0XYL;xXlFHP zF{tWE!sCyf&z7Q!qEJwEu}Ck*u>W1-D5K*H1%(3sZ-E|iC^dtEdio|SA*$hFc;*ZH zi&DGw?wcKfk$ZSMO+NtXb091T=LI?dbd%pt*3vHcMadDeO@@F@d0s!#HU?=-emz{v zmgQSP)^@6$8JYNxnYS^ z^n(_1o-)pErQW<9TB4$OEU@vQJtVd&p1fJpz}^ZYK+2-g;!DeQ?E(TZgH*ORh0rYY`T+!>mp@Q zzfvzTPrn+Bnl4d&LfrnR^o*{5JcGrB#a%b-FIBEgQdY^8%PyPPfzCm)3Qbn>z2o5S!UvLuSiUP2Wy|vdBu+OQVqEN zCqG>0y|G#`gY)+$>G>vLtL9=mvd+O=Y8%HNK(IBQB*xEPWyjGu>h0SgF#)?|(8##W zW>vwqj3mvtjfHN44P36Ri-|=MSbdd}jo5g^D^Q$~gs;yQ)5a$H{Mv<~MBe9diU88P zxtQ1BiqCbg6_>OUcksQ{fEd7fV}VO{ieA0=C{y-#;m`|f@TS!;#NSouQ&w!pk_~5X zVSZ%cg=l6i|7A$?zi8_YWj9Smnt;A((SfW>mG0nY87S;sgpWq@{BC7^=a@y#ID$8N z+f9O8ts{&+;)N~TZ$AUyw8DGU}pHqGzF10oi#lo4Pa7q3YlR4jzvZ2@a9=W zL!rz571wv)PDs-$KXvR|Bi8p>^h-7RteYAl6x}FKk(pmsPcoqydG%R-5%cq?glc8Y zA1m#35N`{xau6zX7F*xdGWg*=7hXJM#PJil^XPc2Y%la|zj;W>^)-G6_x8JpCq*f!&?I*2t>t$!3IO{ueZ7=tAHf>bu`Ih!qyMHs#tQ& z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L z{H?DwwV~|p_ojPG7E~><)Y*V?PIjtq{k(zzB41*%c_OEGY`!wKR6kBlay$3pRF8AD zd}%C$%Bb#Zhzkw;`!F)Q8KI}Wz0?oVDNc=-sKhN{d`Y@wvHg1)heiO2U$;Ik0=smh zYwU{AY+k?A3q9;V)Nx-b-8pKHd5!sRS&hTiT9sx;$E(*V+T%MXKJdckoD92o_9$un zF&RT*TF{wnwD3I7woK|r~J=7-2Q-soXaV+{3Kg-4k5KeVg|~6$zx*pvJiBw zT_^Lv=k(%-vj^Uu!2G^uHdC}%qnY)s`0!txV$)eUQ){z}lZIY$aAFnblD8-IQMGsv zd3(K=Cw0xdw&Y;%UgmwXHud=OS0)~O;370M#7ve_`6<9ci!*VfvXmupghk7inqMeZ zs_b&^{DVg!)c{|cAcqC~@dqI@C4Qf62TC#z{(6}TLGkQu@Pc)`UFVQ4x-E5COg3vU zcU$`w;W?Oow<$ZoJ5hROX6E+;8*)5{y^X5{oAYry$3fvGop+%8szO$ozSoajb)U z-1&D+7=GnGj(B(;>_?uq@XWAHzg}7Oz^N|*JXiL_QiVExTk2?QUi<$C+%^&z*Pc-J X=!Z|x-<*t~JYVmXG~d=LScU&D(oSF2 diff --git a/docs/arkui-ts/figures/zh-cn_image_0000001593677984.png b/docs/arkui-ts/figures/zh-cn_image_0000001593677984.png deleted file mode 100644 index 41a2510def2bdd21aaa1b6a6d74122d7857b0351..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 26150 zcmb?i^;2Cvv@P!LZWk%VF7EE`R@~j)id?L?ySqbi_Y1`-P~6?!?e&}YC%pGVCdo{) zGdX9ioxRUliBwjULO~=%{PN`sij1_l>c4vE%NGcIc-Vg}C`O&Ae-(tQs+8!L+9~4W ze;sH`5e1PiUmD_&-i%@X^%0z;bzHxEK^^?BK#Vw+n|=9W-YFw4qV8pI?hhA8t&wqG zac6SKoyI zbQn;v^JA*!qCi4;ICs&p<8(s3*GJ>N(qa8Ihk4D48k*H?)W}H5-(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6e?O2Fd%6rohHoYm+oL$bOtR7g1CP_pdcceAz2a<~hTfgGpCTGiHO~!JSoT zUAlsYh=vMFwjs^9fow95^ysbJLC+m{X$m*qU8e6X3ZE4vU-l_SIKF!g{C_Pb`G2TA d@ql{#xYZhyPK4L`U-8R-vXV*?HDV@#{|6shq22%h diff --git a/docs/arkui-ts/figures/zh-cn_image_0000001643038221.png b/docs/arkui-ts/figures/zh-cn_image_0000001643038221.png deleted file mode 100644 index 21409ff9b6699683e2aba8dbbee453ca87defc6b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 26031 zcmcFpV|yjf)6Q<}jgu4Gwr$&XPHfw@ZDV6??3~zkvdPBT7|;Ix-{E;NJ>7FnT|HCX z)pgfh6{Vygi3kUP0|Ns?l$H`x0R#I+_OB0uf%?~?j3A=^yM1#}krV-|pTYb6ZvbH_ zEH4ZO)|3GMZVdTv4C^SR?E(gdH1yx~ZOoz43=GU%Oj=A>&C}qr7rIbiJ&XUBLhs+d zWQ?%H#6=l_YGp7~YuJ$8q-{7&v83l~k|P4sm8=}De|kUbhzcvIdfVrSg-}Iar!KBn zRKI|iZv+rQFDMi8JF+t}Gu@~8Kd%Me{`5Y+y1%rgp^hgKi-uc+`P{LJh9ls(bFqj_ zCK3;|2un!eu$X0XjKfg>d%g&TLu@{tXuLs0T8e`)aeUcvqvg5`NM{m{H$ z^z1IKLeiVBfs0{(AGbk8^S3^qp2%BG?03^m;so~Ry1(6ZyHwd9sn=5~c&_6@*V={; zZ4dqw7f)59IBftNVmsDK?3kp~q^!p2DVoy3r3#itxGv#Ixq37@Fp9$px_6DRx9KD4 zSyCMD^UE8bL7~gcEQ8aI0-bmMWV9)QB9Y<2G`XKy++%*=7`4>QawLadye9>e2oX-w zp1qyNQG?Rh@vY)q%tP}oa$%~c={~6Y!w6%>Tw8uzcmizF2e(7}y&IgT1k^9oum;u* zl3uo4T?(`RBqkqKo!UDce)Chsli`skGQAWPFo)LYVl0uh0CRv3n{aBl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bb&Tw=IBxviB)w(u$4L9(bmY4l4@vueOLPi4&J!0 zjK3Q^QOP{~mV$tZxQ+&)yte{VCr54e&i*=b3Bel~hi{n6MQ(doAKH!kEn0 zH?{0kL-OEh!w1TcVb^+Vrv9H83cO2np*!h`qLP1?h(dQ*sou^PZs;oM`obyLsDM5? zf~pFWvh&EicSaSipjrHZ*LdbJdH}&x81MfRM_NZiWss^$p*9{Ktz-j~mI2%ux{ZCc zktL1|bk1f~y?f@{SF{L;zH>z7hLB%W34|n?IlPt#8%PD@S8rp;tmXW)aOY+T-Y!sk z7ZMX_aa8{k098P2KP}V}T5av{7mkON27gW$9V4tjOabUAz$Q)2S#j38wST`iwP*dE zdcWQOCu@YAu||-U!5lNJfmf+wk3+L_oLbqVFh|(aqwpP|hdWPlZn1pBDTF8l7Ym3L z*OQ}^6wg9Dld=`evU9wz_GpOWH|h!xW9lii07Ow!#EDgmhW~#*NcR1^*A^{BAavy6ra%85K~YWC diff --git a/docs/arkui-ts/figures/zh-cn_image_0000001643320073.png b/docs/arkui-ts/figures/zh-cn_image_0000001643320073.png deleted file mode 100644 index a9d96dcb1c6082a329f87126d5dbc6678b2a3e41..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 24287 zcmc$FQ+sAju=d2xBv0&2Y}>Z&iEU@1iEZ0YY))+3wr%6fyZ2An2j9WEdeuSqs#Vq1 zU3b^rVG45M2(Z|&KYsi`kdzQn`flfc`~V?@hWvgTFVijfZa|!r#D#uTP2!$>3*csg zvVuQ;)W*QQ8$f)^F!mCfPCtGi_Wk#O4B3?!|M;QjEGZ(W;;wh$4V8;$lJ>~_(6E-U zt^$DWprAUd_J`2*)U7pI`xw}0tp3yoK~_-_Id3hePHwDeT0nz4UPV(^6ag;;2LNUh z*5tEZ`KQ>QNI(D(JpZ1uJ&z<0v(q@8OgmpXpFGCYD-#8xaXGm_Jztr{qjB*B9WOgSG7z$bWL{} z=$g}34!M&@c)Ht(6ZL={jiP?e+Yz@EvPh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4IU=6)|89i(u(svKUwfE4YR@?%<7uXrBc z$3?<%9bf(Oi8>H2k`k(>qqYEqHY2(hpFAZ0)j1NiwKIS|ld>db%DodR4r*!P+s2g# zB+3&->An;`Us0t2C<;kf#E0RTHd88*O$i=b#wdVc92c9~wXR9fDkD$sEp2?3YuUEc zUzT?sFh0E~(yzK0%^~&>1;k!2N@UvgAH{FWs5Z>vI<0hUvYtj>kRNL9ZN|A9UV>@p zG~8UfmV}MFYNL|kP0#3m9G*?}9}_pf8-YUqODlYn-q(GkZ+FfXIWU(JSn-jT0HkbJ zFg04OFk57G2e+56!UW8GXwPN~X$Y*3$red4=RbSh_*nOGPp^umWGH7>4Br>gR%PhP zR2u5>dcc*vaJMyc#Q(D3y8GSFI3Wuk5hZJ9o}kRyQSI{e3L_wx$5b8j118%P)pSkg++?^YJg8 zLmo7qUgxIN;Gp`e?_aIDta-NK>2g-qY3XqI`!GjbH#D9OHAH7zjSdA6wJmk!WMW}% z1aQGIHGR@ebBsJmvZ7|SpnV<7JgLCmkwOCx{D25ZkM<7{EFHAbO#nlNu#2xCM1zES z{W2m(Gs`YUFmKEeQ!ZCL7TMDj>q-l-Ksupy2mn)}j8esx--kEM)5)bcyrMrgPG`@< z)FP&oZ>{lz!-*LXK#1`O4a(*?^496(@CMoU$Q$x(=qUJ_jtb z-H~sovr~cn_%5VhYGde=K6p<4j*_L;u;d8fXB<)D^8KdCSg0`SB*%~x diff --git a/docs/arkui-ts/ts-basic-components-seclocationbutton.md b/docs/arkui-ts/ts-basic-components-seclocationbutton.md deleted file mode 100644 index dbea7b3..0000000 --- a/docs/arkui-ts/ts-basic-components-seclocationbutton.md +++ /dev/null @@ -1,137 +0,0 @@ -# LocationButton - - -安全组件的位置按钮,用户通过点击该位置按钮,可以临时获取精准定位权限,而不需要权限弹框授权确认。 - - -> **说明:** -> -> 该组件从API Version 10开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 - - -## 子组件 - -不支持。 - - -## 接口 - -**方法1:** LocationButton() - -默认创建带有图标、文本、背景的位置按钮。 - -**方法2:** LocationButton(option:{icon?: LocationIconStyle, text?: LocationDescription, buttonType?: ButtonType}) - -创建包含指定元素的位置按钮。 - -**参数:** - -| 参数名 | 参数类型 | 必填 | 参数描述 | -| -------- | -------- | -------- | -------- | -| icon | [LocationIconStyle](#locationiconstyle枚举说明) | 否 | 设置位置按钮的图标风格
不传入该参数表示没有图标,icon和text至少存在一个。 | -| text | [LocationDescription](#locationdescription枚举说明) | 否 | 设置位置按钮的文本描述
不传入该参数表示没有文字描述,icon和text至少存在一个。 | -| buttonType | [ButtonType](ts-basic-components-button.md#ButtonType枚举说明) | 否 | 设置位置按钮的背景样式
不传入该参数表示没有背景。 | - - -## LocationIconStyle枚举说明 - -| 名称 | 描述 | -| -------- | -------- | -| FULL_FILLED | 位置按钮展示填充样式图标。 | -| LINES | 位置按钮展示线条样式图标。 | - - -## LocationDescription枚举说明 - -| 名称 | 描述 | -| -------- | -------- | -| CURRENT_LOCATION | 位置按钮的文字描述为“当前位置”。 | -| ADD_LOCATION | 位置按钮的文字描述为“添加位置”。 | -| SELECT_LOCATION | 位置按钮的文字描述为“选择位置”。 | -| SHARE_LOCATION | 位置按钮的文字描述为“共享位置”。 | -| SEND_LOCATION | 位置按钮的文字描述为“发送位置”。 | -| LOCATING | 位置按钮的文字描述为“定位”。 | -| LOCATION | 位置按钮的文字描述为“位置”。 | -| SEND_CURRENT_LOCATION | 位置按钮的文字描述为“发送实时位置”。 | -| RELOCATION | 位置按钮的文字描述为“重定位”。 | -| PUNCH_IN | 位置按钮的文字描述为“打卡定位”。 | -| CURRENT_POSITION | 位置按钮的文字描述为“所在位置”。 | - - -## LocationButtonOnClickResult枚举说明 - -| 名称 | 描述 | -| -------- | -------- | -| SUCCESS | 位置按钮点击成功。 | -| TEMPORARY_AUTHORIZATION_FAILED | 位置按钮点击后位置权限授权失败。 | - - -## 属性 - -不支持通用属性,仅继承[安全组件通用属性](ts-universal-attributes-securitycomponent.md#属性)。 - - -## 事件 - -不支持通用事件,仅支持以下事件: - -| 名称 | 功能描述 | -| -------- | -------- | -| onClick(event: (event: [ClickEvent](ts-universal-events-click.md#clickevent对象说明)), result: [LocationButtonOnClickResult](#locationbuttononclickresult枚举说明)) => void) | 点击动作触发该回调。
result:位置权限的授权结果。
event:见ClickEvent对象说明。 | - - -## 示例 - -``` -// xxx.ets -@Entry -@Component -struct Index { - build() { - Row() { - Column({space:10}) { - // 默认位置按钮 - LocationButton() - // 生成默认位置按钮,包含图标+文字+背景 - LocationButton() - .fontSize(35) - .fontColor(Color.White) - .iconSize(30) - .layoutDirection(SecurityComponentLayoutDirection.HORIZONTAL) - .borderWidth(1) - .borderStyle(BorderStyle.Dashed) - .borderColor(Color.Blue) - .borderRadius(20) - .fontWeight(100) - .iconColor(Color.White) - .padding({ left: 50, top: 50, bottom: 50, right: 50 }) - .textIconSpace(20) - .backgroundColor(0x3282f6) - .onClick((event: ClickEvent, result: LocationButtonOnClickResult)=>{ - console.error("result " + result) - }) - // 生成定制图标、文字、背景的位置按钮 - LocationButton({icon:LocationIconStyle.LINES, text:LocationDescription.CURRENT_POSITION, buttonType:ButtonType.Normal}) - .fontSize(35) - .fontColor(0x3282f6) - .iconSize(30) - .layoutDirection(SecurityComponentLayoutDirection.VERTICAL) - .borderWidth(1) - .borderStyle(BorderStyle.Dashed) - .borderColor(0x9ffcfd) - .borderRadius(20) - .fontWeight(100) - .iconColor(0x3282f6) - .padding({left:50, top:50, bottom:50, right:50}) - .textIconSpace(20) - .backgroundColor(0x9ffcfd) - .onClick((event: ClickEvent, result: LocationButtonOnClickResult)=>{ - console.error("result " + result) - }) - }.width('100%') - }.height('100%') - } -} -``` - -![zh-cn_image_0000001593518280](figures/zh-cn_image_0000001593518280.png) diff --git a/docs/arkui-ts/ts-basic-components-secpastebutton.md b/docs/arkui-ts/ts-basic-components-secpastebutton.md deleted file mode 100644 index 5eb67a3..0000000 --- a/docs/arkui-ts/ts-basic-components-secpastebutton.md +++ /dev/null @@ -1,96 +0,0 @@ -# PasteButton - - -安全组件的粘贴按钮,用户通过点击该粘贴按钮,可以临时获取读取剪贴板权限,而不会触发toast提示。 - - -> **说明:** -> -> 该组件从API Version 10开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 - - -## 子组件 - -不支持。 - - -## 接口 - -**方法1:** PasteButton() - -默认创建带有图标、文本、背景的粘贴按钮。 - -**方法2:** PasteButton(option:{icon?: PasteIconStyle, text?: PasteDescription, buttonType?: ButtonType}) - -创建包含指定元素的粘贴按钮。 - -**参数:** - -| 参数名 | 参数类型 | 必填 | 参数描述 | -| -------- | -------- | -------- | -------- | -| icon | [PasteIconStyle](#pasteiconstyle枚举说明) | 否 | 设置粘贴按钮的图标风格。
不传入该参数表示没有图标,icon和text至少存在一个。 | -| text | [PasteDescription](#pastedescription枚举说明) | 否 | 设置粘贴按钮的文本描述。
不传入该参数表示没有文字描述,icon和text至少存在一个。 | -| buttonType | [ButtonType](ts-basic-components-button.md#ButtonType枚举说明) | 否 | 设置粘贴按钮的背景样式。
不传入该参数表示没有背景。 | - - -## 属性 - -不支持通用属性,仅继承[安全组件通用属性](ts-universal-attributes-securitycomponent.md#属性)。 - - -## PasteIconStyle枚举说明 - -| 名称 | 描述 | -| -------- | -------- | -| LINES | 粘贴按钮展示线条样式图标。 | - - -## PasteDescription枚举说明 - -| 名称 | 描述 | -| -------- | -------- | -| PASTE | 粘贴按钮的文字描述为“粘贴”。 | - - -## PasteButtonOnClickResult枚举说明 - -| 名称 | 描述 | -| -------- | -------- | -| SUCCESS | 粘贴按钮点击成功。 | -| TEMPORARY_AUTHORIZATION_FAILED | 粘贴按钮点击后权限授权失败。 | - - -## 事件 - -不支持通用事件,仅支持以下事件: - -| 名称 | 功能描述 | -| -------- | -------- | -| onClick(event: (event: [ClickEvent](ts-universal-events-click.md#clickevent对象说明)), result: [PasteButtonOnClickResult](#pastebuttononclickresult枚举说明)) => void) | 点击动作触发该回调。
result:剪贴板权限的授权结果,授权后可以读取当前剪贴板内容,如果内容发生变化再次读取仍需授权。
event:见ClickEvent对象说明。 | - - -## 示例 - -``` -// xxx.ets -@Entry -@Component -struct Index { - build() { - Row() { - Column({space:10}) { - // 默认参数下,图标、文字、背景都存在 - PasteButton() - // 传入参数即表示元素存在,不传入的参数表示元素不存在,例如:只显示图标 - PasteButton({icon:PasteIconStyle.LINES}) - // 只显示图标+背景 - PasteButton({icon:PasteIconStyle.LINES, buttonType:ButtonType.Capsule}) - // 图标、文字、背景都存在 - PasteButton({icon:PasteIconStyle.LINES, text:PasteDescription.PASTE, buttonType:ButtonType.Capsule}) - }.width('100%') - }.height('100%') - } -} -``` - -![zh-cn_image_0000001593677984](figures/zh-cn_image_0000001593677984.png) diff --git a/docs/arkui-ts/ts-basic-components-secsavebutton.md b/docs/arkui-ts/ts-basic-components-secsavebutton.md deleted file mode 100644 index dc0e1ba..0000000 --- a/docs/arkui-ts/ts-basic-components-secsavebutton.md +++ /dev/null @@ -1,104 +0,0 @@ -# SaveButton - - -安全组件的保存按钮,用户通过点击该保存按钮,可以临时获取存储权限,而不需要权限弹框授权确认。 - - -> **说明:** -> -> 该组件从API Version 10开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 - - -## 子组件 - -不支持。 - - -## 接口 - -**方法1:** SaveButton() - -默认创建带有图标、文本、背景的保存按钮。 - -**方法2:** SaveButton(option:{icon?: SaveIconStyle, text?: SaveDescription, buttonType?: ButtonType}) - -创建包含指定元素的保存按钮。 - -**参数:** - -| 参数名 | 参数类型 | 必填 | 参数描述 | -| -------- | -------- | -------- | -------- | -| icon | [SaveIconStyle](#saveiconstyle枚举说明) | 否 | 设置保存按钮的图标风格
不传入该参数表示没有图标,icon和text至少存在一个。 | -| text | [SaveDescription](#savedescription枚举说明) | 否 | 设置保存按钮的文本描述
不传入该参数表示没有文字描述,icon和text至少存在一个。 | -| buttonType | [ButtonType](ts-basic-components-button.md#ButtonType枚举说明) | 否 | 设置保存按钮的背景样式
不传入该参数表示没有背景。 | - - -## SaveIconStyle枚举说明 - -| 名称 | 描述 | -| -------- | -------- | -| FULL_FILLED | 保存按钮展示填充样式图标。 | -| LINES | 保存按钮展示线条样式图标。 | - - -## SaveDescription枚举说明 - -| 名称 | 描述 | -| -------- | -------- | -| DOWNLOAD | 保存按钮的文字描述为“下载”。 | -| DOWNLOAD_FILE | 保存按钮的文字描述为“下载文件”。 | -| SAVE | 保存按钮的文字描述为“保存”。 | -| SAVE_IMAGE | 保存按钮的文字描述为“保存图片”。 | -| SAVE_FILE | 保存按钮的文字描述为“保存文件”。 | -| DOWNLOAD_AND_SHARE | 保存按钮的文字描述为“下载分享”。 | -| RECEIVE | 保存按钮的文字描述为“接收”。 | -| CONTINUE_TO_RECEIVE | 保存按钮的文字描述为“继续接收”。 | - - -## SecSaveButtonOnClickResult枚举说明 - -| 名称 | 描述 | -| -------- | -------- | -| SUCCESS | 保存按钮点击成功。 | -| TEMPORARY_AUTHORIZATION_FAILED | 保存按钮点击后权限授权失败。 | - - -## 属性 - -不支持通用属性,仅继承[安全组件通用属性](ts-universal-attributes-securitycomponent.md#属性)。 - - -## 事件 - -不支持通用事件,仅支持以下事件: - -| 名称 | 功能描述 | -| -------- | -------- | -| onClick(event: (event: [ClickEvent](ts-universal-events-click.md#clickevent对象说明)), result: [SaveButtonOnClickResult](#secsavebuttononclickresult枚举说明)) => void) | 点击动作触发该回调。
result:存储权限的授权结果,授权方式为5秒单次,即触发点击后,可以在5秒中之内调用媒体库接口一次,超出5秒或者调用次数超出一次都会鉴权失败。
event:见ClickEvent对象说明。 | - - -## 示例 - -``` -// xxx.ets -@Entry -@Component -struct Index { - build() { - Row() { - Column({space:10}) { - // 默认参数下,图标、文字、背景都存在 - SaveButton() - // 传入参数即表示元素存在,不传入的参数表示元素不存在,例如:只显示图标 - SaveButton({icon:SaveIconStyle.FULL_FILLED}) - // 只显示图标+背景 - SaveButton({icon:SaveIconStyle.FULL_FILLED, buttonType:ButtonType.Capsule}) - // 图标、文字、背景都存在 - SaveButton({icon:SaveIconStyle.FULL_FILLED, text:SaveDescription.DOWNLOAD, buttonType:ButtonType.Capsule}) - }.width('100%') - }.height('100%') - } -} -``` - -![zh-cn_image_0000001643320073](figures/zh-cn_image_0000001643320073.png) diff --git a/docs/arkui-ts/ts-universal-attributes-securitycomponent.md b/docs/arkui-ts/ts-universal-attributes-securitycomponent.md deleted file mode 100644 index 1c0a867..0000000 --- a/docs/arkui-ts/ts-universal-attributes-securitycomponent.md +++ /dev/null @@ -1,76 +0,0 @@ -# 安全组件通用 - - -安全组件的基础属性,用于设置安全组件通用的属性。 - - -> **说明:** -> -> 该组件从API Version 10开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 - - -## 属性 - -| 名称 | 参数类型 | 必填 | 描述 | -| -------- | -------- | -------- | -------- | -| iconSize | [Dimension](ts-types.md#dimension10) | 否 | 设置安全组件上图标的尺寸。
默认值:16vp | -| layoutDirection | [SecurityComponentLayoutDirection](#securitycomponentlayoutdirection枚举说明) | 否 | 设置安全组件上图标和文字分布的方向。
默认值:SecurityComponentLayoutDirection.HORIZONTAL | -| position | [Position](ts-types.md#position8) | 否 | 设置绝对定位,设置安全组件的左上角相对于父容器左上角的偏移位置。
默认值:
{
x: 0,
y: 0
} | -| markAnchor | [Position](ts-types.md#position8) | 否 | 设置安全控件在位置定位时的锚点,以控件左上角作为基准点进行偏移。通常配合position和offset属性使用,单独使用时,效果类似offset
默认值:
{
x: 0,
y: 0
} | -| offset | [Position](ts-types.md#position8) | 否 | 设置相对定位,安全组件相对于自身的偏移量。
默认值:
{
x: 0,
y: 0
} | -| fontSize | [Dimension](ts-types.md#dimension10) | 否 | 设置安全组件上文字的尺寸。
默认值:16fp | -| fontStyle | [FontStyle](ts-appendix-enums.md#fontstyle) | 否 | 设置安全组件上文字的样式。
默认值:FontStyle.Normal | -| fontWeight | number \| [FontWeight](ts-appendix-enums.md#fontweight) \| string | 否 | 设置安全组件上文字粗细。
默认值:FontWeight.Medium | -| fontFamily | string \| [Resource](ts-types.md#resource) | 否 | 设置安全组件上文字的字体。
默认字体:'HarmonyOS Sans' | -| fontColor | [ResourceColor](ts-types.md#resourcecolor) | 否 | 设置安全组件上文字的颜色。
默认值:\#ffffffff | -| iconColor | [ResourceColor](ts-types.md#resourcecolor) | 否 | 设置安全组件上图标的颜色。
默认值:\#ffffffff | -| backgroundColor | [ResourceColor](ts-types.md#resourcecolor) | 否 | 设置安全组件的背景颜色。
默认值:\#007dff | -| borderStyle | [BorderStyle](ts-appendix-enums.md#borderstyle) | 否 | 设置安全组件的边框的样式。
默认不设置边框样式 | -| borderWidth | [Dimension](ts-types.md#dimension10) | 否 | 设置安全组件的边框的宽度。
默认不设置边框宽度 | -| borderColor | [ResourceColor](ts-types.md#resourcecolor) | 否 | 设置安全组件的边框的颜色。
默认不设置边框颜色 | -| borderRadius | [Dimension](ts-types.md#dimension10) | 否 | 设置安全组件的边框圆角半径。
默认值:1/2 按钮整高 | -| padding | [Padding](ts-types.md#padding) \| [Dimension](ts-types.md#dimension10) | 否 | 设置安全组件的内边距。
默认值:上下8vp, 左右24vp | -| textIconSpace | [Dimension](ts-types.md#dimension10) | 否 | 设置安全组件中图标和文字的间距。
默认值:4vp | - - -## SecurityComponentLayoutDirection枚举说明 - -| 名称 | 描述 | -| -------- | -------- | -| HORIZONTAL | 安全组件上图标和文字分布的方向为水平排列。 | -| VERTICAL | 安全组件上图标和文字分布的方向为垂直排列。 | - - -## 示例 - -```ts -// xxx.ets -@Entry -@Component -struct Index { - build() { - Row() { - Column() { - // 生成一个保存按钮,并设置它的SecurityComponent属性 - SecSaveButton() - .fontSize(35) - .fontColor(Color.White) - .iconSize(30) - .layoutDirection(SecurityComponentLayoutDirection.HORIZONTAL) - .layoutOrder(SecurityComponentLayoutOrder.TEXT_FIRST) - .borderWidth(1) - .borderStyle(BorderStyle.Dashed) - .borderColor(Color.Blue) - .borderRadius(20) - .fontWeight(100) - .iconColor(Color.White) - .padding({left:50, top:50, bottom:50, right:50}) - .textIconSpace(20) - .backgroundColor(0x3282f6) - }.width('100%') - }.height('100%') - } -} -``` - -![zh-cn_image_0000001643038221](figures/zh-cn_image_0000001643038221.png) diff --git a/docs/security/figures/zh-cn_image_0000001566651300.png b/docs/security/figures/zh-cn_image_0000001566651300.png deleted file mode 100644 index dc5b9c4a7287896dd6a5513ca0e90a09100328a4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 72286 zcmagGbyQSg+b;}Arwk(9HH36ZBOnYll!(&ZAl*m{2nY-!J<=s1N{4{bf|Nstlyo-( z-yZdO-uGMUoOS+SF|+p_dtdpx;+`0&=3^p!YJ4;_G$K_MMIAIWOc)v(MjS3S8X7tR z`KuVXf$pL6SOKkah;{?`f@v$SA&-VulSpuFjs<+jb5k+&KtrP-Mg5`ovmeQ#q1_g$ zD$48mnrtJTtM4O%)(FJA@x%>q~dDVszuZ<-%kTejy>45Wy<- zE{Uf?-uz9}iyvQAuHNz(awa4!_2NjbX-5$EhBDnV zMJgD6Tjl`cw^QxMip*QX2h#Y;O*tRSp0f3;^E;hvPT*6CX}C+LSBK8jyZR7si7ho* zaUlf97_&ZKO8Xz%=|!bD^}{$j#!Gee+q2|2G_#-_(;w>RspB)*kJU5!9_6%QJ6e*7 zNr}jGeI7J1{A8zn&$?5obRk>Pr;Mzdc6gV8nmYER7)y)&`^x)a%}VRHL^vrPE$ zeU&t&S zy=;3r@hEQw0tQV?p0ym0s&S1y@BwuyajjS>oF&jnhJDWz!-*!Qi`A^-+5ctL6g1^- z>-TnY=JlQ2BJAiM-rt&R0eCGzr6brg+nZ4p!$E*R;#uE%z;B=EFVBO0HdkGpbdsxRGMO(g}0N4rmx zLzf%1z-Vorb9&g1t5tOO>abuqRArxzzlIWXC`*EjR?=Hty^vT(F&D1&GgseM2Q1yB`%3wh`dv*P&*2Oa?#a)NXq+maq=C zOY@HCDh)JT<9&Nt3f^ba2s{3en`^V~*HmQ;H&_al*55NkIvlH7i!PlXTn$ax8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nm*;T_d4!)+NrW87;OAy5uIHab57wMaDs#?iplu3RpJ-FWc70E5K-d;kCd diff --git a/docs/security/security-components-guidelines.md b/docs/security/security-components-guidelines.md deleted file mode 100644 index c173f6b..0000000 --- a/docs/security/security-components-guidelines.md +++ /dev/null @@ -1,128 +0,0 @@ -# 安全组件开发指导 - - -## 场景介绍 - -安全组件是OpenHarmony提供的一组系统实现的ArkUI基础组件,应用集成这类组件就可以实现在用户点击后自动授权,而无需弹窗授权。 - -目前有三类安全组件,分别是位置组件(LocationButton)、粘贴组件(PasteButton)、保存组件(SaveButton),分别对应精准定位、剪贴板读取、媒体库写入三类特权,下面分别说明这三种使用场景。 - -- 位置组件(LocationButton) - -应用集成位置组件后,用户点击该组件,不管应用有没有申请过或者授予精准定位权限,都会在本次前台期间获得精准定位的授权,可以调用位置服务获取精准定位。精准定位的临时授权会持续到灭屏、应用切后台、应用退出等任一情况发生,之后恢复到临时授权之前的授权状态(授予/未授予/未申请)。应用在授权期间没有调用特权接口的次数限制。 - -使用场景:应用本身不是强位置关联应用(如导航、运动健康等),仅在"部分场景前台"需要使用位置信息(如:定位城市、打卡、分享位置等),如果需要长时间或者后台使用位置信息,建议申请权限。 - -- 粘贴组件(PasteButton) - -应用集成粘贴组件后,用户点击该组件,应用读取剪贴板数据时不会弹出toast提示,直到新的数据被写入剪贴板为止(如用户复制了新的数据),灭屏、应用切后台、应用退出不影响授权,应用在授权期间没有次数限制。 - -使用场景:粘贴组件可以用于任何应用需要读取剪贴板的场景,避免toast提示对用户造成干扰。 - -- 保存组件(SaveButton) - -应用集成保存组件后,用户点击该组件,应用会获取5秒内单次访问媒体库特权接口的授权。 - -开发者需要注意两点: - -1. 应用在onClick()触发回调到调用媒体库特权接口的时间间隔不大于5秒。 - -2. 用户点击一次仅获取一次授权调用,应用如需要创建多个文件,需要使用单次创建多文件接口。 - -3. 使用场景:保存组件可以用于任何应用需要保存文件到媒体库的场景(下载、保存图片、保存文档、保存音视频等),区别于使用filepicker方式(filepicker需要拉起系统应用,再由用户选择具体路径保存文件),安全组件操作更快捷。 - - -## 创建方式 - -安全组件是由图标(icon)、文本(text)、背景(buttonType)组成的类似button的按钮,其中图标、文本两者至少有其一,背景是可选的。图标和文本不支持自定义,仅支持在已有的选项中选择。应用申明安全组件的接口时,分为传参和不传参两种,不传参默认创建图标+文字+背景的按钮,传参根据传入的参数创建,不包含没有配置的元素。 - -例如保存组件: - -``` -/* 默认样式 */ -SaveButton() - -/* 自定义样式 icon、text、buttonType都是可选项,配置即存在,不配置即不存在*/ -SaveButton(options: SaveButtonOptions) - -/* 只有图标的样式 */ -SaveButton({ icon:SaveIconStyle.FULL_FILLED }) - -/* 只有文字和图标的样式 */ -SaveButton({ icon:SaveIconStyle.FULL_FILLED, text:SaveDescription.DOWNLOAD }) -``` - - -## 公共属性 - -安全组件有公共的UX属性,应用可以通过这些属性定制样式。 - -| 属性名 | 描述 | -| -------- | -------- | -| iconSize(value: Dimension) | 设置安全组件的图标尺寸 | -| layoutDirection(value: SecurityComponentLayoutDirection) | 设置安全组件上图标和文字分布的方向 | -| position(value: Position) | 设置绝对定位 | -| markAnchor(value: Position) | 设置绝对定位的锚点 | -| offset(value: Position) | 设置相对定位 | -| fontSize(value: Dimension) | 设置安全组件上的文字尺寸 | -| fontStyle(value: FontStyle) | 设置安全组件上的文字样式 | -| fontWeight(value: number \| FontWeight \| string) | 设置安全组件上文字粗细 | -| fontFamily(value: string \| Resource) | 设置安全组件上文字的字体 | -| fontColor(value: ResourceColor) | 设置安全组件上文字颜色 | -| iconColor(value: ResourceColor) | 设置安全组件上图标颜色 | -| backgroundColor(value: ResourceColor) | 设置安全组件的背景颜色 | -| borderStyle(value: BorderStyle) | 设置安全组件边框的样式 | -| borderWidth(value: Dimension) | 设置安全组件边框的宽度 | -| borderColor(value: ResourceColor) | 设置安全组件的边框颜色 | -| borderColor(value: ResourceColor) | 设置安全组件的边框圆角半径 | -| padding(value: Padding \| Dimension) | 设置安全组件的内边距 | -| textIconSpace(value: Dimension) | 设置安全组件中图标和文字的间距 | - - -## 开发步骤 - -1. ets文件中声明安全组件。 - ``` - LocationButton() - ``` - -2. 配置安全组件的属性。 - ``` - LocationButton().iconSize(15.0) - ``` - -3. 注册onCLick回调,回调中调用特权接口,以位置组件为例,获取定位信息。 - ``` - import geoLocationManager from '@ohos.geoLocationManager'; - @Entry - @Component - struct locationButton { - build() { - Row() { - Column() { - LocationButton({ icon: LocationIconStyle.FULL_FILLED }).iconSize(15.0) - .onClick((event: ClickEvent, result: LocationButtonOnClickResult) => { - if (result == LocationButtonOnClickResult.SUCCESS) { - /* 示例接口来自js-apis-geoLocationManager.md#currentlocationrequest */ - let requestInfo = { 'priority': 0x203, 'scenario': 0x300, 'maxAccuracy': 0 }; - let locationChange = (err, location) => { - if (err) { - console.log('locationChanger: err=' + JSON.stringify(err)); - } - if (location) { - console.log('locationChanger: location=' + JSON.stringify(location)); - } - }; - - try { - geoLocationManager.getCurrentLocation(requestInfo, locationChange); - } catch (err) { - console.error("errCode:" + err.code + ",errMessage:" + err.message); - } - } - }) - } - } - } - } - ``` diff --git a/docs/security/security-components-overview.md b/docs/security/security-components-overview.md deleted file mode 100644 index 3cf2a5a..0000000 --- a/docs/security/security-components-overview.md +++ /dev/null @@ -1,63 +0,0 @@ -# 安全组件开发概述 - - -安全组件是OpenHarmony提供的一组系统实现的ArkUI基础组件。当用户点击了这类组件后,应用将被授予临时授权,应用开发者仅需要像使用Button等组件那样集成到应用自己的页面即可。 - - -当前提供了三种安全组件: - - -- 位置组件:获取精准定位授权。 - -- 粘贴组件:获取读取剪贴板授权。 - -- 保存组件:获取媒体库写入授权。 - - -安全组件可以作为一种"特殊的按钮"融入应用页面,无需向用户弹窗授权,实现用户点击即许可的设计思路。精准的场景可以避免权限的滥用,保护用户隐私,同时也减少了弹窗对用户的干扰。 - - -应用集成安全组件后,注册OnClick回调监听用户点击。当用户点击后,安全组件底层将申请权限,并将结果返回给应用。如果成功,应用可以临时使用需要特权的接口。 - - -说明:不同类型的安全组件,对于权限的使用方式不同、授权的有效期也不同,详情请参考开发指导。 - - -安全组件因其自动授权的特性,为了保障用户的隐私不被恶意应用获取,针对安全组件作了很多的限制,例如尺寸不能过小、颜色不能透明等等,确保安全组件是可见的且用户能够识别的,所以三方开发者需要合理的配置组件的尺寸、颜色等属性,避免视觉混淆的情况,如果发生因组件的样式不合法导致授权失败的情况,请检查设备错误日志。 - - -## 技术框架 - -安全组件特性方案有2个主要部件构成。 - -- 安全组件实现: - 集成在ArkUI中,提供ETS接口负责安全组件的生成、属性配置、布局、绘制、点击回调、销毁等功能。 - -- 安全组件管理服务: - 独立的服务进程,负责安全组件的注册、临时授权、取消授权、取消注册等管理,以及合法性检查。 - - -## 运作流程 - -![zh-cn_image_0000001566651300](figures/zh-cn_image_0000001566651300.png) - -1. 应用开发者在ETS文件中集成安全组件,通过JS引擎解析后,在ArkUI框架中生成具体的组件。 - -2. 安全组件注册组件信息到安全组件管理服务,安全组件管理服务检查组件信息的合法性。 - -3. 用户点击事件分发到安全组件。 - -4. 安全组件将点击事件上报到安全组件管理服务。 - -5. 安全组件管理服务根据组件种类对应不同权限,调用权限管理服务进行临时授权。 - -6. 授权成功后,安全组件回调OnClick通知应用层授权成功。 - -7. 应用调用相应的特权操作,如获取地理位置、读取剪贴板信息、媒体库中创建文件等。 - -8. 对应的服务会调用权限管理服务或安全组件管理服务,获取授权结果,返回鉴权结果。 - - -## 约束与限制 - -应用开发者需尽量保证安全组件在应用界面上清晰可见,防止因覆盖、混淆等因素导致授权失败。 diff --git a/frameworks/BUILD.gn b/frameworks/BUILD.gn new file mode 100644 index 0000000..c0647d2 --- /dev/null +++ b/frameworks/BUILD.gn @@ -0,0 +1,94 @@ +# 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("//build/ohos.gni") + +sec_comp_root_dir = ".." + +config("libsecurity_component_framework_config") { + include_dirs = [ + "common/include", + "${sec_comp_root_dir}/interfaces/inner_api/security_component/include", + ] +} + +ohos_shared_library("libsecurity_component_framework") { + subsystem_name = "security" + part_name = "security_component" + output_name = "libsecurity_component_framework" + + include_dirs = [ + "common/include", + "security_component/include", + "${sec_comp_root_dir}/interfaces/inner_api/security_component/include", + "//third_party/json/include", + ] + + sources = [ + "common/src/sec_comp_tool.cpp", + "security_component/src/location_button.cpp", + "security_component/src/paste_button.cpp", + "security_component/src/save_button.cpp", + "security_component/src/sec_comp_base.cpp", + "security_component/src/sec_comp_click_event_parcel.cpp", + ] + + configs = [ "${sec_comp_root_dir}/config:coverage_flags" ] + public_configs = [ ":libsecurity_component_framework_config" ] + + external_deps = [ + "c_utils:utils", + "hilog:libhilog", + ] + + cflags_cc = [ "-DHILOG_ENABLE" ] +} + +config("libsecurity_component_enhance_adapter_config") { + include_dirs = [ + "common/include", + "enhance_adapter/include", + "${sec_comp_root_dir}/interfaces/inner_api/security_component/include", + "//third_party/json/include", + ] +} + +ohos_shared_library("libsecurity_component_enhance_adapter") { + subsystem_name = "security" + part_name = "security_component" + output_name = "libsecurity_component_enhance_adapter" + + include_dirs = [ + "common/include", + "enhance_adapter/include", + "${sec_comp_root_dir}/interfaces/inner_api/security_component/include", + "//third_party/json/include", + ] + + sources = [ "enhance_adapter/src/sec_comp_enhance_adapter.cpp" ] + + configs = [ "${sec_comp_root_dir}/config:coverage_flags" ] + public_configs = [ ":libsecurity_component_enhance_adapter_config" ] + + external_deps = [ + "c_utils:utils", + "hilog:libhilog", + "ipc:ipc_single", + ] + + cflags_cc = [ "-DHILOG_ENABLE" ] + + if (current_cpu == "arm64") { + defines = [ "_ARM64_" ] + } +} diff --git a/frameworks/common/include/sec_comp_err.h b/frameworks/common/include/sec_comp_err.h new file mode 100644 index 0000000..8cacb68 --- /dev/null +++ b/frameworks/common/include/sec_comp_err.h @@ -0,0 +1,54 @@ +/* + * 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 FRAMEWORKS_COMMON_SECURITY_COMPONENT_ERR_H +#define FRAMEWORKS_COMMON_SECURITY_COMPONENT_ERR_H + +#include + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +enum SCErrCode : int32_t { + SC_OK = 0, + + SC_SERVICE_ERROR_VALUE_INVALID = -50, + SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL = -51, + SC_SERVICE_ERROR_MEMORY_OPERATE_FAIL = -52, + SC_SERVICE_ERROR_IPC_REQUEST_FAIL = -54, + SC_SERVICE_ERROR_SERVICE_NOT_EXIST = -55, + SC_SERVICE_ERROR_COMPONENT_INFO_INVALID = -56, + SC_SERVICE_ERROR_COMPONENT_RECT_OVERLAP = -57, + SC_SERVICE_ERROR_COMPONENT_NOT_EXIST = -58, + SC_SERVICE_ERROR_PERMISSION_OPER_FAIL = -59, + SC_SERVICE_ERROR_CLICK_EVENT_INVALID = -60, + SC_SERVICE_ERROR_COMPONENT_INFO_NOT_EQUAL = -61, + SC_SERVICE_ERROR_CALLER_INVALID = -62, + + SC_ENHANCE_ERROR_NOT_EXIST_ENHANCE = -100, + SC_ENHANCE_ERROR_VALUE_INVALID = -101, + SC_ENHANCE_ERROR_OPER_FAIL = -102, + SC_ENHANCE_ERROR_CALLBACK_REDIRECT = -103, + SC_ENHANCE_ERROR_CALLBACK_REGIST_FAIL = -104, + SC_ENHANCE_ERROR_CALLBACK_HAS_EXIST = -105, + SC_ENHANCE_ERROR_CALLBACK_NOT_EXIST = -106, + SC_ENHANCE_ERROR_CALLBACK_OPER_FAIL = -107, + SC_ENHANCE_ERROR_CALLBACK_CHECK_FAIL = -108, + SC_ENHANCE_ERROR_IN_MALICIOUS_LIST = -109, + SC_ENHANCE_ERROR_CHALLENGE_CHECK_FAIL = -110 +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // FRAMEWORKS_COMMON_SECURITY_COMPONENT_ERR_H diff --git a/frameworks/common/include/sec_comp_log.h b/frameworks/common/include/sec_comp_log.h new file mode 100644 index 0000000..71ab801 --- /dev/null +++ b/frameworks/common/include/sec_comp_log.h @@ -0,0 +1,62 @@ +/* + * 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 SECURITY_COMPONENT_LOG_H +#define SECURITY_COMPONENT_LOG_H + +#ifdef HILOG_ENABLE + +#include "hilog/log.h" + +#ifndef __cplusplus + +#undef LOG_DOMAIN +#define LOG_DOMAIN 0xD002F07 + +#define SC_LOG_DEBUG(fmt, ...) HILOG_DEBUG(LOG_CORE, "[%{public}s]:" fmt, __func__, ##__VA_ARGS__) +#define SC_LOG_INFO(fmt, ...) HILOG_INFO(LOG_CORE, "[%{public}s]:" fmt, __func__, ##__VA_ARGS__) +#define SC_LOG_WARN(fmt, ...) HILOG_WARN(LOG_CORE, "[%{public}s]:" fmt, __func__, ##__VA_ARGS__) +#define SC_LOG_ERROR(fmt, ...) HILOG_ERROR(LOG_CORE, "[%{public}s]:" fmt, __func__, ##__VA_ARGS__) +#define SC_LOG_FATAL(fmt, ...) HILOG_FATAL(LOG_CORE, "[%{public}s]:" fmt, __func__, ##__VA_ARGS__) + +#else + +static constexpr unsigned int SECURITY_DOMAIN_SECURITY_COMPONENT = 0xD002F07; + +#define SC_LOG_DEBUG(label, fmt, ...) \ + OHOS::HiviewDFX::HiLog::Debug(label, "[%{public}s]:" fmt, __func__, ##__VA_ARGS__) +#define SC_LOG_INFO(label, fmt, ...) OHOS::HiviewDFX::HiLog::Info(label, "[%{public}s]:" fmt, __func__, ##__VA_ARGS__) +#define SC_LOG_WARN(label, fmt, ...) OHOS::HiviewDFX::HiLog::Warn(label, "[%{public}s]:" fmt, __func__, ##__VA_ARGS__) +#define SC_LOG_ERROR(label, fmt, ...) \ + OHOS::HiviewDFX::HiLog::Error(label, "[%{public}s]:" fmt, __func__, ##__VA_ARGS__) +#define SC_LOG_FATAL(label, fmt, ...) \ + OHOS::HiviewDFX::HiLog::Fatal(label, "[%{public}s]:" fmt, __func__, ##__VA_ARGS__) + +#endif // __cplusplus + +#else + +#include + +#undef LOG_TAG + +#define SC_LOG_DEBUG(fmt, ...) printf("[%s] debug: %s: " fmt "\n", LOG_TAG, __func__, ##__VA_ARGS__) +#define SC_LOG_INFO(fmt, ...) printf("[%s] info: %s: " fmt "\n", LOG_TAG, __func__, ##__VA_ARGS__) +#define SC_LOG_WARN(fmt, ...) printf("[%s] warn: %s: " fmt "\n", LOG_TAG, __func__, ##__VA_ARGS__) +#define SC_LOG_ERROR(fmt, ...) printf("[%s] error: %s: " fmt "\n", LOG_TAG, __func__, ##__VA_ARGS__) +#define SC_LOG_FATAL(fmt, ...) printf("[%s] fatal: %s: " fmt "\n", LOG_TAG, __func__, ##__VA_ARGS__) + +#endif // HILOG_ENABLE + +#endif // SECURITY_COMPONENT_LOG_H diff --git a/frameworks/common/include/sec_comp_tool.h b/frameworks/common/include/sec_comp_tool.h new file mode 100644 index 0000000..197f67d --- /dev/null +++ b/frameworks/common/include/sec_comp_tool.h @@ -0,0 +1,28 @@ +/* + * 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 SECURITY_COMPONENT_TOOL_H +#define SECURITY_COMPONENT_TOOL_H + +#include "sec_comp_info.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { + bool IsColorSimilar(const SecCompColor& color1, const SecCompColor& color2); + bool IsColorTransparent(const SecCompColor& color); +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // SECURITY_COMPONENT_TOOL_H diff --git a/frameworks/common/src/sec_comp_tool.cpp b/frameworks/common/src/sec_comp_tool.cpp new file mode 100644 index 0000000..36d45c4 --- /dev/null +++ b/frameworks/common/src/sec_comp_tool.cpp @@ -0,0 +1,142 @@ +/* + * 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 "sec_comp_tool.h" + +#include +#include +#include "sec_comp_log.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +namespace { +static constexpr double PI_CIRCLE = 3.1415926; +static constexpr double MIN_HSV_DISTANCE = 25.0; +static constexpr double MAX_RGB_VALUE = 255.0; +static constexpr uint8_t MAX_TRANSPARENT = 0x99; // 60% +static constexpr double ZERO_DOUBLE = 0.0; +static constexpr double THIRTY_ANGLE = 30.0; +static constexpr double SIXTY_ANGLE = 60.0; +static constexpr double ONE_HUNDRED_TWEENTY_ANGLE = 120.0; +static constexpr double ONE_HUNDRED_EIGHTY_ANGLE = 180.0; +static constexpr double TWO_HUNDREDS_FORTY_ANGLE = 240.0; +static constexpr double THREE_HUNDREDS_SIXTY_ANGLE = 360.0; +static constexpr double DEFAULT_R = 100.0; + +constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompTool"}; +} + +static inline double MaxValue(double a, double b, double c) +{ + return ((a > b) ? ((a > c) ? a : c) : ((b > c) ? b : c)); +} + +static inline double MinValue(double a, double b, double c) +{ + return ((a < b) ? ((a < c) ? a : c) : ((b < c) ? b : c)); +} + +struct HsvColor { + double h; + double s; + double v; +}; + +static HsvColor RgbToHsv(uint8_t r, uint8_t g, uint8_t b) +{ + HsvColor hsv; + double red = static_cast(r) / MAX_RGB_VALUE; + double green = static_cast(g) / MAX_RGB_VALUE; + double blue = static_cast(b) / MAX_RGB_VALUE; + double max = MaxValue(red, green, blue); + double min = MinValue(red, green, blue); + double delta = max - min; + if (max == min) { + hsv.h = ZERO_DOUBLE; + } else if (max == red) { + hsv.h = fmod((SIXTY_ANGLE * ((green - blue) / delta) + THREE_HUNDREDS_SIXTY_ANGLE), + THREE_HUNDREDS_SIXTY_ANGLE); + } else if (max == green) { + hsv.h = fmod((SIXTY_ANGLE * ((blue - red) / delta) + ONE_HUNDRED_TWEENTY_ANGLE), THREE_HUNDREDS_SIXTY_ANGLE); + } else if (max == blue) { + hsv.h = fmod((SIXTY_ANGLE * ((red - green) / delta) + TWO_HUNDREDS_FORTY_ANGLE), THREE_HUNDREDS_SIXTY_ANGLE); + } + + if (max == 0) { + hsv.s = ZERO_DOUBLE; + } else { + hsv.s = delta / max; + } + + hsv.v = max; + return hsv; +} + +static inline double GetHsvDisX(const HsvColor& hsv, double r) +{ + return r * hsv.v * hsv.s * cos(hsv.h / ONE_HUNDRED_EIGHTY_ANGLE * PI_CIRCLE); +} + +static inline double GetHsvDisY(const HsvColor& hsv, double r) +{ + return r * hsv.v * hsv.s * sin(hsv.h / ONE_HUNDRED_EIGHTY_ANGLE * PI_CIRCLE); +} + +static inline double GetHsvDisZ(const HsvColor& hsv, double h) +{ + return h * (1 - hsv.v); +} + +static double HsvDistance(const HsvColor& hsv1, const HsvColor& hsv2) +{ + double rDef = DEFAULT_R; + double angle = THIRTY_ANGLE; + double h = rDef * cos(angle / ONE_HUNDRED_EIGHTY_ANGLE * PI_CIRCLE); + double r = rDef * sin(angle / ONE_HUNDRED_EIGHTY_ANGLE * PI_CIRCLE); + + double x1 = GetHsvDisX(hsv1, r); + double y1 = GetHsvDisY(hsv1, r); + double z1 = GetHsvDisZ(hsv1, h); + + double x2 = GetHsvDisX(hsv2, r); + double y2 = GetHsvDisY(hsv2, r); + double z2 = GetHsvDisZ(hsv2, h); + + double dx = x1 - x2; + double dy = y1 - y2; + double dz = z1 - z2; + + return sqrt((dx * dx) + (dy * dy) + (dz * dz)); +} + +bool IsColorSimilar(const SecCompColor& color1, const SecCompColor& color2) +{ + HsvColor hsv1 = RgbToHsv(color1.argb.red, color1.argb.green, color1.argb.blue); + HsvColor hsv2 = RgbToHsv(color2.argb.red, color2.argb.green, color2.argb.blue); + + double distance = HsvDistance(hsv1, hsv2); + SC_LOG_DEBUG(LABEL, "Compare color %{public}x %{public}x distance %{public}f", + color1.value, color2.value, distance); + return (distance < MIN_HSV_DISTANCE); +} + +bool IsColorTransparent(const SecCompColor& color) +{ + SC_LOG_DEBUG(LABEL, "Color %{public}x alpha %{public}x", color.value, color.argb.alpha); + return color.argb.alpha < MAX_TRANSPARENT; +} +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS diff --git a/frameworks/enhance_adapter/include/sec_comp_enhance_adapter.h b/frameworks/enhance_adapter/include/sec_comp_enhance_adapter.h new file mode 100644 index 0000000..faada7e --- /dev/null +++ b/frameworks/enhance_adapter/include/sec_comp_enhance_adapter.h @@ -0,0 +1,122 @@ +/* + * 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 SECURITY_COMPONENT_ENHANCE_ADAPTER_H +#define SECURITY_COMPONENT_ENHANCE_ADAPTER_H + +#include +#include "iremote_object.h" +#include "nlohmann/json.hpp" +#include "sec_comp_base.h" +#include "sec_comp_info.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +enum EnhanceInterfaceType { + SEC_COMP_ENHANCE_INPUT_INTERFACE = 0, + SEC_COMP_ENHANCE_SRV_INTERFACE = 1, + SEC_COMP_ENHANCE_CLIENT_INTERFACE = 2, +}; + +// for multimodalinput to add enhance data to PointerEvent +class SecCompInputEnhanceInterface { +public: + // for multimodalinput to set enhance cfg which is from security component enhance service + virtual int32_t SetEnhanceCfg(uint8_t* cfg, uint32_t cfgLen) = 0; + + // for multimodalinput to get enhance data + virtual int32_t GetPointerEventEnhanceData(void* data, uint32_t dataLen, + uint8_t* enhanceData, uint32_t& enHancedataLen) = 0; +}; + +// for security component service to send command to enhance service +class SecCompSrvEnhanceInterface { + public: + // enable input enhance, then enhance service send config to multimodalinput + virtual int32_t EnableInputEnhance() = 0; + + // disable input enhance + virtual int32_t DisableInputEnhance() = 0; + + // send click event to enhance service for checking extra data validity + virtual int32_t CheckExtraInfo(const SecCompClickEvent& touchInfo) = 0; + + // send component info to enhance service for checking its validity + virtual int32_t CheckComponentInfoEnhnace(int32_t pid, std::shared_ptr& compInfo, + const nlohmann::json& jsonComponent) = 0; + + // get RemoteObject of enhance service to connect it + virtual sptr GetEnhanceRemoteObject() = 0; + + // start enhance service + virtual void StartEnhanceService() = 0; + + // exit enhance service + virtual void ExitEnhanceService() = 0; + + // notify process died + virtual void NotifyProcessDied(int32_t pid) = 0; +}; + +// for client +class SecCompClientEnhanceInterface { +public: + // preprocess component info which is send to security component service, e.g. RegisterSecurityComponent + virtual bool EnhanceDataPreprocess(const uintptr_t caller, std::string& componentInfo) = 0; + virtual bool EnhanceDataPreprocess(const uintptr_t caller, int32_t scId, std::string& componentInfo) = 0; + + // regiter scid to enhance client + virtual void RegisterScIdEnhance(const uintptr_t caller, int32_t scId) = 0; + // unregiter scid to enhance client + virtual void UnregisterScIdEnhance(const uintptr_t caller, int32_t scId) = 0; +}; + +class SecCompEnhanceAdapter final { +public: + static void InitEnhanceHandler(EnhanceInterfaceType type); + static int32_t SetEnhanceCfg(uint8_t* cfg, uint32_t cfgLen); + static int32_t GetPointerEventEnhanceData(void* data, uint32_t dataLen, + uint8_t* enhanceData, uint32_t& enHancedataLen); + + static int32_t CheckExtraInfo(const SecCompClickEvent& touchInfo); + static int32_t EnableInputEnhance(); + static int32_t DisableInputEnhance(); + static int32_t CheckComponentInfoEnhnace(int32_t pid, std::shared_ptr& compInfo, + const nlohmann::json& jsonComponent); + static sptr GetEnhanceRemoteObject(); + static void StartEnhanceService(); + static void ExistEnhanceService(); + static void NotifyProcessDied(int32_t pid); + + static bool EnhanceDataPreprocess(std::string& componentInfo); + static bool EnhanceDataPreprocess(int32_t scId, std::string& componentInfo); + static void RegisterScIdEnhance(int32_t scId); + static void UnregisterScIdEnhance(int32_t scId); + + static SecCompInputEnhanceInterface* inputHandler; + static bool isEnhanceInputHandlerInit; + + static SecCompSrvEnhanceInterface* srvHandler; + static bool isEnhanceSrvHandlerInit; + + static SecCompClientEnhanceInterface* clientHandler; + static bool isEnhanceClientHandlerInit; + + static std::mutex initMtx; +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // SECURITY_COMPONENT_ENHANCE_ADAPTER_H diff --git a/frameworks/enhance_adapter/src/sec_comp_enhance_adapter.cpp b/frameworks/enhance_adapter/src/sec_comp_enhance_adapter.cpp new file mode 100644 index 0000000..28d1aa9 --- /dev/null +++ b/frameworks/enhance_adapter/src/sec_comp_enhance_adapter.cpp @@ -0,0 +1,235 @@ +/* + * 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 "sec_comp_enhance_adapter.h" + +#include +#include "sec_comp_err.h" +#include "sec_comp_log.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +namespace { +static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { + LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompEnhanceAdapter"}; + +#ifdef _ARM64_ +static const std::string LIB_PATH = "/system/lib64/"; +#else +static const std::string LIB_PATH = "/system/lib/"; +#endif +static const std::string ENHANCE_INPUT_INTERFACE_LIB = LIB_PATH + "libsec_comp_input_enhance.z.so"; +static const std::string ENHANCE_SRV_INTERFACE_LIB = LIB_PATH + "libsec_comp_service_enhance.z.so"; +static const std::string ENHANCE_CLIENT_INTERFACE_LIB = LIB_PATH + "libsec_comp_client_enhance.z.so"; +} + +SecCompInputEnhanceInterface* SecCompEnhanceAdapter::inputHandler = nullptr; +bool SecCompEnhanceAdapter::isEnhanceInputHandlerInit = false; + +SecCompSrvEnhanceInterface* SecCompEnhanceAdapter::srvHandler = nullptr; +bool SecCompEnhanceAdapter::isEnhanceSrvHandlerInit = false; + +SecCompClientEnhanceInterface* SecCompEnhanceAdapter::clientHandler = nullptr; +bool SecCompEnhanceAdapter::isEnhanceClientHandlerInit = false; + +std::mutex SecCompEnhanceAdapter::initMtx; + +void SecCompEnhanceAdapter::InitEnhanceHandler(EnhanceInterfaceType type) +{ + std::unique_lock lck(initMtx); + std::string libPath = ""; + switch (type) { + case SEC_COMP_ENHANCE_INPUT_INTERFACE: + libPath = ENHANCE_INPUT_INTERFACE_LIB; + isEnhanceInputHandlerInit = true; + break; + case SEC_COMP_ENHANCE_SRV_INTERFACE: + libPath = ENHANCE_SRV_INTERFACE_LIB; + isEnhanceSrvHandlerInit = true; + break; + case SEC_COMP_ENHANCE_CLIENT_INTERFACE: + libPath = ENHANCE_CLIENT_INTERFACE_LIB; + isEnhanceClientHandlerInit = true; + break; + default: + break; + } + if (dlopen(libPath.c_str(), RTLD_LAZY) == nullptr) { + SC_LOG_ERROR(LABEL, "init enhance lib %{public}s failed, error %{public}s", libPath.c_str(), dlerror()); + } +} + +int32_t SecCompEnhanceAdapter::SetEnhanceCfg(uint8_t* cfg, uint32_t cfgLen) +{ + if (!isEnhanceInputHandlerInit) { + InitEnhanceHandler(SEC_COMP_ENHANCE_INPUT_INTERFACE); + } + if (inputHandler != nullptr) { + return inputHandler->SetEnhanceCfg(cfg, cfgLen); + } + return SC_ENHANCE_ERROR_NOT_EXIST_ENHANCE; +} + +int32_t SecCompEnhanceAdapter::GetPointerEventEnhanceData(void* data, uint32_t dataLen, + uint8_t* enhanceData, uint32_t& enHancedataLen) +{ + if (!isEnhanceInputHandlerInit) { + InitEnhanceHandler(SEC_COMP_ENHANCE_INPUT_INTERFACE); + } + if (inputHandler != nullptr) { + return inputHandler->GetPointerEventEnhanceData(data, dataLen, enhanceData, enHancedataLen); + } + return SC_ENHANCE_ERROR_NOT_EXIST_ENHANCE; +} + +int32_t SecCompEnhanceAdapter::CheckExtraInfo(const SecCompClickEvent& touchInfo) +{ + if (!isEnhanceSrvHandlerInit) { + InitEnhanceHandler(SEC_COMP_ENHANCE_SRV_INTERFACE); + } + if (srvHandler != nullptr) { + return srvHandler->CheckExtraInfo(touchInfo); + } + return SC_ENHANCE_ERROR_NOT_EXIST_ENHANCE; +} + +bool SecCompEnhanceAdapter::EnhanceDataPreprocess(std::string& componentInfo) +{ + if (!isEnhanceClientHandlerInit) { + InitEnhanceHandler(SEC_COMP_ENHANCE_CLIENT_INTERFACE); + } + + uintptr_t enhanceCallerAddr = reinterpret_cast(__builtin_return_address(0)); + if (clientHandler != nullptr) { + return clientHandler->EnhanceDataPreprocess(enhanceCallerAddr, componentInfo); + } + return true; +} + +bool SecCompEnhanceAdapter::EnhanceDataPreprocess(int32_t scId, std::string& componentInfo) +{ + if (!isEnhanceClientHandlerInit) { + InitEnhanceHandler(SEC_COMP_ENHANCE_CLIENT_INTERFACE); + } + + uintptr_t enhanceCallerAddr = reinterpret_cast(__builtin_return_address(0)); + if (clientHandler != nullptr) { + return clientHandler->EnhanceDataPreprocess(enhanceCallerAddr, scId, componentInfo); + } + return true; +} + +void SecCompEnhanceAdapter::RegisterScIdEnhance(int32_t scId) +{ + if (!isEnhanceClientHandlerInit) { + InitEnhanceHandler(SEC_COMP_ENHANCE_CLIENT_INTERFACE); + } + + uintptr_t enhanceCallerAddr = reinterpret_cast(__builtin_return_address(0)); + if (clientHandler != nullptr) { + clientHandler->RegisterScIdEnhance(enhanceCallerAddr, scId); + } +} + +void SecCompEnhanceAdapter::UnregisterScIdEnhance(int32_t scId) +{ + if (!isEnhanceClientHandlerInit) { + InitEnhanceHandler(SEC_COMP_ENHANCE_CLIENT_INTERFACE); + } + + uintptr_t enhanceCallerAddr = reinterpret_cast(__builtin_return_address(0)); + if (clientHandler != nullptr) { + clientHandler->UnregisterScIdEnhance(enhanceCallerAddr, scId); + } +} + +int32_t SecCompEnhanceAdapter::EnableInputEnhance() +{ + if (!isEnhanceSrvHandlerInit) { + InitEnhanceHandler(SEC_COMP_ENHANCE_SRV_INTERFACE); + } + if (srvHandler != nullptr) { + return srvHandler->EnableInputEnhance(); + } + return SC_ENHANCE_ERROR_NOT_EXIST_ENHANCE; +} + +int32_t SecCompEnhanceAdapter::DisableInputEnhance() +{ + if (!isEnhanceSrvHandlerInit) { + InitEnhanceHandler(SEC_COMP_ENHANCE_SRV_INTERFACE); + } + if (srvHandler != nullptr) { + return srvHandler->DisableInputEnhance(); + } + return SC_ENHANCE_ERROR_NOT_EXIST_ENHANCE; +} + +void SecCompEnhanceAdapter::StartEnhanceService() +{ + if (!isEnhanceSrvHandlerInit) { + InitEnhanceHandler(SEC_COMP_ENHANCE_SRV_INTERFACE); + } + if (srvHandler != nullptr) { + srvHandler->StartEnhanceService(); + } +} + +void SecCompEnhanceAdapter::ExistEnhanceService() +{ + if (!isEnhanceSrvHandlerInit) { + InitEnhanceHandler(SEC_COMP_ENHANCE_SRV_INTERFACE); + } + if (srvHandler != nullptr) { + srvHandler->ExitEnhanceService(); + } +} + +void SecCompEnhanceAdapter::NotifyProcessDied(int32_t pid) +{ + if (!isEnhanceSrvHandlerInit) { + InitEnhanceHandler(SEC_COMP_ENHANCE_SRV_INTERFACE); + } + if (srvHandler != nullptr) { + srvHandler->NotifyProcessDied(pid); + } +} + +int32_t SecCompEnhanceAdapter::CheckComponentInfoEnhnace(int32_t pid, + std::shared_ptr& compInfo, const nlohmann::json& jsonComponent) +{ + if (!isEnhanceSrvHandlerInit) { + InitEnhanceHandler(SEC_COMP_ENHANCE_SRV_INTERFACE); + } + if (srvHandler != nullptr) { + return srvHandler->CheckComponentInfoEnhnace(pid, compInfo, jsonComponent); + } + return SC_OK; +} + +sptr SecCompEnhanceAdapter::GetEnhanceRemoteObject() +{ + if (!isEnhanceSrvHandlerInit) { + InitEnhanceHandler(SEC_COMP_ENHANCE_SRV_INTERFACE); + } + if (srvHandler != nullptr) { + auto service = srvHandler->GetEnhanceRemoteObject(); + return service; + } + return nullptr; +} +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS diff --git a/frameworks/security_component/include/sec_comp_click_event_parcel.h b/frameworks/security_component/include/sec_comp_click_event_parcel.h new file mode 100644 index 0000000..ea39a20 --- /dev/null +++ b/frameworks/security_component/include/sec_comp_click_event_parcel.h @@ -0,0 +1,38 @@ +/* + * 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 SECURITY_COMPONENT_CLICK_INFO_PARCEL_H +#define SECURITY_COMPONENT_CLICK_INFO_PARCEL_H + +#include "parcel.h" +#include "sec_comp_info.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +struct SecCompClickEventParcel final : public Parcelable { + SecCompClickEventParcel() = default; + + ~SecCompClickEventParcel() override = default; + + bool Marshalling(Parcel& out) const override; + + static SecCompClickEventParcel* Unmarshalling(Parcel& in); + + SecCompClickEvent touchInfoParams_; +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // SECURITY_COMPONENT_CLICK_INFO_PARCEL_H diff --git a/frameworks/security_component/src/location_button.cpp b/frameworks/security_component/src/location_button.cpp new file mode 100644 index 0000000..b62b9e9 --- /dev/null +++ b/frameworks/security_component/src/location_button.cpp @@ -0,0 +1,53 @@ +/* + * 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 "location_button.h" + +#include +#include "sec_comp_log.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +namespace { +constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "LocationButton"}; +} + +bool LocationButton::IsParamValid() +{ + if ((text_ <= UNKNOWN_TEXT) || (static_cast(text_) >= LocationDesc::MAX_LABEL_TYPE) || + (icon_ <= UNKNOWN_ICON) || (static_cast(icon_) >= LocationIcon::MAX_ICON_TYPE)) { + return false; + } + + return true; +} + +bool LocationButton::CompareComponentBasicInfo(SecCompBase *other, bool isRectCheck) const +{ + if (!SecCompBase::CompareComponentBasicInfo(other, isRectCheck)) { + SC_LOG_ERROR(LABEL, "SecComp base not equal."); + return false; + } + LocationButton* otherLocationButton = reinterpret_cast(other); + if (otherLocationButton == nullptr) { + SC_LOG_ERROR(LABEL, "other is not location button."); + return false; + } + return (icon_ == otherLocationButton->icon_) && (text_ == otherLocationButton->text_) && + (bg_ == otherLocationButton->bg_); +} +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS diff --git a/frameworks/security_component/src/paste_button.cpp b/frameworks/security_component/src/paste_button.cpp new file mode 100644 index 0000000..41941dc --- /dev/null +++ b/frameworks/security_component/src/paste_button.cpp @@ -0,0 +1,53 @@ +/* + * 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 "paste_button.h" + +#include +#include "sec_comp_log.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +namespace { +constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "PasteButton"}; +} + +bool PasteButton::IsParamValid() +{ + if ((text_ <= UNKNOWN_TEXT) || (static_cast(text_) >= PasteDesc::MAX_LABEL_TYPE) || + (icon_ <= UNKNOWN_ICON) || (static_cast(icon_) >= PasteIcon::MAX_ICON_TYPE)) { + return false; + } + + return true; +} + +bool PasteButton::CompareComponentBasicInfo(SecCompBase *other, bool isRectCheck) const +{ + if (!SecCompBase::CompareComponentBasicInfo(other, isRectCheck)) { + SC_LOG_ERROR(LABEL, "SecComp base not equal."); + return false; + } + PasteButton* otherPasteButton = reinterpret_cast(other); + if (otherPasteButton == nullptr) { + SC_LOG_ERROR(LABEL, "other is not paste button."); + return false; + } + return (icon_ == otherPasteButton->icon_) && (text_ == otherPasteButton->text_) && + (bg_ == otherPasteButton->bg_); +} +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS diff --git a/frameworks/security_component/src/save_button.cpp b/frameworks/security_component/src/save_button.cpp new file mode 100644 index 0000000..22fc45c --- /dev/null +++ b/frameworks/security_component/src/save_button.cpp @@ -0,0 +1,53 @@ +/* + * 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 "save_button.h" + +#include +#include "sec_comp_log.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +namespace { +constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SaveButton"}; +} + +bool SaveButton::IsParamValid() +{ + if ((text_ <= UNKNOWN_TEXT) || (static_cast(text_) >= SaveDesc::MAX_LABEL_TYPE) || + (icon_ <= UNKNOWN_ICON) || (static_cast(icon_) >= SaveIcon::MAX_ICON_TYPE)) { + return false; + } + + return true; +} + +bool SaveButton::CompareComponentBasicInfo(SecCompBase *other, bool isRectCheck) const +{ + if (!SecCompBase::CompareComponentBasicInfo(other, isRectCheck)) { + SC_LOG_ERROR(LABEL, "SecComp base not equal."); + return false; + } + SaveButton* otherSaveButton = reinterpret_cast(other); + if (otherSaveButton == nullptr) { + SC_LOG_ERROR(LABEL, "other is not save button."); + return false; + } + return (icon_ == otherSaveButton->icon_) && (text_ == otherSaveButton->text_) && + (bg_ == otherSaveButton->bg_); +} +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS diff --git a/frameworks/security_component/src/sec_comp_base.cpp b/frameworks/security_component/src/sec_comp_base.cpp new file mode 100644 index 0000000..4c12e77 --- /dev/null +++ b/frameworks/security_component/src/sec_comp_base.cpp @@ -0,0 +1,369 @@ +/* + * 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 "sec_comp_base.h" + +#include "sec_comp_err.h" +#include "sec_comp_log.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +namespace { +constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompBase"}; +} + +const std::string JsonTagConstants::JSON_RECT = "rect"; +const std::string JsonTagConstants::JSON_SC_TYPE = "type"; +const std::string JsonTagConstants::JSON_NODE_ID = "nodeId"; +const std::string JsonTagConstants::JSON_RECT_X = "x"; +const std::string JsonTagConstants::JSON_RECT_Y = "y"; +const std::string JsonTagConstants::JSON_RECT_WIDTH = "width"; +const std::string JsonTagConstants::JSON_RECT_HEIGHT = "height"; +const std::string JsonTagConstants::JSON_WINDOW_RECT = "windowRect"; +const std::string JsonTagConstants::JSON_SIZE_TAG = "size"; +const std::string JsonTagConstants::JSON_FONT_SIZE_TAG = "fontSize"; +const std::string JsonTagConstants::JSON_ICON_SIZE_TAG = "iconSize"; +const std::string JsonTagConstants::JSON_PADDING_SIZE_TAG = "paddingSize"; +const std::string JsonTagConstants::JSON_PADDING_LEFT_TAG = "left"; +const std::string JsonTagConstants::JSON_PADDING_TOP_TAG = "top"; +const std::string JsonTagConstants::JSON_PADDING_RIGHT_TAG = "right"; +const std::string JsonTagConstants::JSON_PADDING_BOTTOM_TAG = "bottom"; +const std::string JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG = "textIconSpace"; +const std::string JsonTagConstants::JSON_RECT_WIDTH_TAG = "width"; +const std::string JsonTagConstants::JSON_RECT_HEIGHT_TAG = "height"; +const std::string JsonTagConstants::JSON_COLORS_TAG = "colors"; +const std::string JsonTagConstants::JSON_FONT_COLOR_TAG = "fontColor"; +const std::string JsonTagConstants::JSON_ICON_COLOR_TAG = "iconColor"; +const std::string JsonTagConstants::JSON_BG_COLOR_TAG = "bgColor"; +const std::string JsonTagConstants::JSON_BORDER_TAG = "border"; +const std::string JsonTagConstants::JSON_BORDER_WIDTH_TAG = "borderWidth"; +const std::string JsonTagConstants::JSON_PARENT_TAG = "parent"; +const std::string JsonTagConstants::JSON_PARENT_EFFECT_TAG = "parentEffect"; +const std::string JsonTagConstants::JSON_STYLE_TAG = "style"; +const std::string JsonTagConstants::JSON_TEXT_TAG = "text"; +const std::string JsonTagConstants::JSON_ICON_TAG = "icon"; +const std::string JsonTagConstants::JSON_BG_TAG = "bg"; + +bool SecCompBase::ParseDimension(const nlohmann::json& json, const std::string& tag, DimensionT& res) +{ + if ((json.find(tag) == json.end()) || !json.at(tag).is_number_float()) { + SC_LOG_ERROR(LABEL, "json: %{public}s tag invalid.", tag.c_str()); + return false; + } + + res = json.at(tag).get(); + return true; +} + +bool SecCompBase::ParseColor(const nlohmann::json& json, const std::string& tag, SecCompColor& res) +{ + if ((json.find(tag) == json.end()) || !json.at(tag).is_number()) { + SC_LOG_ERROR(LABEL, "json: %{public}s tag invalid.", tag.c_str()); + return false; + } + + res.value = json.at(tag).get(); + return true; +} + +bool SecCompBase::ParseBool(const nlohmann::json& json, const std::string& tag, bool& res) +{ + if ((json.find(tag) == json.end()) || !json.at(tag).is_boolean()) { + SC_LOG_ERROR(LABEL, "json: %{public}s tag invalid.", tag.c_str()); + return false; + } + + res = json.at(tag).get(); + return true; +} + +bool SecCompBase::ParsePadding(const nlohmann::json& json, const std::string& tag, PaddingSize& res) +{ + if ((json.find(tag) == json.end()) || !json.at(tag).is_object()) { + SC_LOG_ERROR(LABEL, "json: %{public}s tag invalid.", tag.c_str()); + return false; + } + + auto jsonPadding = json.at(tag); + if (!ParseDimension(jsonPadding, JsonTagConstants::JSON_PADDING_TOP_TAG, res.top)) { + return false; + } + if (!ParseDimension(jsonPadding, JsonTagConstants::JSON_PADDING_RIGHT_TAG, res.right)) { + return false; + } + if (!ParseDimension(jsonPadding, JsonTagConstants::JSON_PADDING_BOTTOM_TAG, res.bottom)) { + return false; + } + if (!ParseDimension(jsonPadding, JsonTagConstants::JSON_PADDING_LEFT_TAG, res.left)) { + return false; + } + return true; +} + +bool SecCompBase::ParseColors(const nlohmann::json& json, const std::string& tag) +{ + if ((json.find(tag) == json.end()) || !json.at(tag).is_object()) { + SC_LOG_ERROR(LABEL, "json: %{public}s tag invalid.", tag.c_str()); + return false; + } + auto jsonColors = json.at(tag); + if (!ParseColor(jsonColors, JsonTagConstants::JSON_FONT_COLOR_TAG, fontColor_)) { + return false; + } + if (!ParseColor(jsonColors, JsonTagConstants::JSON_ICON_COLOR_TAG, iconColor_)) { + return false; + } + if (!ParseColor(jsonColors, JsonTagConstants::JSON_BG_COLOR_TAG, bgColor_)) { + return false; + } + return true; +} + +bool SecCompBase::ParseBorders(const nlohmann::json& json, const std::string& tag) +{ + if ((json.find(tag) == json.end()) || !json.at(tag).is_object()) { + SC_LOG_ERROR(LABEL, "json: %{public}s tag invalid.", tag.c_str()); + return false; + } + auto jsonBorder = json.at(tag); + return ParseDimension(jsonBorder, JsonTagConstants::JSON_BORDER_WIDTH_TAG, borderWidth_); +} + +bool SecCompBase::ParseSize(const nlohmann::json& json, const std::string& tag) +{ + if ((json.find(tag) == json.end()) || !json.at(tag).is_object()) { + SC_LOG_ERROR(LABEL, "json: %{public}s tag invalid.", tag.c_str()); + return false; + } + + auto jsonSize = json.at(tag); + if (!ParseDimension(jsonSize, JsonTagConstants::JSON_FONT_SIZE_TAG, fontSize_)) { + return false; + } + + if (!ParseDimension(jsonSize, JsonTagConstants::JSON_ICON_SIZE_TAG, iconSize_)) { + return false; + } + + if (!ParseDimension(jsonSize, JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, textIconSpace_)) { + return false; + } + + if (!ParsePadding(jsonSize, JsonTagConstants::JSON_PADDING_SIZE_TAG, padding_)) { + return false; + } + + return true; +} + +bool SecCompBase::ParseParent(const nlohmann::json& json, const std::string& tag) +{ + if ((json.find(tag) == json.end()) || !json.at(tag).is_object()) { + SC_LOG_ERROR(LABEL, "json: %{public}s tag invalid.", tag.c_str()); + return false; + } + auto jsonParent = json.at(tag); + return ParseBool(jsonParent, JsonTagConstants::JSON_PARENT_EFFECT_TAG, parentEffect_); +} + +bool SecCompBase::ParseRect(const nlohmann::json& json, const std::string& tag, SecCompRect& rect) +{ + if ((json.find(tag) == json.end()) || !json.at(tag).is_object()) { + SC_LOG_ERROR(LABEL, "json: %{public}s tag invalid.", tag.c_str()); + return false; + } + + auto jsonSize = json.at(tag); + if (!ParseDimension(jsonSize, JsonTagConstants::JSON_RECT_X, rect.x_)) { + return false; + } + + if (!ParseDimension(jsonSize, JsonTagConstants::JSON_RECT_Y, rect.y_)) { + return false; + } + + if (!ParseDimension(jsonSize, JsonTagConstants::JSON_RECT_WIDTH, rect.width_)) { + return false; + } + + if (!ParseDimension(jsonSize, JsonTagConstants::JSON_RECT_HEIGHT, rect.height_)) { + return false; + } + + return true; +} + +bool SecCompBase::FromJson(const nlohmann::json& jsonSrc) +{ + SC_LOG_DEBUG(LABEL, "Button info %{public}s.", jsonSrc.dump().c_str()); + if ((jsonSrc.find(JsonTagConstants::JSON_SC_TYPE) == jsonSrc.end()) || + !jsonSrc.at(JsonTagConstants::JSON_SC_TYPE).is_number()) { + SC_LOG_ERROR(LABEL, "json: %{public}s tag invalid.", JsonTagConstants::JSON_SC_TYPE.c_str()); + return false; + } + int32_t value = jsonSrc.at(JsonTagConstants::JSON_SC_TYPE).get(); + if ((value <= static_cast(SecCompType::UNKNOWN_SC_TYPE)) || + (value >= static_cast(SecCompType::MAX_SC_TYPE))) { + SC_LOG_ERROR(LABEL, "scType is invalid."); + return false; + } + type_ = static_cast(value); + + if ((jsonSrc.find(JsonTagConstants::JSON_NODE_ID) == jsonSrc.end()) || + !jsonSrc.at(JsonTagConstants::JSON_NODE_ID).is_number()) { + SC_LOG_ERROR(LABEL, "json: %{public}s tag invalid.", JsonTagConstants::JSON_NODE_ID.c_str()); + return false; + } + nodeId_ = jsonSrc.at(JsonTagConstants::JSON_NODE_ID).get(); + + if (!ParseRect(jsonSrc, JsonTagConstants::JSON_RECT, rect_)) { + return false; + } + if (!ParseRect(jsonSrc, JsonTagConstants::JSON_WINDOW_RECT, windowRect_)) { + return false; + } + if (!ParseSize(jsonSrc, JsonTagConstants::JSON_SIZE_TAG)) { + return false; + } + if (!ParseColors(jsonSrc, JsonTagConstants::JSON_COLORS_TAG)) { + return false; + } + if (!ParseBorders(jsonSrc, JsonTagConstants::JSON_BORDER_TAG)) { + return false; + } + if (!ParseParent(jsonSrc, JsonTagConstants::JSON_PARENT_TAG)) { + return false; + } + if (!ParseStyle(jsonSrc, JsonTagConstants::JSON_STYLE_TAG)) { + return false; + } + + return true; +} + +void SecCompBase::ToJson(nlohmann::json& jsonRes) const +{ + jsonRes[JsonTagConstants::JSON_SC_TYPE] = type_; + jsonRes[JsonTagConstants::JSON_NODE_ID] = nodeId_; + jsonRes[JsonTagConstants::JSON_RECT] = nlohmann::json { + {JsonTagConstants::JSON_RECT_X, rect_.x_}, + {JsonTagConstants::JSON_RECT_Y, rect_.y_}, + {JsonTagConstants::JSON_RECT_WIDTH, rect_.width_}, + {JsonTagConstants::JSON_RECT_HEIGHT, rect_.height_} + }; + jsonRes[JsonTagConstants::JSON_WINDOW_RECT] = nlohmann::json { + {JsonTagConstants::JSON_RECT_X, windowRect_.x_}, + {JsonTagConstants::JSON_RECT_Y, windowRect_.y_}, + {JsonTagConstants::JSON_RECT_WIDTH, windowRect_.width_}, + {JsonTagConstants::JSON_RECT_HEIGHT, windowRect_.height_} + }; + nlohmann::json jsonPadding = nlohmann::json { + { JsonTagConstants::JSON_PADDING_TOP_TAG, padding_.top }, + { JsonTagConstants::JSON_PADDING_RIGHT_TAG, padding_.right }, + { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, padding_.bottom }, + { JsonTagConstants::JSON_PADDING_LEFT_TAG, padding_.left }, + }; + + jsonRes[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_SIZE_TAG, fontSize_ }, + { JsonTagConstants::JSON_ICON_SIZE_TAG, iconSize_ }, + { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, textIconSpace_ }, + { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, + }; + + jsonRes[JsonTagConstants::JSON_COLORS_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_COLOR_TAG, fontColor_.value }, + { JsonTagConstants::JSON_ICON_COLOR_TAG, iconColor_.value }, + { JsonTagConstants::JSON_BG_COLOR_TAG, bgColor_.value } + }; + + jsonRes[JsonTagConstants::JSON_BORDER_TAG] = nlohmann::json { + { JsonTagConstants::JSON_BORDER_WIDTH_TAG, borderWidth_ }, + }; + jsonRes[JsonTagConstants::JSON_PARENT_TAG] = nlohmann::json { + { JsonTagConstants::JSON_PARENT_EFFECT_TAG, parentEffect_ }, + }; + + jsonRes[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_TEXT_TAG, text_ }, + { JsonTagConstants::JSON_ICON_TAG, icon_ }, + { JsonTagConstants::JSON_BG_TAG, bg_ }, + }; +} + +std::string SecCompBase::ToJsonStr() const +{ + nlohmann::json json; + ToJson(json); + return json.dump(); +} + +bool SecCompBase::CompareComponentBasicInfo(SecCompBase *other, bool isRectCheck) const +{ + if (other == nullptr) { + SC_LOG_ERROR(LABEL, "other is nullptr."); + return false; + } + + SecCompRect rect = other->rect_; + SecCompRect windowRect = other->windowRect_; + if (isRectCheck) { + rect = rect_; + windowRect = windowRect_; + } + + auto leftValue = std::tie(type_, fontSize_, iconSize_, textIconSpace_, padding_.top, padding_.right, + padding_.bottom, padding_.left, fontColor_.value, bgColor_.value, iconColor_.value, borderWidth_, + rect, windowRect); + auto rightValue = std::tie(other->type_, other->fontSize_, other->iconSize_, other->textIconSpace_, + other->padding_.top, other->padding_.right, other->padding_.bottom, other->padding_.left, + other->fontColor_.value, other->bgColor_.value, other->iconColor_.value, other->borderWidth_, + other->rect_, other->windowRect_); + + return (leftValue == rightValue); +} + +bool SecCompBase::ParseStyle(const nlohmann::json& json, const std::string& tag) +{ + if ((json.find(tag) == json.end()) || !json.at(tag).is_object()) { + SC_LOG_ERROR(LABEL, "json: %{public}s tag invalid.", tag.c_str()); + return false; + } + auto jsonStyle = json.at(tag); + if (!(jsonStyle.at(JsonTagConstants::JSON_TEXT_TAG).is_number() && + jsonStyle.at(JsonTagConstants::JSON_ICON_TAG).is_number() && + jsonStyle.at(JsonTagConstants::JSON_BG_TAG).is_number())) { + SC_LOG_ERROR(LABEL, "json: %{public}s tag invalid.", tag.c_str()); + return false; + } + text_ = jsonStyle.at(JsonTagConstants::JSON_TEXT_TAG).get(); + icon_ = jsonStyle.at(JsonTagConstants::JSON_ICON_TAG).get(); + if (!IsParamValid()) { + SC_LOG_ERROR(LABEL, "text or icon is invalid."); + return false; + } + + bg_ = static_cast(jsonStyle.at(JsonTagConstants::JSON_BG_TAG).get()); + if ((bg_ <= SecCompBackground::UNKNOWN_BG) || (bg_ >= SecCompBackground::MAX_BG_TYPE)) { + SC_LOG_ERROR(LABEL, "bg is invalid."); + return false; + } + + return true; +} +} // namespace base +} // namespace Security +} // namespace OHOS + diff --git a/frameworks/security_component/src/sec_comp_click_event_parcel.cpp b/frameworks/security_component/src/sec_comp_click_event_parcel.cpp new file mode 100644 index 0000000..55390c9 --- /dev/null +++ b/frameworks/security_component/src/sec_comp_click_event_parcel.cpp @@ -0,0 +1,102 @@ +/* + * 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 "sec_comp_click_event_parcel.h" + +#include "sec_comp_log.h" +#include "securec.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +namespace { +static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { + LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompClickEventParcel"}; +} + +bool SecCompClickEventParcel::Marshalling(Parcel& out) const +{ + if (!(out.WriteDouble(this->touchInfoParams_.touchX)) || !(out.WriteDouble(this->touchInfoParams_.touchY))) { + SC_LOG_ERROR(LABEL, "Write touch xy pointer fail"); + return false; + } + + if (!(out.WriteUint64(this->touchInfoParams_.timestamp))) { + SC_LOG_ERROR(LABEL, "Write touch timestamp fail"); + return false; + } + + if (!(out.WriteUint32(this->touchInfoParams_.extraInfo.dataSize))) { + SC_LOG_ERROR(LABEL, "Write extraInfo dataSize fail"); + return false; + } + + if (this->touchInfoParams_.extraInfo.dataSize != 0 && + !(out.WriteBuffer(this->touchInfoParams_.extraInfo.data, this->touchInfoParams_.extraInfo.dataSize))) { + SC_LOG_ERROR(LABEL, "Write touch extraInfo data fail"); + return false; + } + + return true; +} + +SecCompClickEventParcel* SecCompClickEventParcel::Unmarshalling(Parcel& in) +{ + SecCompClickEventParcel* touchInfoParcel = new (std::nothrow) SecCompClickEventParcel(); + if (touchInfoParcel == nullptr) { + SC_LOG_ERROR(LABEL, "Alloc policy parcel fail"); + return nullptr; + } + + SecCompClickEvent touchInfo; + if (!in.ReadDouble(touchInfo.touchX) || !in.ReadDouble(touchInfo.touchY)) { + SC_LOG_ERROR(LABEL, "Read touch xy porinter fail"); + delete touchInfoParcel; + return nullptr; + } + + if (!in.ReadUint64(touchInfo.timestamp)) { + SC_LOG_ERROR(LABEL, "Read timestamp fail"); + delete touchInfoParcel; + return nullptr; + } + + if (!in.ReadUint32(touchInfo.extraInfo.dataSize)) { + SC_LOG_ERROR(LABEL, "Read extraInfo data size fail"); + delete touchInfoParcel; + return nullptr; + } + + if (touchInfo.extraInfo.dataSize == 0) { + touchInfoParcel->touchInfoParams_ = touchInfo; + return touchInfoParcel; + } else if (touchInfo.extraInfo.dataSize > MAX_EXTRA_SIZE) { + SC_LOG_ERROR(LABEL, "Read extraInfo data size invalid"); + delete touchInfoParcel; + return nullptr; + } + + touchInfo.extraInfo.data = const_cast(in.ReadBuffer(touchInfo.extraInfo.dataSize)); + if (touchInfo.extraInfo.data == nullptr) { + SC_LOG_ERROR(LABEL, "Read extraInfo data failed"); + delete touchInfoParcel; + return nullptr; + } + + touchInfoParcel->touchInfoParams_ = touchInfo; + return touchInfoParcel; +} +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS diff --git a/hisysevent.yaml b/hisysevent.yaml new file mode 100644 index 0000000..51ab79c --- /dev/null +++ b/hisysevent.yaml @@ -0,0 +1,94 @@ +# 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. + +domain: SEC_COMPONENT + +CALLBACK_FAILED: + __BASE: {type: SECURITY, level: CRITICAL, desc: Failed to execute the callback} + CALLER_PID: {type: INT32, desc: caller pid} + CALLER_UID: {type: INT32, desc: caller uid} + CALL_SCENE: {type: STRING, desc: call scene} + REASON: {type: STRING, desc: callback execution failure cause} + SC_ID: {type: INT32, desc: security component id} + SC_TYPE: {type: STRING, desc: security component type} + +CALLER_CHECK_FAILED: + __BASE: {type: SECURITY, level: CRITICAL, desc: Illegal invocation} + CALLER_PID: {type: INT32, desc: caller pid} + CALLER_UID: {type: INT32, desc: caller uid} + CALL_SCENE: {type: STRING, desc: call scene} + +CHALLENGE_CHECK_FAILED: + __BASE: {type: SECURITY, level: CRITICAL, desc: Challenge value verification failed} + CALLER_PID: {type: INT32, desc: caller pid} + CALLER_UID: {type: INT32, desc: caller uid} + CALL_SCENE: {type: STRING, desc: call scene} + SC_ID: {type: INT32, desc: security component id} + SC_TYPE: {type: STRING, desc: security component type} + +CLICK_INFO_CHECK_FAILED: + __BASE: {type: SECURITY, level: CRITICAL, desc: Failed to verify the click event} + CALLER_PID: {type: INT32, desc: caller pid} + CALLER_UID: {type: INT32, desc: caller uid} + SC_ID: {type: INT32, desc: security component id} + SC_TYPE: {type: STRING, desc: security component type} + +COMPONENT_INFO_CHECK_FAILED: + __BASE: {type: SECURITY, level: CRITICAL, desc: Failed to verify the component information} + CALLER_PID: {type: INT32, desc: caller pid} + CALLER_UID: {type: INT32, desc: caller uid} + CALL_SCENE: {type: STRING, desc: call scene} + SC_ID: {type: INT32, desc: security component id} + SC_TYPE: {type: STRING, desc: security component type} + +INIT_FAILED: + __BASE: {type: FAULT, level: CRITICAL, desc: Failed to initialize the security component environment} + CALLER_PID: {type: INT32, desc: caller pid} + CALLER_UID: {type: INT32, desc: caller uid} + REASON: {type: STRING, desc: callback execution failure cause} + +REGISTER_SUCCESS: + __BASE: {type: BEHAVIOR, level: MINOR, desc: The security component is registered successfully} + CALLER_PID: {type: INT32, desc: caller pid} + CALLER_UID: {type: INT32, desc: caller uid} + SC_ID: {type: INT32, desc: security component id} + SC_TYPE: {type: STRING, desc: security component type} + +REPEAT_CALLBACK_REGISTER: + __BASE: {type: SECURITY, level: CRITICAL, desc: Repeated registration callback} + CALLER_PID: {type: INT32, desc: caller pid} + CALLER_UID: {type: INT32, desc: caller uid} + +SERVICE_INIT_SUCCESS: + __BASE: {type: BEHAVIOR, level: MINOR, desc: Security component service starts successfully} + PID: {type: INT32, desc: pid of the service process} + +TEMP_GRANT_FAILED: + __BASE: {type: FAULT, level: CRITICAL, desc: Security component authorization failed} + CALLER_PID: {type: INT32, desc: caller pid} + CALLER_UID: {type: INT32, desc: caller uid} + SC_ID: {type: INT32, desc: security component id} + SC_TYPE: {type: STRING, desc: security component type} + +TEMP_GRANT_SUCCESS: + __BASE: {type: BEHAVIOR, level: MINOR, desc: Security component authorization successfully} + CALLER_PID: {type: INT32, desc: caller pid} + CALLER_UID: {type: INT32, desc: caller uid} + SC_ID: {type: INT32, desc: security component id} + SC_TYPE: {type: STRING, desc: security component type} + +UNREGISTER_SUCCESS: + __BASE: {type: BEHAVIOR, level: MINOR, desc: Security component unregister} + CALLER_PID: {type: INT32, desc: caller pid} + CALLER_UID: {type: INT32, desc: caller uid} + SC_ID: {type: INT32, desc: security component id} diff --git a/interfaces/inner_api/enhance_kits/BUILD.gn b/interfaces/inner_api/enhance_kits/BUILD.gn new file mode 100644 index 0000000..4acbcce --- /dev/null +++ b/interfaces/inner_api/enhance_kits/BUILD.gn @@ -0,0 +1,55 @@ +# 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("//build/ohos.gni") + +sec_comp_root_dir = "../../.." + +config("sec_comp_enhance_config") { + visibility = [ ":*" ] + include_dirs = [ + "include", + "${sec_comp_root_dir}/frameworks/common/include", + "${sec_comp_root_dir}/frameworks/enhance_adapter/include", + ] +} + +ohos_shared_library("libsecurity_component_enhance_sdk") { + subsystem_name = "security" + part_name = "security_component" + output_name = "libsecurity_component_enhance_sdk" + + public_configs = [ ":sec_comp_enhance_config" ] + + include_dirs = [ + "include", + "${sec_comp_root_dir}/frameworks/common/include", + "${sec_comp_root_dir}/frameworks/enhance_adapter/include", + ] + + sources = [ "src/sec_comp_enhance_kit.cpp" ] + + deps = [ + "${sec_comp_root_dir}/frameworks:libsecurity_component_enhance_adapter", + ] + + configs = [ "${sec_comp_root_dir}/config:coverage_flags" ] + + external_deps = [ + "c_utils:utils", + "hilog:libhilog", + "ipc:ipc_single", + ] + + cflags_cc = [ "-DHILOG_ENABLE" ] +} diff --git a/interfaces/inner_api/enhance_kits/include/sec_comp_enhance_kit.h b/interfaces/inner_api/enhance_kits/include/sec_comp_enhance_kit.h new file mode 100644 index 0000000..11f46ee --- /dev/null +++ b/interfaces/inner_api/enhance_kits/include/sec_comp_enhance_kit.h @@ -0,0 +1,32 @@ +/* + * 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 SECURITY_COMPONENT_ENHANCE_KITS_H +#define SECURITY_COMPONENT_ENHANCE_KITS_H + +#include + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +struct SecCompEnhanceKit { + static void InitClientEnhance(); + static int32_t SetEnhanceCfg(uint8_t* cfg, uint32_t cfgLen); + static int32_t GetPointerEventEnhanceData(void* data, uint32_t dataLen, + uint8_t* enhanceData, uint32_t& enHancedataLen); +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // SECURITY_COMPONENT_ENHANCE_KITS_H diff --git a/interfaces/inner_api/enhance_kits/include/sec_comp_enhance_kit_c.h b/interfaces/inner_api/enhance_kits/include/sec_comp_enhance_kit_c.h new file mode 100644 index 0000000..c7e0c6f --- /dev/null +++ b/interfaces/inner_api/enhance_kits/include/sec_comp_enhance_kit_c.h @@ -0,0 +1,21 @@ +/* + * 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 SECURITY_COMPONENT_ENHANCE_KIT_C_H +#define SECURITY_COMPONENT_ENHANCE_KIT_C_H + +void InitSecCompClientEnhance(void); + +#endif // SECURITY_COMPONENT_ENHANCE_KIT_C_H + diff --git a/interfaces/inner_api/enhance_kits/src/sec_comp_enhance_kit.cpp b/interfaces/inner_api/enhance_kits/src/sec_comp_enhance_kit.cpp new file mode 100644 index 0000000..4b16511 --- /dev/null +++ b/interfaces/inner_api/enhance_kits/src/sec_comp_enhance_kit.cpp @@ -0,0 +1,45 @@ +/* + * 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 "sec_comp_enhance_kit.h" + +#include "sec_comp_enhance_adapter.h" + +extern "C" void InitSecCompClientEnhance() +{ + OHOS::Security::SecurityComponent::SecCompEnhanceKit::InitClientEnhance(); +} + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +void SecCompEnhanceKit::InitClientEnhance(void) +{ + SecCompEnhanceAdapter::InitEnhanceHandler(SEC_COMP_ENHANCE_CLIENT_INTERFACE); +} + +int32_t SecCompEnhanceKit::SetEnhanceCfg(uint8_t* cfg, uint32_t cfgLen) +{ + return SecCompEnhanceAdapter::SetEnhanceCfg(cfg, cfgLen); +} + +int32_t SecCompEnhanceKit::GetPointerEventEnhanceData(void* data, uint32_t dataLen, + uint8_t* enhanceData, uint32_t& enHancedataLen) +{ + return SecCompEnhanceAdapter::GetPointerEventEnhanceData(data, dataLen, enhanceData, enHancedataLen); +} +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS diff --git a/interfaces/inner_api/enhance_kits/test/BUILD.gn b/interfaces/inner_api/enhance_kits/test/BUILD.gn new file mode 100644 index 0000000..bf1409c --- /dev/null +++ b/interfaces/inner_api/enhance_kits/test/BUILD.gn @@ -0,0 +1,48 @@ +# 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("//build/test.gni") + +sec_comp_root_dir = "../../../.." + +ohos_unittest("sec_comp_enhance_sdk_test") { + subsystem_name = "security" + part_name = "security_component" + module_out_path = part_name + "/" + part_name + + include_dirs = [ "unittest/src" ] + + sources = [ "unittest/src/sec_comp_enhance_test.cpp" ] + + configs = [ "${sec_comp_root_dir}/config:coverage_flags" ] + cflags_cc = [ "-DHILOG_ENABLE" ] + + deps = [ + "${sec_comp_root_dir}/frameworks:libsecurity_component_enhance_adapter", + "${sec_comp_root_dir}/interfaces/inner_api/enhance_kits:libsecurity_component_enhance_sdk", + ] + + external_deps = [ + "c_utils:utils", + "hilog:libhilog", + "ipc:ipc_single", + ] + if (current_cpu == "arm64") { + defines = [ "_ARM64_" ] + } +} + +group("unittest") { + testonly = true + deps = [ ":sec_comp_enhance_sdk_test" ] +} diff --git a/interfaces/inner_api/enhance_kits/test/unittest/src/sec_comp_enhance_test.cpp b/interfaces/inner_api/enhance_kits/test/unittest/src/sec_comp_enhance_test.cpp new file mode 100644 index 0000000..cb3c2ab --- /dev/null +++ b/interfaces/inner_api/enhance_kits/test/unittest/src/sec_comp_enhance_test.cpp @@ -0,0 +1,135 @@ +/* + * 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 "sec_comp_enhance_test.h" +#include "sec_comp_err.h" +#include "sec_comp_log.h" +#include + +using namespace testing::ext; +using namespace OHOS::Security::SecurityComponent; + +namespace { +static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { + LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompEnhanceTest"}; +static bool g_inputEnhanceExist = false; +static bool g_srvEnhanceExist = false; +static constexpr uint32_t SEC_COMP_ENHANCE_CFG_SIZE = 76; +#ifdef _ARM64_ +static const std::string LIB_PATH = "/system/lib64/"; +#else +static const std::string LIB_PATH = "/system/lib/"; +#endif +static const std::string ENHANCE_INPUT_INTERFACE_LIB = LIB_PATH + "libsec_comp_input_enhance.z.so"; +static const std::string ENHANCE_SRV_INTERFACE_LIB = LIB_PATH + "libsec_comp_service_enhance.z.so"; +static constexpr uint32_t MAX_HMAC_SIZE = 64; +} // namespace + +void SecCompEnhanceTest::SetUpTestCase() +{ + if (access(ENHANCE_INPUT_INTERFACE_LIB.c_str(), F_OK) == 0) { + g_inputEnhanceExist = true; + } + + if (access(ENHANCE_SRV_INTERFACE_LIB.c_str(), F_OK) == 0) { + g_srvEnhanceExist = true; + } + + SC_LOG_INFO(LABEL, "SetUpTestCase."); +} + +void SecCompEnhanceTest::TearDownTestCase() +{ + SC_LOG_INFO(LABEL, "TearDownTestCase."); +} + +void SecCompEnhanceTest::SetUp() +{ + SC_LOG_INFO(LABEL, "SetUp ok."); +} + +void SecCompEnhanceTest::TearDown() +{ + SC_LOG_INFO(LABEL, "TearDown."); +} + +/** + * @tc.name: SetEnhanceCfg001 + * @tc.desc: test SetEnhanceCfg + * @tc.type: FUNC + * @tc.require: AR000HO9IN + */ +HWTEST_F(SecCompEnhanceTest, SetEnhanceCfg001, TestSize.Level1) +{ + uint8_t cfgData[SEC_COMP_ENHANCE_CFG_SIZE] = { 0 }; + int32_t result = SecCompEnhanceKit::SetEnhanceCfg(cfgData, SEC_COMP_ENHANCE_CFG_SIZE); + if (g_inputEnhanceExist) { + EXPECT_EQ(result, SC_OK); + } else { + EXPECT_EQ(result, SC_ENHANCE_ERROR_NOT_EXIST_ENHANCE); + } +} + +/** + * @tc.name: GetPoniterEventEnhanceData001 + * @tc.desc: test GetPoniterEventEnhanceData + * @tc.type: FUNC + * @tc.require: AR000HO9IN + */ +HWTEST_F(SecCompEnhanceTest, GetPoniterEventEnhanceData001, TestSize.Level1) +{ + uint8_t originData[16] = { 0 }; + uint32_t dataLen = 16; + uint8_t* enhanceData = nullptr; + uint32_t enHancedataLen = MAX_HMAC_SIZE; + + int32_t result = SecCompEnhanceKit::GetPointerEventEnhanceData(originData, dataLen, enhanceData, enHancedataLen); + if (g_inputEnhanceExist) { + EXPECT_EQ(result, SC_SERVICE_ERROR_SERVICE_NOT_EXIST); + } else { + EXPECT_EQ(result, SC_ENHANCE_ERROR_NOT_EXIST_ENHANCE); + } +} + +/** + * @tc.name: EnableInputEnhance001 + * @tc.desc: test UnmarshallEnhanceCfg + * @tc.type: FUNC + * @tc.require: AR000HO9IN + */ +HWTEST_F(SecCompEnhanceTest, EnableInputEnhance001, TestSize.Level1) +{ + int32_t result = SecCompEnhanceAdapter::EnableInputEnhance(); + if (g_srvEnhanceExist) { + EXPECT_EQ(result, SC_OK); + } else { + EXPECT_EQ(result, SC_ENHANCE_ERROR_NOT_EXIST_ENHANCE); + } +} + +/** + * @tc.name: DisableInputEnhance001 + * @tc.desc: test DisableInputEnhance + * @tc.type: FUNC + * @tc.require: AR000HO9IN + */ +HWTEST_F(SecCompEnhanceTest, DisableInputEnhance001, TestSize.Level1) +{ + int32_t result = SecCompEnhanceAdapter::DisableInputEnhance(); + if (g_srvEnhanceExist) { + EXPECT_EQ(result, SC_OK); + } else { + EXPECT_EQ(result, SC_ENHANCE_ERROR_NOT_EXIST_ENHANCE); + } +} diff --git a/interfaces/inner_api/enhance_kits/test/unittest/src/sec_comp_enhance_test.h b/interfaces/inner_api/enhance_kits/test/unittest/src/sec_comp_enhance_test.h new file mode 100644 index 0000000..deff0d4 --- /dev/null +++ b/interfaces/inner_api/enhance_kits/test/unittest/src/sec_comp_enhance_test.h @@ -0,0 +1,38 @@ +/* + * 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 SECURITY_COMPONENT_ENHANCE_KITS_TEST +#define SECURITY_COMPONENT_ENHANCE_KITS_TEST + +#include +#include "sec_comp_enhance_adapter.h" +#include "sec_comp_enhance_kit.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +class SecCompEnhanceTest : public testing::Test { +public: + static void SetUpTestCase(); + + static void TearDownTestCase(); + + void SetUp() override; + + void TearDown() override; +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // SECURITY_COMPONENT_ENHANCE_KITS_TEST \ No newline at end of file diff --git a/interfaces/inner_api/security_component/BUILD.gn b/interfaces/inner_api/security_component/BUILD.gn new file mode 100644 index 0000000..117f24a --- /dev/null +++ b/interfaces/inner_api/security_component/BUILD.gn @@ -0,0 +1,67 @@ +# 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("//build/ohos.gni") + +sec_comp_root_dir = "../../.." + +config("sec_comp_config") { + visibility = [ ":*" ] + include_dirs = [ + "include", + "${sec_comp_root_dir}/frameworks/common/include", + "//third_party/json/include", + ] +} + +ohos_shared_library("libsecurity_component_sdk") { + subsystem_name = "security" + part_name = "security_component" + output_name = "libsecurity_component_sdk" + + public_configs = [ ":sec_comp_config" ] + + include_dirs = [ + "include", + "${sec_comp_root_dir}/frameworks/common/include", + "${sec_comp_root_dir}/frameworks/security_component/include", + ] + + sources = [ + "src/sec_comp_caller_authorization.cpp", + "src/sec_comp_client.cpp", + "src/sec_comp_death_recipient.cpp", + "src/sec_comp_kit.cpp", + "src/sec_comp_load_callback.cpp", + "src/sec_comp_proxy.cpp", + "src/sec_comp_ui_register.cpp", + ] + + deps = [ + "${sec_comp_root_dir}/frameworks:libsecurity_component_enhance_adapter", + "${sec_comp_root_dir}/frameworks:libsecurity_component_framework", + ] + + configs = [ "${sec_comp_root_dir}/config:coverage_flags" ] + + external_deps = [ + "access_token:libaccesstoken_sdk", + "c_utils:utils", + "hilog:libhilog", + "hisysevent:libhisysevent", + "ipc:ipc_core", + "samgr:samgr_proxy", + ] + + cflags_cc = [ "-DHILOG_ENABLE" ] +} diff --git a/interfaces/inner_api/security_component/include/i_sec_comp_probe.h b/interfaces/inner_api/security_component/include/i_sec_comp_probe.h new file mode 100644 index 0000000..c83cd99 --- /dev/null +++ b/interfaces/inner_api/security_component/include/i_sec_comp_probe.h @@ -0,0 +1,30 @@ +/* + * 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 I_SECURITY_COMPONENT_PROPE_H +#define I_SECURITY_COMPONENT_PROPE_H + +#include + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +class ISecCompProbe { +public: + virtual int32_t GetComponentInfo(int32_t nodeId, std::string& componentInfo) = 0; +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // I_SECURITY_COMPONENT_PROPE_H diff --git a/interfaces/inner_api/security_component/include/i_sec_comp_service.h b/interfaces/inner_api/security_component/include/i_sec_comp_service.h new file mode 100644 index 0000000..0b6d2e7 --- /dev/null +++ b/interfaces/inner_api/security_component/include/i_sec_comp_service.h @@ -0,0 +1,45 @@ +/* + * 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 I_SECURITY_COMPONENT_SERVICE_H +#define I_SECURITY_COMPONENT_SERVICE_H + +#include +#include "access_token.h" +#include "iremote_broker.h" +#include "sec_comp_info.h" +#include "security_component_service_ipc_interface_code.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +constexpr int32_t SA_ID_SECURITY_COMPONENT_SERVICE = 3506; + +class ISecCompService : public IRemoteBroker { +public: + DECLARE_INTERFACE_DESCRIPTOR(u"ohos.security.ISecCompService"); + + virtual int32_t RegisterSecurityComponent(SecCompType type, + const std::string& componentInfo, int32_t& scId) = 0; + virtual int32_t UpdateSecurityComponent(int32_t scId, const std::string& componentInfo) = 0; + virtual int32_t UnregisterSecurityComponent(int32_t scId) = 0; + virtual int32_t ReportSecurityComponentClickEvent(int32_t scId, const std::string& componentInfo, + const SecCompClickEvent& touchInfo, sptr callerToken) = 0; + virtual bool ReduceAfterVerifySavePermission(AccessToken::AccessTokenID tokenId) = 0; + virtual sptr GetEnhanceRemoteObject() = 0; +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // I_SECURITY_COMPONENT_SERVICE_H diff --git a/interfaces/inner_api/security_component/include/location_button.h b/interfaces/inner_api/security_component/include/location_button.h new file mode 100644 index 0000000..927189c --- /dev/null +++ b/interfaces/inner_api/security_component/include/location_button.h @@ -0,0 +1,57 @@ +/* + * 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 I_SECURITY_COMPONENT_LOCATION_BUTTON_H +#define I_SECURITY_COMPONENT_LOCATION_BUTTON_H + +#include +#include "nlohmann/json.hpp" +#include "sec_comp_base.h" +#include "sec_comp_info.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +enum class LocationDesc : int32_t { + CURRENT_LOCATION = 0, + ADD_LOCATION = 1, + SELECT_LOCATION = 2, + SHARE_LOCATION = 3, + SEND_LOCATION = 4, + LOCATING = 5, + LOCATION = 6, + SEND_CURRENT_LOCATION = 7, + RELOCATION = 8, + PUNCH_IN = 9, + CURRENT_POSITION = 10, + MAX_LABEL_TYPE +}; + +enum class LocationIcon : int32_t { + FILLED_ICON = 0, + LINE_ICON = 1, + MAX_ICON_TYPE +}; + +class LocationButton : public SecCompBase { +public: + virtual bool IsParamValid() override; + virtual bool CompareComponentBasicInfo(SecCompBase *other, bool isRectCheck) const override; +private: + bool ParseStyle(const nlohmann::json& json, const std::string& tag); +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // I_SECURITY_COMPONENT_LOCATION_BUTTON_H diff --git a/interfaces/inner_api/security_component/include/paste_button.h b/interfaces/inner_api/security_component/include/paste_button.h new file mode 100644 index 0000000..241a316 --- /dev/null +++ b/interfaces/inner_api/security_component/include/paste_button.h @@ -0,0 +1,46 @@ +/* + * 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 SECURITY_COMPONENT_PASTE_BUTTON_H +#define SECURITY_COMPONENT_PASTE_BUTTON_H + +#include +#include "nlohmann/json.hpp" +#include "sec_comp_base.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +enum class PasteDesc : int32_t { + PASTE = 0, + MAX_LABEL_TYPE +}; + +enum class PasteIcon : int32_t { + FILLED_ICON = 0, + LINE_ICON = 1, + MAX_ICON_TYPE +}; + +class PasteButton : public SecCompBase { +public: + virtual bool IsParamValid() override; + virtual bool CompareComponentBasicInfo(SecCompBase *other, bool isRectCheck) const override; +private: + bool ParseStyle(const nlohmann::json& json, const std::string& tag); +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // SECURITY_COMPONENT_LOCATION_BUTTON_H diff --git a/interfaces/inner_api/security_component/include/save_button.h b/interfaces/inner_api/security_component/include/save_button.h new file mode 100644 index 0000000..ea7b5f5 --- /dev/null +++ b/interfaces/inner_api/security_component/include/save_button.h @@ -0,0 +1,54 @@ +/* + * 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 I_SECURITY_COMPONENT_SAVE_BUTTON_H +#define I_SECURITY_COMPONENT_SAVE_BUTTON_H + +#include +#include "nlohmann/json.hpp" +#include "sec_comp_base.h" +#include "sec_comp_info.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +enum class SaveDesc : int32_t { + DOWNLOAD = 0, + DOWNLOAD_FILE = 1, + SAVE = 2, + SAVE_IMAGE = 3, + SAVE_FILE = 4, + DOWNLOAD_AND_SHARE = 5, + RECEIVE = 6, + CONTINUE_TO_RECEIVE = 7, + MAX_LABEL_TYPE +}; + +enum class SaveIcon : int32_t { + FILLED_ICON = 0, + LINE_ICON = 1, + MAX_ICON_TYPE +}; + +class SaveButton : public SecCompBase { +public: + virtual bool IsParamValid() override; + virtual bool CompareComponentBasicInfo(SecCompBase *other, bool isRectCheck) const override; +private: + bool ParseStyle(const nlohmann::json& json, const std::string& tag); +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // I_SECURITY_COMPONENT_SAVE_BUTTON_H diff --git a/interfaces/inner_api/security_component/include/sec_comp_base.h b/interfaces/inner_api/security_component/include/sec_comp_base.h new file mode 100644 index 0000000..7449a00 --- /dev/null +++ b/interfaces/inner_api/security_component/include/sec_comp_base.h @@ -0,0 +1,139 @@ +/* + * 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 SECURITY_COMPONENT_BASE_H +#define SECURITY_COMPONENT_BASE_H + +#include "nlohmann/json.hpp" +#include "sec_comp_info.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +constexpr int32_t UNKNOWN_TEXT = -2; +constexpr int32_t NO_TEXT = -1; +constexpr int32_t UNKNOWN_ICON = -2; +constexpr int32_t NO_ICON = -1; + +enum class SecCompBackground { + UNKNOWN_BG = -2, + NO_BG_TYPE = -1, + CAPSULE = 0, + CIRCLE = 1, + NORMAL = 2, + MAX_BG_TYPE +}; + +class JsonTagConstants final { +public: + static const std::string JSON_RECT; + static const std::string JSON_SC_TYPE; + static const std::string JSON_NODE_ID; + static const std::string JSON_RECT_X; + static const std::string JSON_RECT_Y; + static const std::string JSON_RECT_WIDTH; + static const std::string JSON_RECT_HEIGHT; + static const std::string JSON_WINDOW_RECT; + + static const std::string JSON_SIZE_TAG; + static const std::string JSON_FONT_SIZE_TAG; + static const std::string JSON_ICON_SIZE_TAG; + static const std::string JSON_PADDING_SIZE_TAG; + static const std::string JSON_PADDING_LEFT_TAG; + static const std::string JSON_PADDING_TOP_TAG; + static const std::string JSON_PADDING_RIGHT_TAG; + static const std::string JSON_PADDING_BOTTOM_TAG; + static const std::string JSON_TEXT_ICON_PADDING_TAG; + static const std::string JSON_RECT_WIDTH_TAG; + static const std::string JSON_RECT_HEIGHT_TAG; + static const std::string JSON_COLORS_TAG; + static const std::string JSON_FONT_COLOR_TAG; + static const std::string JSON_ICON_COLOR_TAG; + static const std::string JSON_BG_COLOR_TAG; + + static const std::string JSON_BORDER_TAG; + static const std::string JSON_BORDER_WIDTH_TAG; + static const std::string JSON_PARENT_TAG; + static const std::string JSON_PARENT_EFFECT_TAG; + + static const std::string JSON_STYLE_TAG; + static const std::string JSON_TEXT_TAG; + static const std::string JSON_ICON_TAG; + static const std::string JSON_BG_TAG; +}; + +class SecCompBase { +public: + SecCompBase() = default; + virtual ~SecCompBase() = default; + bool FromJson(const nlohmann::json& jsonSrc); + void ToJson(nlohmann::json& jsonRes) const; + std::string ToJsonStr(void) const; + virtual bool CompareComponentBasicInfo(SecCompBase *other, bool isRectCheck) const; + void SetValid(bool valid) + { + isValid_ = valid; + }; + + bool GetValid() + { + return isValid_; + }; + + // size + DimensionT fontSize_ = DEFAULT_DIMENSION; + DimensionT iconSize_ = DEFAULT_DIMENSION; + PaddingSize padding_; + DimensionT textIconSpace_ = DEFAULT_DIMENSION; + + // color + SecCompColor fontColor_; + SecCompColor iconColor_; + SecCompColor bgColor_; + + // border + DimensionT borderWidth_ = DEFAULT_DIMENSION; + + // parent effect + bool parentEffect_ = false; + + SecCompType type_ = UNKNOWN_SC_TYPE; + SecCompRect rect_; + SecCompRect windowRect_; + bool isValid_ = false; + + int32_t text_ = UNKNOWN_TEXT; + int32_t icon_ = UNKNOWN_ICON; + SecCompBackground bg_ = SecCompBackground::UNKNOWN_BG; + + int32_t nodeId_ = 0; +protected: + virtual bool IsParamValid() = 0; +private: + bool ParseDimension(const nlohmann::json& json, const std::string& tag, DimensionT& res); + bool ParseColor(const nlohmann::json& json, const std::string& tag, SecCompColor& res); + bool ParseBool(const nlohmann::json& json, const std::string& tag, bool& res); + bool ParsePadding(const nlohmann::json& json, const std::string& tag, PaddingSize& res); + bool ParseColors(const nlohmann::json& json, const std::string& tag); + bool ParseBorders(const nlohmann::json& json, const std::string& tag); + bool ParseSize(const nlohmann::json& json, const std::string& tag); + bool ParseParent(const nlohmann::json& json, const std::string& tag); + bool ParseRect(const nlohmann::json& json, const std::string& tag, SecCompRect& rect); + bool ParseStyle(const nlohmann::json& json, const std::string& tag); +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // SECURITY_COMPONENT_BASE_H + diff --git a/interfaces/inner_api/security_component/include/sec_comp_caller_authorization.h b/interfaces/inner_api/security_component/include/sec_comp_caller_authorization.h new file mode 100644 index 0000000..d1564a0 --- /dev/null +++ b/interfaces/inner_api/security_component/include/sec_comp_caller_authorization.h @@ -0,0 +1,43 @@ +/* + * 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 INTERFACES_INNER_API_SECURITY_COMPONENT_CALLER_AYTHORIZATION_H +#define INTERFACES_INNER_API_SECURITY_COMPONENT_CALLER_AYTHORIZATION_H + +#include +#include +#include "nocopyable.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +class SecCompCallerAuthorization { +public: + static SecCompCallerAuthorization& GetInstance(); + virtual ~SecCompCallerAuthorization() = default; + void RegisterSecCompKitCaller(std::vector& callerList); + bool IsKitCaller(uintptr_t callerAddr); + +private: + SecCompCallerAuthorization() = default; + std::vector kitCallerList_; + bool isInit_ = false; + DISALLOW_COPY_AND_MOVE(SecCompCallerAuthorization); +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // INTERFACES_INNER_API_SECURITY_COMPONENT_CALLER_AYTHORIZATION_H + diff --git a/interfaces/inner_api/security_component/include/sec_comp_client.h b/interfaces/inner_api/security_component/include/sec_comp_client.h new file mode 100644 index 0000000..954fe11 --- /dev/null +++ b/interfaces/inner_api/security_component/include/sec_comp_client.h @@ -0,0 +1,68 @@ +/* + * 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 SECURITY_COMPONENT_CLIENT_H +#define SECURITY_COMPONENT_CLIENT_H + +#include +#include +#include +#include "i_sec_comp_service.h" +#include "sec_comp_death_recipient.h" +#include "sec_comp_err.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +class SecCompClient final { +public: + static SecCompClient& GetInstance(); + + int32_t RegisterSecurityComponent(SecCompType type, const std::string& componentInfo, int32_t& scId); + int32_t UpdateSecurityComponent(int32_t scId, const std::string& componentInfo); + int32_t UnregisterSecurityComponent(int32_t scId); + int32_t ReportSecurityComponentClickEvent(int32_t scId, + const std::string& componentInfo, const SecCompClickEvent& touchInfo, sptr callerToken); + bool ReduceAfterVerifySavePermission(AccessToken::AccessTokenID tokenId); + sptr GetEnhanceRemoteObject(bool doLoadSa); + + void FinishStartSASuccess(const sptr& remoteObject); + void FinishStartSAFail(); + void OnRemoteDiedHandle(); + +private: + SecCompClient(); + virtual ~SecCompClient(); + DISALLOW_COPY_AND_MOVE(SecCompClient); + + bool TryToGetSecCompSa(); + bool StartLoadSecCompSa(); + void WaitForSecCompSa(); + void GetSecCompSa(); + void LoadSecCompSa(); + sptr GetProxy(bool doLoadSa); + void GetProxyFromRemoteObject(const sptr& remoteObject); + + std::mutex cvLock_; + bool readyFlag_ = false; + std::condition_variable secComCon_; + std::mutex proxyMutex_; + sptr proxy_ = nullptr; + sptr serviceDeathObserver_ = nullptr; +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // SECURITY_COMPONENT_CLIENT_H diff --git a/interfaces/inner_api/security_component/include/sec_comp_death_recipient.h b/interfaces/inner_api/security_component/include/sec_comp_death_recipient.h new file mode 100644 index 0000000..4a18525 --- /dev/null +++ b/interfaces/inner_api/security_component/include/sec_comp_death_recipient.h @@ -0,0 +1,32 @@ +/* + * 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 SECURITY_COMPONENT_DEATH_RECIPIENT_H +#define SECURITY_COMPONENT_DEATH_RECIPIENT_H + +#include "iremote_object.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +class SecCompDeathRecipient : public IRemoteObject::DeathRecipient { +public: + SecCompDeathRecipient() {} + virtual ~SecCompDeathRecipient() = default; + void OnRemoteDied(const wptr& object) override; +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // SECURITY_COMPONENT_DEATH_RECIPIENT_H diff --git a/interfaces/inner_api/security_component/include/sec_comp_info.h b/interfaces/inner_api/security_component/include/sec_comp_info.h new file mode 100644 index 0000000..d02ebb2 --- /dev/null +++ b/interfaces/inner_api/security_component/include/sec_comp_info.h @@ -0,0 +1,130 @@ +/* + * 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 SECURITY_COMPONENT_INFO_H +#define SECURITY_COMPONENT_INFO_H + +#include + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +static constexpr int32_t INVALID_SC_ID = -1; +using DimensionT = double; // unit is vp +static constexpr DimensionT DEFAULT_DIMENSION = 0.0; +static constexpr DimensionT MIN_FONT_SIZE = 12.0; +static constexpr DimensionT MIN_ICON_SIZE = 12.0; +static constexpr DimensionT MIN_PADDING_SIZE = 0.0; +static constexpr DimensionT MIN_PADDING_WITHOUT_BG = 4.0; +static constexpr uint32_t MAX_EXTRA_SIZE = 0x1000; + +struct PaddingSize { + DimensionT top = DEFAULT_DIMENSION; + DimensionT right = DEFAULT_DIMENSION; + DimensionT bottom = DEFAULT_DIMENSION; + DimensionT left = DEFAULT_DIMENSION; +}; + +enum SecCompType { + UNKNOWN_SC_TYPE = 0, + LOCATION_COMPONENT, + PASTE_COMPONENT, + SAVE_COMPONENT, + MAX_SC_TYPE +}; + +union SecCompColor { + struct { + uint8_t blue; + uint8_t green; + uint8_t red; + uint8_t alpha; + } argb; + uint32_t value; +}; + +inline bool IsComponentTypeValid(int32_t type) +{ + return (type > UNKNOWN_SC_TYPE && type < MAX_SC_TYPE); +} + +inline bool GreatOrEqual(double left, double right) +{ + constexpr double epsilon = -0.001; + return (left - right) > epsilon; +} + +inline bool GreatNotEqual(double left, double right) +{ + constexpr double epsilon = 0.001; + return (left - right) > epsilon; +} + +inline bool IsEqual(double left, double right) +{ + constexpr double epsilon = 0.001; + if (left > right) { + return (left - right) < epsilon; + } else if (right > left) { + return (right - left) < epsilon; + } else { + return true; + } +} + +class SecCompRect { +public: + SecCompRect() = default; + ~SecCompRect() = default; + + bool IsInRect(double x, double y) const + { + return (GreatOrEqual(x, x_) && GreatOrEqual((x_ + width_), x) && + GreatOrEqual(y, y_) && GreatOrEqual((y_ + height_), y)); + }; + + bool operator==(const SecCompRect& other) const + { + return (IsEqual(x_, other.x_)) && (IsEqual(y_, other.y_)) && + (IsEqual(width_, other.width_)) && (IsEqual(height_, other.height_)); + } + + DimensionT x_ = 0.0; + DimensionT y_ = 0.0; + DimensionT width_ = 0.0; + DimensionT height_ = 0.0; +}; + +struct ExtraInfo { + uint32_t dataSize; + uint8_t* data; +}; + +struct SecCompClickEvent { + double touchX; + double touchY; + uint64_t timestamp; + ExtraInfo extraInfo; +}; + +struct SecCompPointEvent { + double touchX; + double touchY; + uint64_t timestamp; +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // SECURITY_COMPONENT_INFO_H diff --git a/interfaces/inner_api/security_component/include/sec_comp_kit.h b/interfaces/inner_api/security_component/include/sec_comp_kit.h new file mode 100644 index 0000000..80c20c2 --- /dev/null +++ b/interfaces/inner_api/security_component/include/sec_comp_kit.h @@ -0,0 +1,40 @@ +/* + * 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 INTERFACES_INNER_API_SECURITY_COMPONENT_KIT_H +#define INTERFACES_INNER_API_SECURITY_COMPONENT_KIT_H + +#include +#include "accesstoken_kit.h" +#include "iremote_object.h" +#include "sec_comp_info.h" +#include "sec_comp_ui_register.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +class SecCompKit { +public: + static int32_t RegisterSecurityComponent(SecCompType type, std::string& componentInfo, int32_t& scId); + static int32_t UpdateSecurityComponent(int32_t scId, std::string& componentInfo); + static int32_t UnregisterSecurityComponent(int32_t scId); + static int32_t ReportSecurityComponentClickEvent(int32_t scId, + std::string& componentInfo, const SecCompClickEvent& touchInfo, sptr callerToken = nullptr); + static bool ReduceAfterVerifySavePermission(AccessToken::AccessTokenID tokenId); + static sptr GetEnhanceRemoteObject(bool isLoad); +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // INTERFACES_INNER_API_SECURITY_COMPONENT_KIT_H diff --git a/interfaces/inner_api/security_component/include/sec_comp_load_callback.h b/interfaces/inner_api/security_component/include/sec_comp_load_callback.h new file mode 100644 index 0000000..5513896 --- /dev/null +++ b/interfaces/inner_api/security_component/include/sec_comp_load_callback.h @@ -0,0 +1,33 @@ +/* + * 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 SECURITY_COMPONENT_LOAD_CALLBACK_H +#define SECURITY_COMPONENT_LOAD_CALLBACK_H + +#include "system_ability_load_callback_stub.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +class SecCompLoadCallback : public SystemAbilityLoadCallbackStub { +public: + explicit SecCompLoadCallback(); + + void OnLoadSystemAbilitySuccess(int32_t systemAbilityId, const sptr& remoteObject); + void OnLoadSystemAbilityFail(int32_t systemAbilityId); +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // SECURITY_COMPONENT_LOAD_CALLBACK_H diff --git a/interfaces/inner_api/security_component/include/sec_comp_proxy.h b/interfaces/inner_api/security_component/include/sec_comp_proxy.h new file mode 100644 index 0000000..729877b --- /dev/null +++ b/interfaces/inner_api/security_component/include/sec_comp_proxy.h @@ -0,0 +1,43 @@ +/* + * 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 SECURITY_COMPONENT_PROXY_H +#define SECURITY_COMPONENT_PROXY_H + +#include +#include "i_sec_comp_service.h" +#include "iremote_proxy.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +class SecCompProxy : public IRemoteProxy { +public: + explicit SecCompProxy(const sptr& impl); + ~SecCompProxy() override; + int32_t RegisterSecurityComponent(SecCompType type, const std::string& componentInfo, int32_t& scId) override; + int32_t UpdateSecurityComponent(int32_t scId, const std::string& componentInfo) override; + int32_t UnregisterSecurityComponent(int32_t scId) override; + int32_t ReportSecurityComponentClickEvent(int32_t scId, + const std::string& componentInfo, const SecCompClickEvent& touchInfo, sptr callerToken) override; + bool ReduceAfterVerifySavePermission(AccessToken::AccessTokenID tokenId) override; + sptr GetEnhanceRemoteObject() override; + +private: + static inline BrokerDelegator delegator_; +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // SECURITY_COMPONENT_PROXY_H diff --git a/interfaces/inner_api/security_component/include/sec_comp_ui_register.h b/interfaces/inner_api/security_component/include/sec_comp_ui_register.h new file mode 100644 index 0000000..b415bb1 --- /dev/null +++ b/interfaces/inner_api/security_component/include/sec_comp_ui_register.h @@ -0,0 +1,33 @@ +/* + * 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 INTERFACES_INNER_API_SECURITY_COMPONENT_UI_REGISTER_H +#define INTERFACES_INNER_API_SECURITY_COMPONENT_UI_REGISTER_H + +#include "i_sec_comp_probe.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +class SecCompUiRegister { +public: + SecCompUiRegister(std::vector& callerList, ISecCompProbe* probe); + virtual ~SecCompUiRegister() = default; + static ISecCompProbe* callbackProbe; +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // INTERFACES_INNER_API_SECURITY_COMPONENT_UI_REGISTER_H + diff --git a/interfaces/inner_api/security_component/include/security_component_service_ipc_interface_code.h b/interfaces/inner_api/security_component/include/security_component_service_ipc_interface_code.h new file mode 100644 index 0000000..a873e90 --- /dev/null +++ b/interfaces/inner_api/security_component/include/security_component_service_ipc_interface_code.h @@ -0,0 +1,43 @@ +/* + * 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 SECURITY_COMPONENT_IPC_INTERFACE_CODE_H +#define SECURITY_COMPONENT_IPC_INTERFACE_CODE_H + +/* SAID: 3506 */ +namespace OHOS { +namespace Security { +namespace SecurityComponent { +enum SecurityComponentServiceInterfaceCode { + REGISTER_SECURITY_COMPONENT = 0, + UPDATE_SECURITY_COMPONENT = 1, + UNREGISTER_SECURITY_COMPONENT = 2, + REPORT_SECURITY_COMPONENT_CLICK_EVENT = 3, + GET_SECURITY_COMPONENT_ENHANCE_OBJECT = 4, + VERIFY_TEMP_SAVE_PERMISSION = 5, +}; + +enum EnhanceInterfaceCode { + REGISTER_CHECK_CALLBACK = 0, +}; + +enum EnhanceCallbackCheckCode { + GET_CALLER_SECURITY_COMPONENT_INFO = 0, +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // SECURITY_COMPONENT_IPC_INTERFACE_CODE_H + diff --git a/interfaces/inner_api/security_component/src/sec_comp_caller_authorization.cpp b/interfaces/inner_api/security_component/src/sec_comp_caller_authorization.cpp new file mode 100644 index 0000000..b98be28 --- /dev/null +++ b/interfaces/inner_api/security_component/src/sec_comp_caller_authorization.cpp @@ -0,0 +1,67 @@ +/* + * 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 "sec_comp_caller_authorization.h" + +#include "sec_comp_log.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +namespace { +static constexpr int32_t MAX_FUNC_ASM_SIZE = 0x250; +static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { + LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompCallerAuthorization"}; +static constexpr size_t MAX_CALLER_SIZE = 10; +} + +void SecCompCallerAuthorization::RegisterSecCompKitCaller(std::vector& callerList) +{ + if (isInit_) { + SC_LOG_ERROR(LABEL, "can not init repeatly"); + return; + } + + isInit_ = true; + if ((callerList.size() == 0) || (callerList.size() > MAX_CALLER_SIZE)) { + SC_LOG_ERROR(LABEL, "caller size is invalid"); + return; + } + + kitCallerList_ = callerList; +} + +bool SecCompCallerAuthorization::IsKitCaller(uintptr_t callerAddr) +{ + if (!isInit_) { + SC_LOG_INFO(LABEL, "caller authorization has not init"); + return true; + } + for (size_t i = 0; i < kitCallerList_.size(); i++) { + if ((callerAddr > kitCallerList_[i]) && (callerAddr < kitCallerList_[i] + MAX_FUNC_ASM_SIZE)) { + return true; + } + } + return false; +} + +SecCompCallerAuthorization& SecCompCallerAuthorization::GetInstance() +{ + static SecCompCallerAuthorization instance; + return instance; +} +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS + diff --git a/interfaces/inner_api/security_component/src/sec_comp_client.cpp b/interfaces/inner_api/security_component/src/sec_comp_client.cpp new file mode 100644 index 0000000..0e20cee --- /dev/null +++ b/interfaces/inner_api/security_component/src/sec_comp_client.cpp @@ -0,0 +1,258 @@ +/* + * 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 "sec_comp_client.h" + +#include "iservice_registry.h" +#include "sec_comp_load_callback.h" +#include "sec_comp_log.h" +#include "sec_comp_proxy.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +namespace { +static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompClient"}; +} // namespace + +SecCompClient& SecCompClient::GetInstance() +{ + static SecCompClient instance; + return instance; +} + +SecCompClient::SecCompClient() +{} + +SecCompClient::~SecCompClient() +{ + if (proxy_ == nullptr) { + return; + } + auto remoteObj = proxy_->AsObject(); + if (remoteObj == nullptr) { + return; + } + if (serviceDeathObserver_ != nullptr) { + remoteObj->RemoveDeathRecipient(serviceDeathObserver_); + } +} + +int32_t SecCompClient::RegisterSecurityComponent(SecCompType type, + const std::string& componentInfo, int32_t& scId) +{ + auto proxy = GetProxy(true); + if (proxy == nullptr) { + SC_LOG_ERROR(LABEL, "Proxy is null"); + return SC_SERVICE_ERROR_VALUE_INVALID; + } + + return proxy->RegisterSecurityComponent(type, componentInfo, scId); +} + +int32_t SecCompClient::UpdateSecurityComponent(int32_t scId, const std::string& componentInfo) +{ + auto proxy = GetProxy(true); + if (proxy == nullptr) { + SC_LOG_ERROR(LABEL, "Proxy is null"); + return SC_SERVICE_ERROR_VALUE_INVALID; + } + + return proxy->UpdateSecurityComponent(scId, componentInfo); +} + +int32_t SecCompClient::UnregisterSecurityComponent(int32_t scId) +{ + auto proxy = GetProxy(true); + if (proxy == nullptr) { + SC_LOG_ERROR(LABEL, "Proxy is null"); + return SC_SERVICE_ERROR_VALUE_INVALID; + } + + return proxy->UnregisterSecurityComponent(scId); +} + +int32_t SecCompClient::ReportSecurityComponentClickEvent(int32_t scId, + const std::string& componentInfo, const SecCompClickEvent& touchInfo, sptr callerToken) +{ + auto proxy = GetProxy(true); + if (proxy == nullptr) { + SC_LOG_ERROR(LABEL, "Proxy is null"); + return SC_SERVICE_ERROR_VALUE_INVALID; + } + + return proxy->ReportSecurityComponentClickEvent(scId, componentInfo, touchInfo, callerToken); +} + +bool SecCompClient::ReduceAfterVerifySavePermission(AccessToken::AccessTokenID tokenId) +{ + auto proxy = GetProxy(false); + if (proxy == nullptr) { + SC_LOG_ERROR(LABEL, "Proxy is null"); + return false; + } + + return proxy->ReduceAfterVerifySavePermission(tokenId); +} + +sptr SecCompClient::GetEnhanceRemoteObject(bool doLoadSa) +{ + auto proxy = GetProxy(doLoadSa); + if (proxy == nullptr) { + return nullptr; + } + + return proxy->GetEnhanceRemoteObject(); +} + +bool SecCompClient::StartLoadSecCompSa() +{ + { + std::unique_lock lock(cvLock_); + readyFlag_ = false; + } + auto sam = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + if (sam == nullptr) { + SC_LOG_ERROR(LABEL, "GetSystemAbilityManager return null"); + return false; + } + sptr ptrSecCompLoadCallback = + new (std::nothrow) SecCompLoadCallback(); + if (ptrSecCompLoadCallback == nullptr) { + SC_LOG_ERROR(LABEL, "New ptrSecCompLoadCallback fail."); + return false; + } + + int32_t result = sam->LoadSystemAbility(SA_ID_SECURITY_COMPONENT_SERVICE, + ptrSecCompLoadCallback); + if (result != SC_OK) { + SC_LOG_ERROR(LABEL, "LoadSystemAbility %{public}d failed", SA_ID_SECURITY_COMPONENT_SERVICE); + return false; + } + SC_LOG_INFO(LABEL, "Notify samgr load sa %{public}d, waiting for service start", SA_ID_SECURITY_COMPONENT_SERVICE); + return true; +} + +bool SecCompClient::TryToGetSecCompSa() +{ + auto sam = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + if (sam == nullptr) { + SC_LOG_ERROR(LABEL, "GetSystemAbilityManager return null"); + return false; + } + + auto secCompSa = sam->CheckSystemAbility(SA_ID_SECURITY_COMPONENT_SERVICE); + if (secCompSa == nullptr) { + SC_LOG_INFO(LABEL, "Service is not start."); + return false; + } + GetProxyFromRemoteObject(secCompSa); + return true; +} + +void SecCompClient::WaitForSecCompSa() +{ + // wait_for release lock and block until time out(1s) or match the condition with notice + std::unique_lock lock(cvLock_); + auto waitStatus = secComCon_.wait_for( + lock, std::chrono::milliseconds(SA_ID_SECURITY_COMPONENT_SERVICE), [this]() { return readyFlag_; }); + if (!waitStatus) { + // time out or loadcallback fail + SC_LOG_ERROR(LABEL, "security component load sa timeout"); + return; + } +} + +void SecCompClient::FinishStartSASuccess(const sptr& remoteObject) +{ + GetProxyFromRemoteObject(remoteObject); + // get lock which wait_for release and send a notice so that wait_for can out of block + std::unique_lock lock(cvLock_); + readyFlag_ = true; + secComCon_.notify_one(); +} + +void SecCompClient::FinishStartSAFail() +{ + SC_LOG_ERROR(LABEL, "get security component sa failed."); + // get lock which wait_for release and send a notice + std::unique_lock lock(cvLock_); + readyFlag_ = true; + secComCon_.notify_one(); +} + +void SecCompClient::LoadSecCompSa() +{ + if (!StartLoadSecCompSa()) { + return; + } + WaitForSecCompSa(); +} + +void SecCompClient::OnRemoteDiedHandle() +{ + SC_LOG_ERROR(LABEL, "Remote service died"); + std::unique_lock lock(proxyMutex_); + proxy_ = nullptr; + serviceDeathObserver_ = nullptr; + { + std::unique_lock lock1(cvLock_); + readyFlag_ = false; + } +} + +void SecCompClient::GetProxyFromRemoteObject(const sptr& remoteObject) +{ + if (remoteObject == nullptr) { + return; + } + + sptr serviceDeathObserver = new (std::nothrow) SecCompDeathRecipient(); + if (serviceDeathObserver == nullptr) { + SC_LOG_ERROR(LABEL, "Alloc service death observer fail"); + return; + } + + if (!remoteObject->AddDeathRecipient(serviceDeathObserver)) { + SC_LOG_ERROR(LABEL, "Add service death observer fail"); + return; + } + + auto proxy = iface_cast(remoteObject); + if (proxy == nullptr) { + SC_LOG_ERROR(LABEL, "iface_cast get null"); + return; + } + proxy_ = proxy; + serviceDeathObserver_ = serviceDeathObserver; + SC_LOG_INFO(LABEL, "GetSystemAbility %{public}d success", SA_ID_SECURITY_COMPONENT_SERVICE); + return; +} + +sptr SecCompClient::GetProxy(bool doLoadSa) +{ + std::unique_lock lock(proxyMutex_); + if (proxy_ != nullptr) { + return proxy_; + } + if (TryToGetSecCompSa() || !doLoadSa) { + return proxy_; + } + + LoadSecCompSa(); + return proxy_; +} +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS diff --git a/interfaces/inner_api/security_component/src/sec_comp_death_recipient.cpp b/interfaces/inner_api/security_component/src/sec_comp_death_recipient.cpp new file mode 100644 index 0000000..bbdf7fc --- /dev/null +++ b/interfaces/inner_api/security_component/src/sec_comp_death_recipient.cpp @@ -0,0 +1,28 @@ +/* + * 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 "sec_comp_death_recipient.h" + +#include "sec_comp_client.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +void SecCompDeathRecipient::OnRemoteDied(const wptr& object) +{ + SecCompClient::GetInstance().OnRemoteDiedHandle(); +} +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS diff --git a/interfaces/inner_api/security_component/src/sec_comp_kit.cpp b/interfaces/inner_api/security_component/src/sec_comp_kit.cpp new file mode 100644 index 0000000..05b7bd2 --- /dev/null +++ b/interfaces/inner_api/security_component/src/sec_comp_kit.cpp @@ -0,0 +1,138 @@ +/* + * 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 "sec_comp_kit.h" + +#include "hisysevent.h" +#include "ipc_skeleton.h" +#include "sec_comp_caller_authorization.h" +#include "sec_comp_client.h" +#include "sec_comp_enhance_adapter.h" +#include "sec_comp_log.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +namespace { +static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompKit"}; +} // namespace + +int32_t SecCompKit::RegisterSecurityComponent(SecCompType type, + std::string& componentInfo, int32_t& scId) +{ + if (!SecCompCallerAuthorization::GetInstance().IsKitCaller( + reinterpret_cast(__builtin_return_address(0)))) { + SC_LOG_ERROR(LABEL, "register security component fail, caller invalid"); + HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::SEC_COMPONENT, "CALLER_CHECK_FAILED", + HiviewDFX::HiSysEvent::EventType::SECURITY, "CALLER_UID", IPCSkeleton::GetCallingUid(), + "CALLER_PID", IPCSkeleton::GetCallingPid(), "CALL_SCENE", "REGITSTER"); + return SC_SERVICE_ERROR_CALLER_INVALID; + } + + if (!SecCompEnhanceAdapter::EnhanceDataPreprocess(componentInfo)) { + SC_LOG_ERROR(LABEL, "Preprocess security component fail"); + return SC_ENHANCE_ERROR_VALUE_INVALID; + } + + int32_t res = SecCompClient::GetInstance().RegisterSecurityComponent(type, componentInfo, scId); + if (res != SC_OK) { + SC_LOG_ERROR(LABEL, "register security component fail, error: %{public}d", res); + return res; + } + SecCompEnhanceAdapter::RegisterScIdEnhance(scId); + HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::SEC_COMPONENT, "REGISTER_SUCCESS", + HiviewDFX::HiSysEvent::EventType::BEHAVIOR, "CALLER_UID", IPCSkeleton::GetCallingUid(), + "CALLER_PID", IPCSkeleton::GetCallingPid(), "SC_ID", scId, "SC_TYPE", type); + return res; +} + +int32_t SecCompKit::UpdateSecurityComponent(int32_t scId, std::string& componentInfo) +{ + if (!SecCompCallerAuthorization::GetInstance().IsKitCaller( + reinterpret_cast(__builtin_return_address(0)))) { + SC_LOG_ERROR(LABEL, "update security component fail, caller invalid"); + HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::SEC_COMPONENT, "CALLER_CHECK_FAILED", + HiviewDFX::HiSysEvent::EventType::SECURITY, "CALLER_UID", IPCSkeleton::GetCallingUid(), + "CALLER_PID", IPCSkeleton::GetCallingPid(), "CALL_SCENE", "UPDATE"); + return SC_SERVICE_ERROR_CALLER_INVALID; + } + + if (!SecCompEnhanceAdapter::EnhanceDataPreprocess(scId, componentInfo)) { + SC_LOG_ERROR(LABEL, "Preprocess security component fail"); + return SC_ENHANCE_ERROR_VALUE_INVALID; + } + + int32_t res = SecCompClient::GetInstance().UpdateSecurityComponent(scId, componentInfo); + if (res != SC_OK) { + SC_LOG_ERROR(LABEL, "update security component fail, error: %{public}d", res); + } + return res; +} + +int32_t SecCompKit::UnregisterSecurityComponent(int32_t scId) +{ + int32_t res = SecCompClient::GetInstance().UnregisterSecurityComponent(scId); + SecCompEnhanceAdapter::UnregisterScIdEnhance(scId); + if (res != SC_OK) { + SC_LOG_ERROR(LABEL, "unregister security component fail, error: %{public}d", res); + return res; + } + HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::SEC_COMPONENT, "UNREGISTER_SUCCESS", + HiviewDFX::HiSysEvent::EventType::BEHAVIOR, "CALLER_UID", IPCSkeleton::GetCallingUid(), + "CALLER_PID", IPCSkeleton::GetCallingPid(), "SC_ID", scId); + return res; +} + +int32_t SecCompKit::ReportSecurityComponentClickEvent(int32_t scId, + std::string& componentInfo, const SecCompClickEvent& touchInfo, sptr callerToken) +{ + if (!SecCompCallerAuthorization::GetInstance().IsKitCaller( + reinterpret_cast(__builtin_return_address(0)))) { + SC_LOG_ERROR(LABEL, "report click event fail, caller invalid"); + HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::SEC_COMPONENT, "CALLER_CHECK_FAILED", + HiviewDFX::HiSysEvent::EventType::SECURITY, "CALLER_UID", IPCSkeleton::GetCallingUid(), + "CALLER_PID", IPCSkeleton::GetCallingPid(), "CALL_SCENE", "CLICK"); + return SC_SERVICE_ERROR_CALLER_INVALID; + } + + if (!SecCompEnhanceAdapter::EnhanceDataPreprocess(scId, componentInfo)) { + SC_LOG_ERROR(LABEL, "Preprocess security component fail"); + return SC_ENHANCE_ERROR_VALUE_INVALID; + } + + int32_t res = + SecCompClient::GetInstance().ReportSecurityComponentClickEvent(scId, componentInfo, touchInfo, callerToken); + if (res != SC_OK) { + SC_LOG_ERROR(LABEL, "report click event fail, error: %{public}d", res); + } + return res; +} + +bool SecCompKit::ReduceAfterVerifySavePermission(AccessToken::AccessTokenID tokenId) +{ + bool res = + SecCompClient::GetInstance().ReduceAfterVerifySavePermission(tokenId); + if (!res) { + SC_LOG_ERROR(LABEL, "verify temp save permission, error: %{public}d", res); + } + return res; +} + +sptr SecCompKit::GetEnhanceRemoteObject(bool isLoad) +{ + return SecCompClient::GetInstance().GetEnhanceRemoteObject(isLoad); +} +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS diff --git a/interfaces/inner_api/security_component/src/sec_comp_load_callback.cpp b/interfaces/inner_api/security_component/src/sec_comp_load_callback.cpp new file mode 100644 index 0000000..8fd9f26 --- /dev/null +++ b/interfaces/inner_api/security_component/src/sec_comp_load_callback.cpp @@ -0,0 +1,61 @@ +/* + * 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 "sec_comp_load_callback.h" + +#include "i_sec_comp_service.h" +#include "sec_comp_client.h" +#include "sec_comp_log.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +namespace { +static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompClient"}; +} // namespace +SecCompLoadCallback::SecCompLoadCallback() {} + +void SecCompLoadCallback::OnLoadSystemAbilitySuccess( + int32_t systemAbilityId, const sptr& remoteObject) +{ + if (systemAbilityId != SA_ID_SECURITY_COMPONENT_SERVICE) { + SC_LOG_ERROR(LABEL, "start systemabilityId is not security_component!"); + return; + } + + if (remoteObject == nullptr) { + SC_LOG_ERROR(LABEL, "remoteObject is null."); + SecCompClient::GetInstance().FinishStartSAFail(); + return; + } + + SC_LOG_INFO(LABEL, "Start systemAbilityId: %{public}d success!", systemAbilityId); + + SecCompClient::GetInstance().FinishStartSASuccess(remoteObject); +} + +void SecCompLoadCallback::OnLoadSystemAbilityFail(int32_t systemAbilityId) +{ + if (systemAbilityId != SA_ID_SECURITY_COMPONENT_SERVICE) { + SC_LOG_ERROR(LABEL, "start systemabilityId is not security_component!"); + return; + } + + SC_LOG_ERROR(LABEL, "Start systemAbilityId: %{public}d failed.", systemAbilityId); + + SecCompClient::GetInstance().FinishStartSAFail(); +} +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS diff --git a/interfaces/inner_api/security_component/src/sec_comp_proxy.cpp b/interfaces/inner_api/security_component/src/sec_comp_proxy.cpp new file mode 100644 index 0000000..3d8e205 --- /dev/null +++ b/interfaces/inner_api/security_component/src/sec_comp_proxy.cpp @@ -0,0 +1,274 @@ +/* + * 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 "sec_comp_proxy.h" + +#include "sec_comp_click_event_parcel.h" +#include "sec_comp_err.h" +#include "sec_comp_log.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +namespace { +static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompProxy"}; +} + +SecCompProxy::SecCompProxy(const sptr& impl) : IRemoteProxy(impl) +{} + +SecCompProxy::~SecCompProxy() +{} + +int32_t SecCompProxy::RegisterSecurityComponent(SecCompType type, + const std::string& componentInfo, int32_t& scId) +{ + MessageParcel data; + if (!data.WriteInterfaceToken(SecCompProxy::GetDescriptor())) { + SC_LOG_ERROR(LABEL, "Write descriptor fail"); + return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; + } + + if (!data.WriteUint32(type)) { + SC_LOG_ERROR(LABEL, "Write Uint32 fail"); + return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; + } + if (!data.WriteString(componentInfo)) { + SC_LOG_ERROR(LABEL, "Write string fail"); + return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; + } + + MessageParcel reply; + MessageOption option(MessageOption::TF_SYNC); + sptr remote = Remote(); + if (remote == nullptr) { + SC_LOG_ERROR(LABEL, "Remote service is null"); + return SC_SERVICE_ERROR_IPC_REQUEST_FAIL; + } + int32_t requestResult = remote->SendRequest( + static_cast(SecurityComponentServiceInterfaceCode::REGISTER_SECURITY_COMPONENT), + data, reply, option); + if (requestResult != SC_OK) { + SC_LOG_ERROR(LABEL, "Request fail, result: %{public}d", requestResult); + return requestResult; + } + int32_t res; + if (!reply.ReadInt32(res)) { + SC_LOG_ERROR(LABEL, "Read result int32 fail"); + return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; + } + + if (!reply.ReadInt32(scId)) { + SC_LOG_ERROR(LABEL, "Read scId int32 fail"); + return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; + } + return res; +} + +int32_t SecCompProxy::UpdateSecurityComponent(int32_t scId, const std::string& componentInfo) +{ + MessageParcel data; + if (!data.WriteInterfaceToken(SecCompProxy::GetDescriptor())) { + SC_LOG_ERROR(LABEL, "Write descriptor fail"); + return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; + } + + if (!data.WriteInt32(scId)) { + SC_LOG_ERROR(LABEL, "Write Int32 fail"); + return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; + } + if (!data.WriteString(componentInfo)) { + SC_LOG_ERROR(LABEL, "Write string fail"); + return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; + } + + MessageParcel reply; + MessageOption option(MessageOption::TF_SYNC); + sptr remote = Remote(); + if (remote == nullptr) { + SC_LOG_ERROR(LABEL, "Remote service is null"); + return SC_SERVICE_ERROR_IPC_REQUEST_FAIL; + } + int32_t requestResult = remote->SendRequest( + static_cast(SecurityComponentServiceInterfaceCode::UPDATE_SECURITY_COMPONENT), data, reply, option); + if (requestResult != SC_OK) { + SC_LOG_ERROR(LABEL, "Request fail, result: %{public}d", requestResult); + return requestResult; + } + int32_t res; + if (!reply.ReadInt32(res)) { + SC_LOG_ERROR(LABEL, "Read result int32 fail"); + return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; + } + return res; +} + +int32_t SecCompProxy::UnregisterSecurityComponent(int32_t scId) +{ + MessageParcel data; + if (!data.WriteInterfaceToken(SecCompProxy::GetDescriptor())) { + SC_LOG_ERROR(LABEL, "Write descriptor fail"); + return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; + } + + if (!data.WriteInt32(scId)) { + SC_LOG_ERROR(LABEL, "Write Int32 fail"); + return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; + } + + MessageParcel reply; + MessageOption option(MessageOption::TF_SYNC); + sptr remote = Remote(); + if (remote == nullptr) { + SC_LOG_ERROR(LABEL, "Remote service is null"); + return SC_SERVICE_ERROR_IPC_REQUEST_FAIL; + } + int32_t requestResult = remote->SendRequest( + static_cast(SecurityComponentServiceInterfaceCode::UNREGISTER_SECURITY_COMPONENT), + data, reply, option); + if (requestResult != SC_OK) { + SC_LOG_ERROR(LABEL, "Request fail, result: %{public}d", requestResult); + return requestResult; + } + int32_t res; + if (!reply.ReadInt32(res)) { + SC_LOG_ERROR(LABEL, "Read int32 fail"); + return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; + } + return res; +} + +int32_t SecCompProxy::ReportSecurityComponentClickEvent(int32_t scId, + const std::string& componentInfo, const SecCompClickEvent& touchInfo, sptr callerToken) +{ + MessageParcel data; + if (!data.WriteInterfaceToken(SecCompProxy::GetDescriptor())) { + SC_LOG_ERROR(LABEL, "Write descriptor fail"); + return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; + } + + if (!data.WriteInt32(scId)) { + SC_LOG_ERROR(LABEL, "Write Uint32 fail"); + return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; + } + + if (!data.WriteString(componentInfo)) { + SC_LOG_ERROR(LABEL, "Write string fail"); + return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; + } + + sptr parcel = new (std::nothrow) SecCompClickEventParcel(); + if (parcel == nullptr) { + SC_LOG_ERROR(LABEL, "New click event parcel failed"); + return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; + } + parcel->touchInfoParams_ = touchInfo; + if (!data.WriteParcelable(parcel)) { + SC_LOG_ERROR(LABEL, "Write touchInfo fail"); + return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; + } + + if ((callerToken != nullptr) && !data.WriteRemoteObject(callerToken)) { + SC_LOG_ERROR(LABEL, "Write caller token fail"); + return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; + } + + MessageParcel reply; + MessageOption option(MessageOption::TF_SYNC); + sptr remote = Remote(); + if (remote == nullptr) { + SC_LOG_ERROR(LABEL, "Remote service is null"); + return SC_SERVICE_ERROR_IPC_REQUEST_FAIL; + } + int32_t requestResult = remote->SendRequest( + static_cast(SecurityComponentServiceInterfaceCode::REPORT_SECURITY_COMPONENT_CLICK_EVENT), + data, reply, option); + if (requestResult != SC_OK) { + SC_LOG_ERROR(LABEL, "Request fail, result: %{public}d", requestResult); + return requestResult; + } + int32_t res; + if (!reply.ReadInt32(res)) { + SC_LOG_ERROR(LABEL, "Read int32 fail"); + return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; + } + return res; +} + +bool SecCompProxy::ReduceAfterVerifySavePermission(AccessToken::AccessTokenID tokenId) +{ + MessageParcel data; + if (!data.WriteInterfaceToken(SecCompProxy::GetDescriptor())) { + SC_LOG_ERROR(LABEL, "Write descriptor fail"); + return false; + } + + if (!data.WriteUint32(tokenId)) { + SC_LOG_ERROR(LABEL, "Write Uint32 fail"); + return false; + } + + MessageParcel reply; + MessageOption option(MessageOption::TF_SYNC); + sptr remote = Remote(); + if (remote == nullptr) { + SC_LOG_ERROR(LABEL, "Remote service is null"); + return false; + } + int32_t requestResult = remote->SendRequest( + static_cast(SecurityComponentServiceInterfaceCode::VERIFY_TEMP_SAVE_PERMISSION), + data, reply, option); + if (requestResult != SC_OK) { + SC_LOG_ERROR(LABEL, "Request fail, result: %{public}d", requestResult); + return false; + } + bool res; + if (!reply.ReadBool(res)) { + SC_LOG_ERROR(LABEL, "Read bool fail"); + return false; + } + return res; +} + +sptr SecCompProxy::GetEnhanceRemoteObject() +{ + MessageParcel data; + if (!data.WriteInterfaceToken(SecCompProxy::GetDescriptor())) { + SC_LOG_ERROR(LABEL, "Write descriptor fail"); + return nullptr; + } + + MessageParcel reply; + MessageOption option(MessageOption::TF_SYNC); + sptr remote = Remote(); + if (remote == nullptr) { + SC_LOG_ERROR(LABEL, "Remote service is null"); + return nullptr; + } + int32_t requestResult = remote->SendRequest( + static_cast(SecurityComponentServiceInterfaceCode::GET_SECURITY_COMPONENT_ENHANCE_OBJECT), + data, reply, option); + if (requestResult != SC_OK) { + SC_LOG_ERROR(LABEL, "Request fail, result: %{public}d", requestResult); + return nullptr; + } + sptr callback = reply.ReadRemoteObject(); + if (callback == nullptr) { + SC_LOG_ERROR(LABEL, "Read remote object fail"); + } + return callback; +} +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS diff --git a/interfaces/inner_api/security_component/src/sec_comp_ui_register.cpp b/interfaces/inner_api/security_component/src/sec_comp_ui_register.cpp new file mode 100644 index 0000000..a94215f --- /dev/null +++ b/interfaces/inner_api/security_component/src/sec_comp_ui_register.cpp @@ -0,0 +1,39 @@ +/* + * 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 "sec_comp_ui_register.h" + +#include "sec_comp_caller_authorization.h" +#include "sec_comp_log.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +namespace { +static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { + LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompUiRegister"}; +} // namespace + +ISecCompProbe* SecCompUiRegister::callbackProbe = nullptr; + +SecCompUiRegister::SecCompUiRegister(std::vector& callerList, ISecCompProbe* probe) +{ + SC_LOG_INFO(LABEL, "Init"); + SecCompCallerAuthorization::GetInstance().RegisterSecCompKitCaller(callerList); + callbackProbe = probe; +} +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS + diff --git a/interfaces/inner_api/security_component/test/BUILD.gn b/interfaces/inner_api/security_component/test/BUILD.gn new file mode 100644 index 0000000..fdba91b --- /dev/null +++ b/interfaces/inner_api/security_component/test/BUILD.gn @@ -0,0 +1,93 @@ +# 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("//build/test.gni") + +sec_comp_root_dir = "../../../.." + +ohos_unittest("sec_comp_sdk_test") { + subsystem_name = "security" + part_name = "security_component" + module_out_path = part_name + "/" + part_name + + include_dirs = [ + "${sec_comp_root_dir}/frameworks/common/include", + "${sec_comp_root_dir}/frameworks/security_component/include", + "${sec_comp_root_dir}/interfaces/inner_api/security_component/include", + ] + + sources = [ + "unittest/src/location_button_test.cpp", + "unittest/src/paste_button_test.cpp", + "unittest/src/save_button_test.cpp", + "unittest/src/sec_comp_kit_test.cpp", + "unittest/src/test_common.cpp", + ] + configs = [ "${sec_comp_root_dir}/config:coverage_flags" ] + cflags_cc = [ "-DHILOG_ENABLE" ] + + deps = [ + "${sec_comp_root_dir}/frameworks:libsecurity_component_framework", + "${sec_comp_root_dir}/interfaces/inner_api/security_component:libsecurity_component_sdk", + ] + + external_deps = [ + "access_token:libaccesstoken_sdk", + "c_utils:utils", + "hilog:libhilog", + "hisysevent:libhisysevent", + "ipc:ipc_core", + ] +} + +ohos_unittest("sec_comp_register_callback_test") { + subsystem_name = "security" + part_name = "security_component" + module_out_path = part_name + "/" + part_name + + include_dirs = [ + "${sec_comp_root_dir}/frameworks/common/include", + "${sec_comp_root_dir}/frameworks/security_component/include", + "${sec_comp_root_dir}/interfaces/inner_api/security_component/include", + ] + + sources = [ + "unittest/src/sec_comp_register_callback_test.cpp", + "unittest/src/test_common.cpp", + ] + configs = [ "${sec_comp_root_dir}/config:coverage_flags" ] + cflags_cc = [ "-DHILOG_ENABLE" ] + + deps = [ + "${sec_comp_root_dir}/frameworks:libsecurity_component_enhance_adapter", + "${sec_comp_root_dir}/frameworks:libsecurity_component_framework", + "${sec_comp_root_dir}/interfaces/inner_api/security_component:libsecurity_component_sdk", + ] + + external_deps = [ + "access_token:libaccesstoken_sdk", + "access_token:libtoken_setproc", + "c_utils:utils", + "hilog:libhilog", + "hisysevent:libhisysevent", + "ipc:ipc_core", + ] +} + +group("unittest") { + testonly = true + deps = [ + ":sec_comp_register_callback_test", + ":sec_comp_sdk_test", + ] +} diff --git a/interfaces/inner_api/security_component/test/unittest/src/location_button_test.cpp b/interfaces/inner_api/security_component/test/unittest/src/location_button_test.cpp new file mode 100644 index 0000000..972d4c2 --- /dev/null +++ b/interfaces/inner_api/security_component/test/unittest/src/location_button_test.cpp @@ -0,0 +1,551 @@ +/* + * 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 "location_button_test.h" + +#include +#include "sec_comp_log.h" +#include "sec_comp_err.h" +#include "test_common.h" + +using namespace testing::ext; +using namespace OHOS; +using namespace OHOS::Security::SecurityComponent; + +namespace { +static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { + LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "LocationButtonTest"}; +} + +void LocationButtonTest::SetUpTestCase() +{} + +void LocationButtonTest::TearDownTestCase() +{} + +void LocationButtonTest::SetUp() +{ + SC_LOG_INFO(LABEL, "setup"); +} + +void LocationButtonTest::TearDown() +{} + +/** + * @tc.name: FromJson001 + * @tc.desc: Test LocationButton from json success + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(LocationButtonTest, FromJson001, TestSize.Level1) +{ + nlohmann::json jsonComponent; + TestCommon::BuildLocationComponentInfo(jsonComponent); + LocationButton comp; + ASSERT_TRUE(comp.FromJson(jsonComponent)); +} + +/** + * @tc.name: FromJson002 + * @tc.desc: Test empty LocationButton from json + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(LocationButtonTest, FromJson002, TestSize.Level1) +{ + nlohmann::json jsonComponent; + LocationButton comp; + ASSERT_FALSE(comp.FromJson(jsonComponent)); +} + +/** + * @tc.name: FromJson003 + * @tc.desc: Test location button from wrong type json + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(LocationButtonTest, FromJson003, TestSize.Level1) +{ + nlohmann::json jsonComponent; + TestCommon::BuildLocationComponentInfo(jsonComponent); + LocationButton comp; + ASSERT_TRUE(comp.FromJson(jsonComponent)); + + jsonComponent[JsonTagConstants::JSON_SC_TYPE] = WRONG_TYPE; + ASSERT_FALSE(comp.FromJson(jsonComponent)); + + jsonComponent[JsonTagConstants::JSON_SC_TYPE] = 0; + ASSERT_FALSE(comp.FromJson(jsonComponent)); +} + +/** + * @tc.name: FromJson004 + * @tc.desc: Test location button from wrong rect json + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(LocationButtonTest, FromJson004, TestSize.Level1) +{ + nlohmann::json jsonComponent; + LocationButton comp; + jsonComponent[JsonTagConstants::JSON_SC_TYPE] = LOCATION_COMPONENT; + nlohmann::json wrongJson = nlohmann::json::parse("{", nullptr, false); + jsonComponent[JsonTagConstants::JSON_RECT] = wrongJson; + ASSERT_FALSE(comp.FromJson(jsonComponent)); + + TestCommon::BuildLocationComponentInfo(jsonComponent); + ASSERT_TRUE(comp.FromJson(jsonComponent)); + + jsonComponent[JsonTagConstants::JSON_RECT] = nlohmann::json { + {JsonTagConstants::JSON_RECT_X, WRONG_TYPE}, + {JsonTagConstants::JSON_RECT_Y, TEST_COORDINATE}, + {JsonTagConstants::JSON_RECT_WIDTH, TEST_COORDINATE}, + {JsonTagConstants::JSON_RECT_HEIGHT, TEST_COORDINATE} + }; + ASSERT_FALSE(comp.FromJson(jsonComponent)); + + jsonComponent[JsonTagConstants::JSON_RECT] = nlohmann::json { + {JsonTagConstants::JSON_RECT_X, TEST_COORDINATE}, + {JsonTagConstants::JSON_RECT_Y, WRONG_TYPE}, + {JsonTagConstants::JSON_RECT_WIDTH, TEST_COORDINATE}, + {JsonTagConstants::JSON_RECT_HEIGHT, TEST_COORDINATE} + }; + ASSERT_FALSE(comp.FromJson(jsonComponent)); + + jsonComponent[JsonTagConstants::JSON_RECT] = nlohmann::json { + {JsonTagConstants::JSON_RECT_X, TEST_COORDINATE}, + {JsonTagConstants::JSON_RECT_Y, TEST_COORDINATE}, + {JsonTagConstants::JSON_RECT_WIDTH, WRONG_TYPE}, + {JsonTagConstants::JSON_RECT_HEIGHT, TEST_COORDINATE} + }; + ASSERT_FALSE(comp.FromJson(jsonComponent)); + + jsonComponent[JsonTagConstants::JSON_RECT] = nlohmann::json { + {JsonTagConstants::JSON_RECT_X, TEST_COORDINATE}, + {JsonTagConstants::JSON_RECT_Y, TEST_COORDINATE}, + {JsonTagConstants::JSON_RECT_WIDTH, TEST_COORDINATE}, + {JsonTagConstants::JSON_RECT_HEIGHT, WRONG_TYPE} + }; + ASSERT_FALSE(comp.FromJson(jsonComponent)); +} + +/** + * @tc.name: FromJson005 + * @tc.desc: Test location button from wrong size json + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(LocationButtonTest, FromJson005, TestSize.Level1) +{ + nlohmann::json jsonComponent; + LocationButton comp; + TestCommon::BuildLocationComponentInfo(jsonComponent); + ASSERT_TRUE(comp.FromJson(jsonComponent)); + + nlohmann::json jsonPadding = nlohmann::json { + { JsonTagConstants::JSON_PADDING_TOP_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_RIGHT_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_LEFT_TAG, TEST_DIMENSION }, + }; + + jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_SIZE_TAG, WRONG_TYPE }, + { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, + }; + ASSERT_FALSE(comp.FromJson(jsonComponent)); + + jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_ICON_SIZE_TAG, WRONG_TYPE }, + { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, + }; + ASSERT_FALSE(comp.FromJson(jsonComponent)); + + jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, WRONG_TYPE }, + { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, + }; + ASSERT_FALSE(comp.FromJson(jsonComponent)); +} + +/** + * @tc.name: FromJson006 + * @tc.desc: Test location button from wrong size json + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(LocationButtonTest, FromJson006, TestSize.Level1) +{ + nlohmann::json jsonComponent; + LocationButton comp; + TestCommon::BuildLocationComponentInfo(jsonComponent); + ASSERT_TRUE(comp.FromJson(jsonComponent)); + + nlohmann::json jsonPadding = nlohmann::json { + { JsonTagConstants::JSON_PADDING_TOP_TAG, WRONG_TYPE }, + { JsonTagConstants::JSON_PADDING_RIGHT_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_LEFT_TAG, TEST_DIMENSION }, + }; + jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, + }; + ASSERT_FALSE(comp.FromJson(jsonComponent)); + + jsonPadding = nlohmann::json { + { JsonTagConstants::JSON_PADDING_TOP_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_RIGHT_TAG, WRONG_TYPE }, + { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_LEFT_TAG, TEST_DIMENSION }, + }; + jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, + }; + ASSERT_FALSE(comp.FromJson(jsonComponent)); +} + +/** + * @tc.name: FromJson007 + * @tc.desc: Test location button from wrong size json + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(LocationButtonTest, FromJson007, TestSize.Level1) +{ + nlohmann::json jsonComponent; + LocationButton comp; + TestCommon::BuildLocationComponentInfo(jsonComponent); + ASSERT_TRUE(comp.FromJson(jsonComponent)); + + nlohmann::json jsonPadding = nlohmann::json { + { JsonTagConstants::JSON_PADDING_TOP_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_RIGHT_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, WRONG_TYPE }, + { JsonTagConstants::JSON_PADDING_LEFT_TAG, TEST_DIMENSION }, + }; + jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, + }; + ASSERT_FALSE(comp.FromJson(jsonComponent)); + + jsonPadding = nlohmann::json { + { JsonTagConstants::JSON_PADDING_TOP_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_RIGHT_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_LEFT_TAG, WRONG_TYPE }, + }; + jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, + }; + ASSERT_FALSE(comp.FromJson(jsonComponent)); +} + +/** + * @tc.name: FromJson008 + * @tc.desc: Test location button from wrong border and parent json + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(LocationButtonTest, FromJson008, TestSize.Level1) +{ + nlohmann::json jsonComponent; + LocationButton comp; + TestCommon::BuildLocationComponentInfo(jsonComponent); + ASSERT_TRUE(comp.FromJson(jsonComponent)); + + jsonComponent[JsonTagConstants::JSON_BORDER_TAG] = nlohmann::json { + { JsonTagConstants::JSON_BORDER_WIDTH_TAG, WRONG_TYPE }, + }; + ASSERT_FALSE(comp.FromJson(jsonComponent)); + + TestCommon::BuildLocationComponentInfo(jsonComponent); + jsonComponent[JsonTagConstants::JSON_PARENT_TAG] = nlohmann::json { + { JsonTagConstants::JSON_PARENT_EFFECT_TAG, WRONG_TYPE }, + }; + ASSERT_FALSE(comp.FromJson(jsonComponent)); +} + +/** + * @tc.name: FromJson009 + * @tc.desc: Test location button from wrong type params json + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(LocationButtonTest, FromJson009, TestSize.Level1) +{ + nlohmann::json jsonComponent; + TestCommon::BuildLocationComponentInfo(jsonComponent); + LocationButton button; + ASSERT_TRUE(button.FromJson(jsonComponent)); + + jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_TEXT_TAG, WRONG_TYPE }, + { JsonTagConstants::JSON_ICON_TAG, LocationIcon::LINE_ICON }, + { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, + }; + ASSERT_FALSE(button.FromJson(jsonComponent)); + + jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_TEXT_TAG, LocationDesc::SELECT_LOCATION }, + { JsonTagConstants::JSON_ICON_TAG, WRONG_TYPE }, + { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, + }; + ASSERT_FALSE(button.FromJson(jsonComponent)); + + jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_TEXT_TAG, LocationDesc::SELECT_LOCATION }, + { JsonTagConstants::JSON_ICON_TAG, LocationIcon::LINE_ICON }, + { JsonTagConstants::JSON_BG_TAG, WRONG_TYPE }, + }; + ASSERT_FALSE(button.FromJson(jsonComponent)); +} + +/** + * @tc.name: FromJson010 + * @tc.desc: Test location button from wrong type params json + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(LocationButtonTest, FromJson010, TestSize.Level1) +{ + nlohmann::json jsonComponent; + TestCommon::BuildLocationComponentInfo(jsonComponent); + LocationButton button; + ASSERT_TRUE(button.FromJson(jsonComponent)); + + jsonComponent[JsonTagConstants::JSON_COLORS_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_COLOR_TAG, WRONG_TYPE }, + { JsonTagConstants::JSON_ICON_COLOR_TAG, TEST_COLOR_BLUE }, + { JsonTagConstants::JSON_BG_COLOR_TAG, TEST_COLOR_YELLOW } + }; + ASSERT_FALSE(button.FromJson(jsonComponent)); + + jsonComponent[JsonTagConstants::JSON_COLORS_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_COLOR_TAG, TEST_COLOR_RED }, + { JsonTagConstants::JSON_ICON_COLOR_TAG, WRONG_TYPE }, + { JsonTagConstants::JSON_BG_COLOR_TAG, TEST_COLOR_YELLOW } + }; + ASSERT_FALSE(button.FromJson(jsonComponent)); + + jsonComponent[JsonTagConstants::JSON_COLORS_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_COLOR_TAG, TEST_COLOR_RED }, + { JsonTagConstants::JSON_ICON_COLOR_TAG, TEST_COLOR_BLUE }, + { JsonTagConstants::JSON_BG_COLOR_TAG, WRONG_TYPE } + }; + ASSERT_FALSE(button.FromJson(jsonComponent)); +} + +/** + * @tc.name: FromJson011 + * @tc.desc: Test location button from wrong value params json + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(LocationButtonTest, FromJson011, TestSize.Level1) +{ + nlohmann::json jsonComponent; + TestCommon::BuildLocationComponentInfo(jsonComponent); + LocationButton button; + + ASSERT_TRUE(button.FromJson(jsonComponent)); + + jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_TEXT_TAG, UNKNOWN_TEXT }, + { JsonTagConstants::JSON_ICON_TAG, LocationIcon::LINE_ICON }, + { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, + }; + ASSERT_FALSE(button.FromJson(jsonComponent)); + + jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_TEXT_TAG, LocationDesc::SELECT_LOCATION }, + { JsonTagConstants::JSON_ICON_TAG, UNKNOWN_ICON }, + { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, + }; + ASSERT_FALSE(button.FromJson(jsonComponent)); + + jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_TEXT_TAG, LocationDesc::SELECT_LOCATION }, + { JsonTagConstants::JSON_ICON_TAG, LocationIcon::LINE_ICON }, + { JsonTagConstants::JSON_BG_TAG, SecCompBackground::UNKNOWN_BG }, + }; + ASSERT_FALSE(button.FromJson(jsonComponent)); + + jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_TEXT_TAG, LocationDesc::MAX_LABEL_TYPE }, + { JsonTagConstants::JSON_ICON_TAG, LocationIcon::LINE_ICON }, + { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, + }; + ASSERT_FALSE(button.FromJson(jsonComponent)); + + jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_TEXT_TAG, LocationDesc::SELECT_LOCATION }, + { JsonTagConstants::JSON_ICON_TAG, LocationIcon::MAX_ICON_TYPE }, + { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, + }; + ASSERT_FALSE(button.FromJson(jsonComponent)); + + jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_TEXT_TAG, LocationDesc::SELECT_LOCATION }, + { JsonTagConstants::JSON_ICON_TAG, LocationIcon::LINE_ICON }, + { JsonTagConstants::JSON_BG_TAG, SecCompBackground::MAX_BG_TYPE }, + }; + ASSERT_FALSE(button.FromJson(jsonComponent)); +} + +/** + * @tc.name: ToJsonStr001 + * @tc.desc: Test ToJsonStr normal branch + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(LocationButtonTest, ToJsonStr001, TestSize.Level1) +{ + nlohmann::json jsonComponent; + TestCommon::BuildLocationComponentInfo(jsonComponent); + LocationButton button; + + ASSERT_TRUE(button.FromJson(jsonComponent)); + ASSERT_EQ(jsonComponent.dump(), button.ToJsonStr()); +} + +/** + * @tc.name: CompareComponentBasicInfo001 + * @tc.desc: Test CompareComponentBasicInfo other is null + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(LocationButtonTest, CompareComponentBasicInfo001, TestSize.Level1) +{ + nlohmann::json jsonComponent; + TestCommon::BuildLocationComponentInfo(jsonComponent); + LocationButton button; + + ASSERT_FALSE(button.CompareComponentBasicInfo(nullptr, true)); +} + +/** + * @tc.name: CompareLocationButton001 + * @tc.desc: Test LocationButton compare + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(LocationButtonTest, CompareLocationButton001, TestSize.Level1) +{ + LocationButton button1; + LocationButton button2; + + nlohmann::json jsonComponent; + TestCommon::BuildLocationComponentInfo(jsonComponent); + + ASSERT_TRUE(button1.FromJson(jsonComponent)); + ASSERT_TRUE(button2.FromJson(jsonComponent)); + ASSERT_TRUE(button1.CompareComponentBasicInfo(&button2, true)); + + button1.text_ = UNKNOWN_TEXT; + ASSERT_FALSE(button1.CompareComponentBasicInfo(&button2, true)); + button1.text_ = static_cast(LocationDesc::SELECT_LOCATION); + + button1.icon_ = UNKNOWN_ICON; + ASSERT_FALSE(button1.CompareComponentBasicInfo(&button2, true)); + button1.icon_ = static_cast(LocationIcon::LINE_ICON); + + button1.bg_ = SecCompBackground::UNKNOWN_BG; + ASSERT_FALSE(button1.CompareComponentBasicInfo(&button2, true)); + button1.bg_ = SecCompBackground::CIRCLE; + + ASSERT_TRUE(button1.CompareComponentBasicInfo(&button2, true)); +} + +/** + * @tc.name: CompareLocationButton002 + * @tc.desc: Test LocationButton compare + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(LocationButtonTest, CompareLocationButton002, TestSize.Level1) +{ + nlohmann::json jsonComponent; + LocationButton comp1; + TestCommon::BuildLocationComponentInfo(jsonComponent); + ASSERT_TRUE(comp1.FromJson(jsonComponent)); + LocationButton comp2 = comp1; + + comp1.type_ = SAVE_COMPONENT; + ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); + comp1.type_ = LOCATION_COMPONENT; + + comp1.fontSize_ = DEFAULT_DIMENSION; + ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); + comp1.fontSize_ = TEST_SIZE; + + comp1.iconSize_ = DEFAULT_DIMENSION; + ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); + comp1.iconSize_ = TEST_SIZE; + + comp1.padding_.top = DEFAULT_DIMENSION; + ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); + comp1.padding_.top = TEST_DIMENSION; + + comp1.padding_.right = DEFAULT_DIMENSION; + ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); + comp1.padding_.right = TEST_DIMENSION; + + comp1.padding_.bottom = DEFAULT_DIMENSION; + ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); + comp1.padding_.bottom = TEST_DIMENSION; + + comp1.padding_.left = DEFAULT_DIMENSION; + ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); + comp1.padding_.left = TEST_DIMENSION; + + comp1.textIconSpace_ = DEFAULT_DIMENSION; + ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); + comp1.textIconSpace_ = TEST_SIZE; + + comp1.borderWidth_ = DEFAULT_DIMENSION; + ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); + comp1.borderWidth_ = TEST_SIZE; + + comp1.fontColor_.value = TEST_DIFF_COLOR; + ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); + comp1.fontColor_.value = TEST_COLOR_RED; + + comp1.bgColor_.value = TEST_DIFF_COLOR; + ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); + comp1.bgColor_.value = TEST_COLOR_YELLOW; + + comp1.iconColor_.value = TEST_DIFF_COLOR; + ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); + comp1.iconColor_.value = TEST_COLOR_BLUE; + + ASSERT_TRUE(comp1.CompareComponentBasicInfo(&comp2, true)); +} diff --git a/interfaces/inner_api/security_component/test/unittest/src/location_button_test.h b/interfaces/inner_api/security_component/test/unittest/src/location_button_test.h new file mode 100644 index 0000000..7324bd7 --- /dev/null +++ b/interfaces/inner_api/security_component/test/unittest/src/location_button_test.h @@ -0,0 +1,38 @@ +/* + * 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 SEC_COMP_LOCATION_BUTTON_TEST_H +#define SEC_COMP_LOCATION_BUTTON_TEST_H + +#include +#include "location_button.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +class LocationButtonTest : public testing::Test { +public: + static void SetUpTestCase(); + + static void TearDownTestCase(); + + void SetUp(); + + void TearDown(); +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // SEC_COMP_LOCATION_BUTTON_TEST_H diff --git a/interfaces/inner_api/security_component/test/unittest/src/paste_button_test.cpp b/interfaces/inner_api/security_component/test/unittest/src/paste_button_test.cpp new file mode 100644 index 0000000..4faa121 --- /dev/null +++ b/interfaces/inner_api/security_component/test/unittest/src/paste_button_test.cpp @@ -0,0 +1,198 @@ +/* + * 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 "paste_button_test.h" + +#include +#include "sec_comp_err.h" +#include "sec_comp_log.h" +#include "test_common.h" + +using namespace testing::ext; +using namespace OHOS; +using namespace OHOS::Security::SecurityComponent; + +namespace { +static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { + LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "PasteButtonTest"}; +} + +void PasteButtonTest::SetUpTestCase() +{} + +void PasteButtonTest::TearDownTestCase() +{} + +void PasteButtonTest::SetUp() +{ + SC_LOG_INFO(LABEL, "setup"); +} + +void PasteButtonTest::TearDown() +{} + +/** + * @tc.name: IsParamValid001 + * @tc.desc: Test paste button from wrong value params json + * @tc.type: FUNC + * @tc.require: AR000HO9JB + */ +HWTEST_F(PasteButtonTest, FromJson010, TestSize.Level1) +{ + nlohmann::json jsonComponent; + TestCommon::BuildPasteComponentInfo(jsonComponent); + PasteButton button; + + ASSERT_TRUE(button.FromJson(jsonComponent)); + + jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_TEXT_TAG, UNKNOWN_TEXT }, + { JsonTagConstants::JSON_ICON_TAG, PasteIcon::LINE_ICON }, + { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, + }; + ASSERT_FALSE(button.FromJson(jsonComponent)); + + jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_TEXT_TAG, PasteDesc::PASTE}, + { JsonTagConstants::JSON_ICON_TAG, UNKNOWN_ICON }, + { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, + }; + ASSERT_FALSE(button.FromJson(jsonComponent)); + + jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_TEXT_TAG, PasteDesc::PASTE }, + { JsonTagConstants::JSON_ICON_TAG, PasteIcon::LINE_ICON }, + { JsonTagConstants::JSON_BG_TAG, SecCompBackground::UNKNOWN_BG }, + }; + ASSERT_FALSE(button.FromJson(jsonComponent)); + + jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_TEXT_TAG, PasteDesc::MAX_LABEL_TYPE }, + { JsonTagConstants::JSON_ICON_TAG, PasteIcon::LINE_ICON }, + { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, + }; + ASSERT_FALSE(button.FromJson(jsonComponent)); + + jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_TEXT_TAG, PasteDesc::PASTE }, + { JsonTagConstants::JSON_ICON_TAG, PasteIcon::MAX_ICON_TYPE }, + { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, + }; + ASSERT_FALSE(button.FromJson(jsonComponent)); + + jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_TEXT_TAG, PasteDesc::PASTE }, + { JsonTagConstants::JSON_ICON_TAG, PasteIcon::LINE_ICON }, + { JsonTagConstants::JSON_BG_TAG, SecCompBackground::MAX_BG_TYPE }, + }; + ASSERT_FALSE(button.FromJson(jsonComponent)); +} + +/** + * @tc.name: ComparePasteButton001 + * @tc.desc: Test compare paste button + * @tc.type: FUNC + * @tc.require: AR000HO9JB + */ +HWTEST_F(PasteButtonTest, ComparePasteButton001, TestSize.Level1) +{ + PasteButton button1; + PasteButton button2; + + nlohmann::json jsonComponent; + TestCommon::BuildPasteComponentInfo(jsonComponent); + + ASSERT_TRUE(button1.FromJson(jsonComponent)); + ASSERT_TRUE(button2.FromJson(jsonComponent)); + ASSERT_TRUE(button1.CompareComponentBasicInfo(&button2, true)); + + button1.text_ = UNKNOWN_TEXT; + ASSERT_FALSE(button1.CompareComponentBasicInfo(&button2, true)); + button1.text_ = static_cast(PasteDesc::PASTE); + + button1.icon_ = UNKNOWN_ICON; + ASSERT_FALSE(button1.CompareComponentBasicInfo(&button2, true)); + button1.icon_ = static_cast(PasteIcon::LINE_ICON); + + button1.bg_ = SecCompBackground::UNKNOWN_BG; + ASSERT_FALSE(button1.CompareComponentBasicInfo(&button2, true)); + button1.bg_ = SecCompBackground::CIRCLE; + + ASSERT_TRUE(button1.CompareComponentBasicInfo(&button2, true)); +} + +/** + * @tc.name: ComparePasteButton002 + * @tc.desc: Test PasteButton compare + * @tc.type: FUNC + * @tc.require: AR000HO9JB + */ +HWTEST_F(PasteButtonTest, ComparePasteButton002, TestSize.Level1) +{ + nlohmann::json jsonComponent; + PasteButton comp1; + TestCommon::BuildPasteComponentInfo(jsonComponent); + ASSERT_TRUE(comp1.FromJson(jsonComponent)); + PasteButton comp2 = comp1; + + comp1.type_ = LOCATION_COMPONENT; + ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); + comp1.type_ = PASTE_COMPONENT; + + comp1.fontSize_ = DEFAULT_DIMENSION; + ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); + comp1.fontSize_ = TEST_SIZE; + + comp1.iconSize_ = DEFAULT_DIMENSION; + ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); + comp1.iconSize_ = TEST_SIZE; + + comp1.padding_.top = DEFAULT_DIMENSION; + ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); + comp1.padding_.top = TEST_DIMENSION; + + comp1.padding_.right = DEFAULT_DIMENSION; + ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); + comp1.padding_.right = TEST_DIMENSION; + + comp1.padding_.bottom = DEFAULT_DIMENSION; + ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); + comp1.padding_.bottom = TEST_DIMENSION; + + comp1.padding_.left = DEFAULT_DIMENSION; + ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); + comp1.padding_.left = TEST_DIMENSION; + + comp1.textIconSpace_ = DEFAULT_DIMENSION; + ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); + comp1.textIconSpace_ = TEST_SIZE; + + comp1.borderWidth_ = DEFAULT_DIMENSION; + ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); + comp1.borderWidth_ = TEST_SIZE; + + comp1.fontColor_.value = TEST_DIFF_COLOR; + ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); + comp1.fontColor_.value = TEST_COLOR_RED; + + comp1.bgColor_.value = TEST_DIFF_COLOR; + ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); + comp1.bgColor_.value = TEST_COLOR_YELLOW; + + comp1.iconColor_.value = TEST_DIFF_COLOR; + ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); + comp1.iconColor_.value = TEST_COLOR_BLUE; + + ASSERT_TRUE(comp1.CompareComponentBasicInfo(&comp2, true)); +} diff --git a/interfaces/inner_api/security_component/test/unittest/src/paste_button_test.h b/interfaces/inner_api/security_component/test/unittest/src/paste_button_test.h new file mode 100644 index 0000000..6e73d91 --- /dev/null +++ b/interfaces/inner_api/security_component/test/unittest/src/paste_button_test.h @@ -0,0 +1,38 @@ +/* + * 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 SEC_COMP_PASTE_BUTTON_TEST_H +#define SEC_COMP_PASTE_BUTTON_TEST_H + +#include +#include "paste_button.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +class PasteButtonTest : public testing::Test { +public: + static void SetUpTestCase(); + + static void TearDownTestCase(); + + void SetUp(); + + void TearDown(); +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // SEC_COMP_PASTE_BUTTON_TEST_H diff --git a/interfaces/inner_api/security_component/test/unittest/src/save_button_test.cpp b/interfaces/inner_api/security_component/test/unittest/src/save_button_test.cpp new file mode 100644 index 0000000..257b5cb --- /dev/null +++ b/interfaces/inner_api/security_component/test/unittest/src/save_button_test.cpp @@ -0,0 +1,198 @@ +/* + * 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 "save_button_test.h" + +#include +#include "sec_comp_log.h" +#include "sec_comp_err.h" +#include "test_common.h" + +using namespace testing::ext; +using namespace OHOS; +using namespace OHOS::Security::SecurityComponent; + +namespace { +static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { + LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SaveButtonTest"}; +} + +void SaveButtonTest::SetUpTestCase() +{} + +void SaveButtonTest::TearDownTestCase() +{} + +void SaveButtonTest::SetUp() +{ + SC_LOG_INFO(LABEL, "setup"); +} + +void SaveButtonTest::TearDown() +{} + +/** + * @tc.name: IsParamValid001 + * @tc.desc: Test save button from wrong value params json + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SaveButtonTest, FromJson010, TestSize.Level1) +{ + nlohmann::json jsonComponent; + TestCommon::BuildSaveComponentInfo(jsonComponent); + SaveButton button; + + ASSERT_TRUE(button.FromJson(jsonComponent)); + + jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_TEXT_TAG, UNKNOWN_TEXT }, + { JsonTagConstants::JSON_ICON_TAG, SaveIcon::LINE_ICON }, + { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, + }; + ASSERT_FALSE(button.FromJson(jsonComponent)); + + jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_TEXT_TAG, SaveDesc::DOWNLOAD}, + { JsonTagConstants::JSON_ICON_TAG, UNKNOWN_ICON }, + { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, + }; + ASSERT_FALSE(button.FromJson(jsonComponent)); + + jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_TEXT_TAG, SaveDesc::DOWNLOAD }, + { JsonTagConstants::JSON_ICON_TAG, SaveIcon::LINE_ICON }, + { JsonTagConstants::JSON_BG_TAG, SecCompBackground::UNKNOWN_BG }, + }; + ASSERT_FALSE(button.FromJson(jsonComponent)); + + jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_TEXT_TAG, SaveDesc::MAX_LABEL_TYPE }, + { JsonTagConstants::JSON_ICON_TAG, SaveIcon::LINE_ICON }, + { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, + }; + ASSERT_FALSE(button.FromJson(jsonComponent)); + + jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_TEXT_TAG, SaveDesc::DOWNLOAD }, + { JsonTagConstants::JSON_ICON_TAG, SaveIcon::MAX_ICON_TYPE }, + { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, + }; + ASSERT_FALSE(button.FromJson(jsonComponent)); + + jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_TEXT_TAG, SaveDesc::DOWNLOAD }, + { JsonTagConstants::JSON_ICON_TAG, SaveIcon::LINE_ICON }, + { JsonTagConstants::JSON_BG_TAG, SecCompBackground::MAX_BG_TYPE }, + }; + ASSERT_FALSE(button.FromJson(jsonComponent)); +} + +/** + * @tc.name: CompareSaveButton001 + * @tc.desc: Test compare save button + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SaveButtonTest, CompareSaveButton001, TestSize.Level1) +{ + SaveButton button1; + SaveButton button2; + + nlohmann::json jsonComponent; + TestCommon::BuildSaveComponentInfo(jsonComponent); + + ASSERT_TRUE(button1.FromJson(jsonComponent)); + ASSERT_TRUE(button2.FromJson(jsonComponent)); + ASSERT_TRUE(button1.CompareComponentBasicInfo(&button2, true)); + + button1.text_ = UNKNOWN_TEXT; + ASSERT_FALSE(button1.CompareComponentBasicInfo(&button2, true)); + button1.text_ = static_cast(SaveDesc::DOWNLOAD); + + button1.icon_ = UNKNOWN_ICON; + ASSERT_FALSE(button1.CompareComponentBasicInfo(&button2, true)); + button1.icon_ = static_cast(SaveIcon::LINE_ICON); + + button1.bg_ = SecCompBackground::UNKNOWN_BG; + ASSERT_FALSE(button1.CompareComponentBasicInfo(&button2, true)); + button1.bg_ = SecCompBackground::CIRCLE; + + ASSERT_TRUE(button1.CompareComponentBasicInfo(&button2, true)); +} + +/** + * @tc.name: CompareSaveButton002 + * @tc.desc: Test SaveButton compare + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SaveButtonTest, CompareSaveButton002, TestSize.Level1) +{ + nlohmann::json jsonComponent; + SaveButton comp1; + TestCommon::BuildSaveComponentInfo(jsonComponent); + ASSERT_TRUE(comp1.FromJson(jsonComponent)); + SaveButton comp2 = comp1; + + comp1.type_ = PASTE_COMPONENT; + ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); + comp1.type_ = SAVE_COMPONENT; + + comp1.fontSize_ = DEFAULT_DIMENSION; + ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); + comp1.fontSize_ = TEST_SIZE; + + comp1.iconSize_ = DEFAULT_DIMENSION; + ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); + comp1.iconSize_ = TEST_SIZE; + + comp1.padding_.top = DEFAULT_DIMENSION; + ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); + comp1.padding_.top = TEST_DIMENSION; + + comp1.padding_.right = DEFAULT_DIMENSION; + ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); + comp1.padding_.right = TEST_DIMENSION; + + comp1.padding_.bottom = DEFAULT_DIMENSION; + ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); + comp1.padding_.bottom = TEST_DIMENSION; + + comp1.padding_.left = DEFAULT_DIMENSION; + ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); + comp1.padding_.left = TEST_DIMENSION; + + comp1.textIconSpace_ = DEFAULT_DIMENSION; + ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); + comp1.textIconSpace_ = TEST_SIZE; + + comp1.borderWidth_ = DEFAULT_DIMENSION; + ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); + comp1.borderWidth_ = TEST_SIZE; + + comp1.fontColor_.value = TEST_DIFF_COLOR; + ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); + comp1.fontColor_.value = TEST_COLOR_RED; + + comp1.bgColor_.value = TEST_DIFF_COLOR; + ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); + comp1.bgColor_.value = TEST_COLOR_YELLOW; + + comp1.iconColor_.value = TEST_DIFF_COLOR; + ASSERT_FALSE(comp1.CompareComponentBasicInfo(&comp2, true)); + comp1.iconColor_.value = TEST_COLOR_BLUE; + + ASSERT_TRUE(comp1.CompareComponentBasicInfo(&comp2, true)); +} diff --git a/interfaces/inner_api/security_component/test/unittest/src/save_button_test.h b/interfaces/inner_api/security_component/test/unittest/src/save_button_test.h new file mode 100644 index 0000000..34c9f6a --- /dev/null +++ b/interfaces/inner_api/security_component/test/unittest/src/save_button_test.h @@ -0,0 +1,38 @@ +/* + * 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 SEC_COMP_SAVE_BUTTON_TEST_H +#define SEC_COMP_SAVE_BUTTON_TEST_H + +#include +#include "save_button.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +class SaveButtonTest : public testing::Test { +public: + static void SetUpTestCase(); + + static void TearDownTestCase(); + + void SetUp(); + + void TearDown(); +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // SEC_COMP_SAVE_BUTTON_TEST_H diff --git a/interfaces/inner_api/security_component/test/unittest/src/sec_comp_kit_test.cpp b/interfaces/inner_api/security_component/test/unittest/src/sec_comp_kit_test.cpp new file mode 100644 index 0000000..8128924 --- /dev/null +++ b/interfaces/inner_api/security_component/test/unittest/src/sec_comp_kit_test.cpp @@ -0,0 +1,191 @@ +/* + * 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 "sec_comp_kit_test.h" + +#include "location_button.h" +#define private public +#include "sec_comp_caller_authorization.h" +#undef private +#include "sec_comp_err.h" +#include "sec_comp_info.h" +#include "sec_comp_log.h" +#include "sec_comp_tool.h" +#include "test_common.h" + +using namespace testing::ext; +using namespace OHOS::Security::SecurityComponent; + +namespace { +static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { + LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompKitTest"}; + +static void TestInCallerNotCheckList() +{ + int32_t scId = -1; + struct SecCompClickEvent touch; + std::string emptyStr = ""; + int registerRes = SecCompKit::RegisterSecurityComponent(LOCATION_COMPONENT, emptyStr, scId); + int updateRes = SecCompKit::UpdateSecurityComponent(scId, emptyStr); + int reportRes = SecCompKit::ReportSecurityComponentClickEvent(scId, emptyStr, touch, nullptr); + + EXPECT_EQ(registerRes, SC_SERVICE_ERROR_CALLER_INVALID); + EXPECT_EQ(updateRes, SC_SERVICE_ERROR_CALLER_INVALID); + EXPECT_EQ(reportRes, SC_SERVICE_ERROR_CALLER_INVALID); +} + +static void TestInCallerCheckList() +{ + int32_t scId = -1; + struct SecCompClickEvent touch; + std::string emptyStr = ""; + int registerRes = SecCompKit::RegisterSecurityComponent(LOCATION_COMPONENT, emptyStr, scId); + int updateRes = SecCompKit::UpdateSecurityComponent(scId, emptyStr); + int reportRes = SecCompKit::ReportSecurityComponentClickEvent(scId, emptyStr, touch, nullptr); + + EXPECT_NE(registerRes, SC_SERVICE_ERROR_CALLER_INVALID); + EXPECT_NE(updateRes, SC_SERVICE_ERROR_CALLER_INVALID); + EXPECT_NE(reportRes, SC_SERVICE_ERROR_CALLER_INVALID); +} +} // namespace + +void SecCompKitTest::SetUpTestCase() +{ + SC_LOG_INFO(LABEL, "SetUpTestCase."); +} + +void SecCompKitTest::TearDownTestCase() +{ + SC_LOG_INFO(LABEL, "TearDownTestCase."); +} + +void SecCompKitTest::SetUp() +{ + SC_LOG_INFO(LABEL, "SetUp ok."); +} + +void SecCompKitTest::TearDown() +{ + SC_LOG_INFO(LABEL, "TearDown."); +} + +/** + * @tc.name: ExceptCall001 + * @tc.desc: do kit except call. + * @tc.type: FUNC + * @tc.require: AR000HO9IN + */ +HWTEST_F(SecCompKitTest, ExceptCall001, TestSize.Level1) +{ + LocationButton comp; + comp.fontSize_ = TEST_SIZE; + comp.iconSize_ = TEST_SIZE; + comp.padding_.top = TEST_DIMENSION; + comp.padding_.right = TEST_DIMENSION; + comp.padding_.bottom = TEST_DIMENSION; + comp.padding_.left = TEST_DIMENSION; + comp.textIconSpace_ = TEST_SIZE; + comp.bgColor_.value = TEST_COLOR; + comp.fontColor_.value = TEST_COLOR; + comp.iconColor_.value = TEST_COLOR; + comp.borderWidth_ = TEST_SIZE; + comp.parentEffect_ = true; + comp.type_ = LOCATION_COMPONENT; + comp.rect_.x_ = TEST_COORDINATE; + comp.rect_.y_ = TEST_COORDINATE; + comp.rect_.width_ = TEST_COORDINATE; + comp.rect_.height_ = TEST_COORDINATE; + + nlohmann::json jsonRes; + comp.ToJson(jsonRes); + int32_t scId = -1; + std::string jsonStr = jsonRes.dump(); + ASSERT_NE(SC_OK, SecCompKit::RegisterSecurityComponent(LOCATION_COMPONENT, jsonStr, scId)); + ASSERT_EQ(-1, scId); + ASSERT_NE(SC_OK, SecCompKit::UpdateSecurityComponent(scId, jsonStr)); + + struct SecCompClickEvent touch = { + .touchX = TEST_COORDINATE, + .touchY = TEST_COORDINATE, + .timestamp = static_cast(std::chrono::high_resolution_clock::now().time_since_epoch().count()) + }; + EXPECT_NE(SC_OK, SecCompKit::ReportSecurityComponentClickEvent(scId, jsonStr, touch, nullptr)); + EXPECT_NE(SC_OK, SecCompKit::UnregisterSecurityComponent(scId)); +} + +/** + * @tc.name: ExceptCall001 + * @tc.desc: test caller check. + * @tc.type: FUNC + * @tc.require: AR000HO9JS + */ +HWTEST_F(SecCompKitTest, TestCallerCheck001, TestSize.Level1) +{ + std::vector callerList = { + reinterpret_cast(TestInCallerCheckList), + }; + SecCompUiRegister registerCallback(callerList, nullptr); + TestInCallerCheckList(); + TestInCallerNotCheckList(); + + // prohibit init caller list repeately + std::vector callerList1 = { + reinterpret_cast(TestInCallerNotCheckList), + }; + SecCompUiRegister registerCallback1(callerList1, nullptr); + TestInCallerNotCheckList(); + SecCompCallerAuthorization::GetInstance().kitCallerList_.clear(); + SecCompCallerAuthorization::GetInstance().isInit_ = false; +} + +/** + * @tc.name: ExceptCall002 + * @tc.desc: test invalid caller register. + * @tc.type: FUNC + * @tc.require: AR000HO9JS + */ +HWTEST_F(SecCompKitTest, TestCallerCheck002, TestSize.Level1) +{ + std::vector callerList; + SecCompUiRegister registerCallback(callerList, nullptr); + TestInCallerNotCheckList(); + SecCompCallerAuthorization::GetInstance().kitCallerList_.clear(); + SecCompCallerAuthorization::GetInstance().isInit_ = false; + + for (size_t i = 0; i < MAX_CALLER_SIZE + 1; i++) { + callerList.emplace_back(reinterpret_cast(TestInCallerNotCheckList)); + } + SecCompUiRegister registerCallback2(callerList, nullptr); + TestInCallerNotCheckList(); + SecCompCallerAuthorization::GetInstance().kitCallerList_.clear(); + SecCompCallerAuthorization::GetInstance().isInit_ = false; +} + +/** + * @tc.name: RegisterWithoutCallback001 + * @tc.desc: test register without callback. + * @tc.type: FUNC + * @tc.require: AR000HO9JM + */ +HWTEST_F(SecCompKitTest, RegisterWithoutCallback001, TestSize.Level1) +{ + nlohmann::json jsonRes; + TestCommon::BuildLocationComponentInfo(jsonRes); + std::string locationInfo = jsonRes.dump(); + + int32_t scId; + ASSERT_EQ(SC_ENHANCE_ERROR_CALLBACK_NOT_EXIST, + SecCompKit::RegisterSecurityComponent(LOCATION_COMPONENT, locationInfo, scId)); + ASSERT_EQ(-1, scId); +} diff --git a/interfaces/inner_api/security_component/test/unittest/src/sec_comp_kit_test.h b/interfaces/inner_api/security_component/test/unittest/src/sec_comp_kit_test.h new file mode 100644 index 0000000..3bd1241 --- /dev/null +++ b/interfaces/inner_api/security_component/test/unittest/src/sec_comp_kit_test.h @@ -0,0 +1,37 @@ +/* + * 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 SECURITY_COMPONENT_KIT_TEST +#define SECURITY_COMPONENT_KIT_TEST + +#include +#include "sec_comp_kit.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +class SecCompKitTest : public testing::Test { +public: + static void SetUpTestCase(); + + static void TearDownTestCase(); + + void SetUp() override; + + void TearDown() override; +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // SECURITY_COMPONENT_KIT_TEST \ No newline at end of file diff --git a/interfaces/inner_api/security_component/test/unittest/src/sec_comp_register_callback_test.cpp b/interfaces/inner_api/security_component/test/unittest/src/sec_comp_register_callback_test.cpp new file mode 100644 index 0000000..07d339a --- /dev/null +++ b/interfaces/inner_api/security_component/test/unittest/src/sec_comp_register_callback_test.cpp @@ -0,0 +1,307 @@ +/* + * 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 "i_sec_comp_probe.h" +#include "location_button.h" +#define private public +#include "sec_comp_caller_authorization.h" +#undef private +#include "sec_comp_client.h" +#include "sec_comp_enhance_adapter.h" +#include "sec_comp_err.h" +#include "sec_comp_info.h" +#include "sec_comp_kit.h" +#include "sec_comp_log.h" +#include "sec_comp_tool.h" +#include "sec_comp_ui_register.h" +#include "test_common.h" +#include "token_setproc.h" + +using namespace testing::ext; +using namespace OHOS::Security::SecurityComponent; + +namespace { +static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { + LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompRegisterCallbackTest"}; + +class MockUiSecCompProbe : public ISecCompProbe { +public: + int32_t GetComponentInfo(int32_t nodeId, std::string& componentInfo) override + { + componentInfo = mockComponentInfo; + return mockRes; + } + std::string mockComponentInfo; + int32_t mockRes; +}; + +static MockUiSecCompProbe g_probe; +static void InitUiRegister() +{ + std::vector callerList; + SecCompUiRegister registerCallback(callerList, &g_probe); + SecCompCallerAuthorization::GetInstance().kitCallerList_.clear(); + SecCompCallerAuthorization::GetInstance().isInit_ = false; +} +} // namespace + +class SecCompRegisterCallbackTest : public testing::Test { +public: + static void SetUpTestCase(); + + static void TearDownTestCase(); + + void SetUp() override; + + void TearDown() override; +}; + +void SecCompRegisterCallbackTest::SetUpTestCase() +{ + InitUiRegister(); + SC_LOG_INFO(LABEL, "SecCompRegisterCallbackTest."); +} + +void SecCompRegisterCallbackTest::TearDownTestCase() +{ + SC_LOG_INFO(LABEL, "SecCompRegisterCallbackTest."); +} + +void SecCompRegisterCallbackTest::SetUp() +{ + SC_LOG_INFO(LABEL, "SetUp ok."); +} + +void SecCompRegisterCallbackTest::TearDown() +{ + SC_LOG_INFO(LABEL, "TearDown."); +} + +/** + * @tc.name: RegisterWithoutPreprocess001 + * @tc.desc: test register without preprocess + * @tc.type: FUNC + * @tc.require: AR000HO9JM + */ +HWTEST_F(SecCompRegisterCallbackTest, RegisterWithoutPreprocess001, TestSize.Level1) +{ + nlohmann::json jsonRes; + TestCommon::BuildLocationComponentInfo(jsonRes); + std::string locationInfo = jsonRes.dump(); + + SecCompEnhanceAdapter::InitEnhanceHandler(SEC_COMP_ENHANCE_CLIENT_INTERFACE); + int32_t scId; + ASSERT_EQ(SC_ENHANCE_ERROR_CHALLENGE_CHECK_FAIL, + SecCompClient::GetInstance().RegisterSecurityComponent(LOCATION_COMPONENT, locationInfo, scId)); + ASSERT_EQ(-1, scId); +} + +/** + * @tc.name: Register001 + * @tc.desc: test register security component success. + * @tc.type: FUNC + * @tc.require: AR000HO9JM + */ +HWTEST_F(SecCompRegisterCallbackTest, Register001, TestSize.Level1) +{ + nlohmann::json jsonRes; + TestCommon::BuildLocationComponentInfo(jsonRes); + std::string locationInfo = jsonRes.dump(); + g_probe.mockComponentInfo = locationInfo; + g_probe.mockRes = 0; + + int32_t scId; + ASSERT_EQ(SC_OK, SecCompKit::RegisterSecurityComponent(LOCATION_COMPONENT, locationInfo, scId)); + ASSERT_NE(-1, scId); + + EXPECT_EQ(SC_OK, SecCompKit::UnregisterSecurityComponent(scId)); +} + +/** + * @tc.name: Register002 + * @tc.desc: test register callback failed. + * @tc.type: FUNC + * @tc.require: AR000HO9JM + */ +HWTEST_F(SecCompRegisterCallbackTest, Register002, TestSize.Level1) +{ + nlohmann::json jsonRes; + TestCommon::BuildLocationComponentInfo(jsonRes); + std::string locationInfo = jsonRes.dump(); + g_probe.mockComponentInfo = locationInfo; + g_probe.mockRes = -1; + + int32_t scId; + ASSERT_EQ(SC_ENHANCE_ERROR_CALLBACK_OPER_FAIL, + SecCompKit::RegisterSecurityComponent(LOCATION_COMPONENT, locationInfo, scId)); + ASSERT_EQ(-1, scId); +} + +/** + * @tc.name: Register003 + * @tc.desc: test register in MaliciousAppList. + * @tc.type: FUNC + * @tc.require: AR000HO9JM + */ +HWTEST_F(SecCompRegisterCallbackTest, Register003, TestSize.Level1) +{ + nlohmann::json jsonRes; + TestCommon::BuildLocationComponentInfo(jsonRes); + std::string locationInfo = jsonRes.dump(); + g_probe.mockComponentInfo = locationInfo; + g_probe.mockRes = 0; + + int32_t scId; + ASSERT_EQ(SC_OK, SecCompKit::RegisterSecurityComponent(LOCATION_COMPONENT, locationInfo, scId)); +} + +/** + * @tc.name: RegisterSecurityComponent001 + * @tc.desc: Test register security component check touch info failed + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompRegisterCallbackTest, RegisterSecurityComponent001, TestSize.Level1) +{ + system("param set sec.comp.enhance 1"); + nlohmann::json jsonRes; + TestCommon::BuildSaveComponentInfo(jsonRes); + std::string saveInfo = jsonRes.dump(); + int32_t scId; + + EXPECT_EQ(SC_OK, SecCompKit::RegisterSecurityComponent(SAVE_COMPONENT, saveInfo, scId)); + uint8_t data[MAX_HMAC_SIZE] = { 0 }; + struct SecCompClickEvent touchInfo = { + .touchX = TEST_COORDINATE, + .touchY = TEST_COORDINATE, + .timestamp = static_cast( + std::chrono::high_resolution_clock::now().time_since_epoch().count()) + }; + touchInfo.extraInfo.dataSize = MAX_HMAC_SIZE; + touchInfo.extraInfo.data = data; + EXPECT_EQ(SC_SERVICE_ERROR_CLICK_EVENT_INVALID, + SecCompKit::ReportSecurityComponentClickEvent(scId, saveInfo, touchInfo, nullptr)); + EXPECT_EQ(SC_OK, SecCompKit::UnregisterSecurityComponent(scId)); + system("param set sec.comp.enhance 0"); +} + +/** + * @tc.name: RegisterSecurityComponent002 + * @tc.desc: Test register security component permission grant failed + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompRegisterCallbackTest, RegisterSecurityComponent002, TestSize.Level1) +{ + system("param set sec.comp.enhance 1"); + nlohmann::json jsonRes; + TestCommon::BuildSaveComponentInfo(jsonRes); + std::string saveInfo = jsonRes.dump(); + int32_t scId; + + EXPECT_EQ(SC_OK, SecCompKit::RegisterSecurityComponent(SAVE_COMPONENT, saveInfo, scId)); + uint8_t data[MAX_HMAC_SIZE] = { 0 }; + struct SecCompClickEvent touchInfo = { + .touchX = TEST_COORDINATE, + .touchY = TEST_COORDINATE, + .timestamp = static_cast( + std::chrono::high_resolution_clock::now().time_since_epoch().count()) / TIME_CONVERSION_UNIT + }; + touchInfo.extraInfo.dataSize = MAX_HMAC_SIZE; + touchInfo.extraInfo.data = data; + EXPECT_EQ(SC_OK, SecCompKit::ReportSecurityComponentClickEvent(scId, saveInfo, touchInfo, nullptr)); + EXPECT_EQ(SC_OK, SecCompKit::UnregisterSecurityComponent(scId)); + system("param set sec.comp.enhance 0"); +} + +/** + * @tc.name: ReportSecurityComponentClickEvent003 + * @tc.desc: Test register security component success + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompRegisterCallbackTest, ReportSecurityComponentClickEvent003, TestSize.Level1) +{ + system("param set sec.comp.enhance 1"); + nlohmann::json jsonRes; + TestCommon::BuildSaveComponentInfo(jsonRes); + std::string saveInfo = jsonRes.dump(); + int32_t scId; + + EXPECT_EQ(SC_OK, SecCompKit::RegisterSecurityComponent(SAVE_COMPONENT, saveInfo, scId)); + uint8_t data[MAX_HMAC_SIZE] = { 0 }; + struct SecCompClickEvent touchInfo = { + .touchX = TEST_COORDINATE, + .touchY = TEST_COORDINATE, + .timestamp = static_cast( + std::chrono::high_resolution_clock::now().time_since_epoch().count()) / TIME_CONVERSION_UNIT + }; + touchInfo.extraInfo.dataSize = MAX_HMAC_SIZE; + touchInfo.extraInfo.data = data; + + ASSERT_EQ(SC_OK, SecCompKit::ReportSecurityComponentClickEvent(scId, saveInfo, touchInfo, nullptr)); + uint32_t selfTokenId = GetSelfTokenID(); + ASSERT_TRUE(SecCompKit::ReduceAfterVerifySavePermission(selfTokenId)); + system("param set sec.comp.enhance 0"); +} + +/** + * @tc.name: ExceptCall001 + * @tc.desc: Test update security component success + * @tc.type: FUNC + * @tc.require: AR000HO9IN + */ +HWTEST_F(SecCompRegisterCallbackTest, ExceptCall001, TestSize.Level1) +{ + nlohmann::json jsonRes; + TestCommon::BuildSaveComponentInfo(jsonRes); + std::string saveInfo = jsonRes.dump(); + int32_t scId; + ASSERT_EQ(SC_OK, SecCompKit::RegisterSecurityComponent(LOCATION_COMPONENT, saveInfo, scId)); + ASSERT_NE(-1, scId); + ASSERT_EQ(SC_OK, SecCompKit::UpdateSecurityComponent(scId, saveInfo)); +} + +/** + * @tc.name: ReportClickWithoutHmac001 + * @tc.desc: Test report click event permission denied + * @tc.type: FUNC + * @tc.require: AR000HO9JM + */ +HWTEST_F(SecCompRegisterCallbackTest, ReportClickWithoutHmac001, TestSize.Level1) +{ + system("param set sec.comp.enhance 1"); + nlohmann::json jsonRes; + TestCommon::BuildLocationComponentInfo(jsonRes); + std::string locationInfo = jsonRes.dump(); + g_probe.mockComponentInfo = locationInfo; + g_probe.mockRes = 0; + + int32_t scId; + ASSERT_EQ(SC_OK, SecCompKit::RegisterSecurityComponent(LOCATION_COMPONENT, locationInfo, scId)); + ASSERT_NE(-1, scId); + uint8_t data[MAX_HMAC_SIZE] = { 0 }; + struct SecCompClickEvent touch = { + .touchX = TEST_COORDINATE, + .touchY = TEST_COORDINATE, + .timestamp = static_cast( + std::chrono::high_resolution_clock::now().time_since_epoch().count()) / TIME_CONVERSION_UNIT + }; + touch.extraInfo.dataSize = MAX_HMAC_SIZE; + touch.extraInfo.data = data; + EXPECT_EQ(SC_SERVICE_ERROR_PERMISSION_OPER_FAIL, + SecCompKit::ReportSecurityComponentClickEvent(scId, locationInfo, touch, nullptr)); + system("param set sec.comp.enhance 0"); +} diff --git a/interfaces/inner_api/security_component/test/unittest/src/test_common.cpp b/interfaces/inner_api/security_component/test/unittest/src/test_common.cpp new file mode 100644 index 0000000..067bfe9 --- /dev/null +++ b/interfaces/inner_api/security_component/test/unittest/src/test_common.cpp @@ -0,0 +1,168 @@ +/* + * 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 "test_common.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +void TestCommon::BuildLocationComponentInfo(nlohmann::json& jsonComponent) +{ + jsonComponent[JsonTagConstants::JSON_SC_TYPE] = LOCATION_COMPONENT; + jsonComponent[JsonTagConstants::JSON_RECT] = nlohmann::json { + {JsonTagConstants::JSON_RECT_X, TEST_COORDINATE }, + {JsonTagConstants::JSON_RECT_Y, TEST_COORDINATE }, + {JsonTagConstants::JSON_RECT_WIDTH, TEST_COORDINATE }, + {JsonTagConstants::JSON_RECT_HEIGHT, TEST_COORDINATE } + }; + jsonComponent[JsonTagConstants::JSON_NODE_ID] = 0; + jsonComponent[JsonTagConstants::JSON_WINDOW_RECT] = nlohmann::json { + {JsonTagConstants::JSON_RECT_X, TEST_COORDINATE }, + {JsonTagConstants::JSON_RECT_Y, TEST_COORDINATE }, + {JsonTagConstants::JSON_RECT_WIDTH, TEST_COORDINATE }, + {JsonTagConstants::JSON_RECT_HEIGHT, TEST_COORDINATE } + }; + nlohmann::json jsonPadding = nlohmann::json { + { JsonTagConstants::JSON_PADDING_TOP_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_RIGHT_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_LEFT_TAG, TEST_DIMENSION }, + }; + + jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, + }; + + jsonComponent[JsonTagConstants::JSON_COLORS_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_COLOR_TAG, TEST_COLOR_RED }, + { JsonTagConstants::JSON_ICON_COLOR_TAG, TEST_COLOR_BLUE }, + { JsonTagConstants::JSON_BG_COLOR_TAG, TEST_COLOR_YELLOW } + }; + + jsonComponent[JsonTagConstants::JSON_BORDER_TAG] = nlohmann::json { + { JsonTagConstants::JSON_BORDER_WIDTH_TAG, TEST_SIZE }, + }; + jsonComponent[JsonTagConstants::JSON_PARENT_TAG] = nlohmann::json { + { JsonTagConstants::JSON_PARENT_EFFECT_TAG, false }, + }; + jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_TEXT_TAG, LocationDesc::SELECT_LOCATION }, + { JsonTagConstants::JSON_ICON_TAG, LocationIcon::LINE_ICON }, + { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, + }; +} + +void TestCommon::BuildSaveComponentInfo(nlohmann::json& jsonComponent) +{ + jsonComponent[JsonTagConstants::JSON_SC_TYPE] = SAVE_COMPONENT; + jsonComponent[JsonTagConstants::JSON_NODE_ID] = 0; + jsonComponent[JsonTagConstants::JSON_RECT] = nlohmann::json { + {JsonTagConstants::JSON_RECT_X, TEST_COORDINATE }, + {JsonTagConstants::JSON_RECT_Y, TEST_COORDINATE }, + {JsonTagConstants::JSON_RECT_WIDTH, TEST_COORDINATE }, + {JsonTagConstants::JSON_RECT_HEIGHT, TEST_COORDINATE } + }; + jsonComponent[JsonTagConstants::JSON_WINDOW_RECT] = nlohmann::json { + {JsonTagConstants::JSON_RECT_X, TEST_COORDINATE }, + {JsonTagConstants::JSON_RECT_Y, TEST_COORDINATE }, + {JsonTagConstants::JSON_RECT_WIDTH, TEST_COORDINATE }, + {JsonTagConstants::JSON_RECT_HEIGHT, TEST_COORDINATE } + }; + nlohmann::json jsonPadding = nlohmann::json { + { JsonTagConstants::JSON_PADDING_TOP_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_RIGHT_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_LEFT_TAG, TEST_DIMENSION }, + }; + + jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, + }; + + jsonComponent[JsonTagConstants::JSON_COLORS_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_COLOR_TAG, TEST_COLOR_RED }, + { JsonTagConstants::JSON_ICON_COLOR_TAG, TEST_COLOR_BLUE }, + { JsonTagConstants::JSON_BG_COLOR_TAG, TEST_COLOR_YELLOW } + }; + + jsonComponent[JsonTagConstants::JSON_BORDER_TAG] = nlohmann::json { + { JsonTagConstants::JSON_BORDER_WIDTH_TAG, TEST_SIZE }, + }; + jsonComponent[JsonTagConstants::JSON_PARENT_TAG] = nlohmann::json { + { JsonTagConstants::JSON_PARENT_EFFECT_TAG, false }, + }; + jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_TEXT_TAG, SaveDesc::DOWNLOAD }, + { JsonTagConstants::JSON_ICON_TAG, SaveIcon::LINE_ICON }, + { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, + }; +} + +void TestCommon::BuildPasteComponentInfo(nlohmann::json& jsonComponent) +{ + jsonComponent[JsonTagConstants::JSON_SC_TYPE] = PASTE_COMPONENT; + jsonComponent[JsonTagConstants::JSON_NODE_ID] = 0; + jsonComponent[JsonTagConstants::JSON_RECT] = nlohmann::json { + {JsonTagConstants::JSON_RECT_X, TEST_COORDINATE }, + {JsonTagConstants::JSON_RECT_Y, TEST_COORDINATE }, + {JsonTagConstants::JSON_RECT_WIDTH, TEST_COORDINATE }, + {JsonTagConstants::JSON_RECT_HEIGHT, TEST_COORDINATE } + }; + jsonComponent[JsonTagConstants::JSON_WINDOW_RECT] = nlohmann::json { + {JsonTagConstants::JSON_RECT_X, TEST_COORDINATE }, + {JsonTagConstants::JSON_RECT_Y, TEST_COORDINATE }, + {JsonTagConstants::JSON_RECT_WIDTH, TEST_COORDINATE }, + {JsonTagConstants::JSON_RECT_HEIGHT, TEST_COORDINATE } + }; + nlohmann::json jsonPadding = nlohmann::json { + { JsonTagConstants::JSON_PADDING_TOP_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_RIGHT_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_LEFT_TAG, TEST_DIMENSION }, + }; + + jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, + }; + + jsonComponent[JsonTagConstants::JSON_COLORS_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_COLOR_TAG, TEST_COLOR_RED }, + { JsonTagConstants::JSON_ICON_COLOR_TAG, TEST_COLOR_BLUE }, + { JsonTagConstants::JSON_BG_COLOR_TAG, TEST_COLOR_YELLOW } + }; + + jsonComponent[JsonTagConstants::JSON_BORDER_TAG] = nlohmann::json { + { JsonTagConstants::JSON_BORDER_WIDTH_TAG, TEST_SIZE }, + }; + jsonComponent[JsonTagConstants::JSON_PARENT_TAG] = nlohmann::json { + { JsonTagConstants::JSON_PARENT_EFFECT_TAG, false }, + }; + jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_TEXT_TAG, PasteDesc::PASTE }, + { JsonTagConstants::JSON_ICON_TAG, PasteIcon::LINE_ICON }, + { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, + }; +} +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS diff --git a/interfaces/inner_api/security_component/test/unittest/src/test_common.h b/interfaces/inner_api/security_component/test/unittest/src/test_common.h new file mode 100644 index 0000000..34f3a18 --- /dev/null +++ b/interfaces/inner_api/security_component/test/unittest/src/test_common.h @@ -0,0 +1,47 @@ +/* + * 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 TEST_COMMON_H +#define TEST_COMMON_H +#include "location_button.h" +#include "paste_button.h" +#include "save_button.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +const std::string WRONG_TYPE = "wrongType"; +constexpr float TEST_SIZE = 100.0; +constexpr double TEST_COORDINATE = 100.0; +constexpr double TEST_DIMENSION = 100.0; +constexpr uint32_t TEST_COLOR = 0xffffffff; +constexpr uint32_t TEST_COLOR_YELLOW = 0xffffff00; +constexpr uint32_t TEST_COLOR_RED = 0xffff0000; +constexpr uint32_t TEST_COLOR_BLUE = 0xff0000ff; +constexpr uint32_t TEST_DIFF_COLOR = 0; +constexpr uint64_t TIME_CONVERSION_UNIT = 1000; +constexpr uint32_t HAP_TOKEN_ID = 537715419; +constexpr uint32_t MAX_HMAC_SIZE = 64; +constexpr size_t MAX_CALLER_SIZE = 10; + +class TestCommon { +public: + static void BuildLocationComponentInfo(nlohmann::json& jsonComponent); + static void BuildSaveComponentInfo(nlohmann::json& jsonComponent); + static void BuildPasteComponentInfo(nlohmann::json& jsonComponent); +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // TEST_COMMON_H diff --git a/security_component.gni b/security_component.gni new file mode 100644 index 0000000..f92bdb1 --- /dev/null +++ b/security_component.gni @@ -0,0 +1,14 @@ +# 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. + +sec_comp_dir = "//base/security/security_component" diff --git a/services/security_component_service/sa/BUILD.gn b/services/security_component_service/sa/BUILD.gn new file mode 100644 index 0000000..4cc4ace --- /dev/null +++ b/services/security_component_service/sa/BUILD.gn @@ -0,0 +1,91 @@ +# 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("//build/ohos.gni") + +sec_comp_root_dir = "../../.." + +config("security_component_service_config") { + include_dirs = [ + "sa_main", + "${sec_comp_root_dir}/frameworks/common/include", + "${sec_comp_root_dir}/frameworks/enhance_adapter/include", + "${sec_comp_root_dir}/frameworks/security_component/include", + "${sec_comp_root_dir}/interfaces/inner_api/security_component/include", + ] +} + +ohos_prebuilt_etc("security_component_service.rc") { + source = "security_component_service.cfg" + relative_install_dir = "init" + subsystem_name = "security" + part_name = "security_component" +} + +ohos_shared_library("security_component_service") { + subsystem_name = "security" + part_name = "security_component" + + include_dirs = [ + "sa_main", + "${sec_comp_root_dir}/frameworks/common/include", + "${sec_comp_root_dir}/frameworks/enhance_adapter/include", + "${sec_comp_root_dir}/frameworks/security_component/include", + "${sec_comp_root_dir}/interfaces/inner_api/security_component/include", + ] + + sources = [ + "sa_main/app_mgr_death_recipient.cpp", + "sa_main/app_state_observer.cpp", + "sa_main/delay_exit_task.cpp", + "sa_main/first_use_dialog.cpp", + "sa_main/sec_comp_entity.cpp", + "sa_main/sec_comp_info_helper.cpp", + "sa_main/sec_comp_manager.cpp", + "sa_main/sec_comp_perm_manager.cpp", + "sa_main/sec_comp_service.cpp", + "sa_main/sec_comp_stub.cpp", + "sa_main/sec_event_handler.cpp", + ] + + cflags_cc = [ "-DHILOG_ENABLE" ] + cflags = [ "-DHILOG_ENABLE" ] + + deps = [ + ":security_component_service.rc", + "${sec_comp_root_dir}/frameworks:libsecurity_component_enhance_adapter", + "${sec_comp_root_dir}/frameworks:libsecurity_component_framework", + ] + + configs = [ "${sec_comp_root_dir}/config:coverage_flags" ] + public_configs = [ ":security_component_service_config" ] + + external_deps = [ + "ability_base:base", + "ability_base:want", + "ability_runtime:ability_manager", + "ability_runtime:app_manager", + "ability_runtime:runtime", + "access_token:libaccesstoken_sdk", + "c_utils:utils", + "eventhandler:libeventhandler", + "graphic_2d:librender_service_client", + "hilog:libhilog", + "hisysevent:libhisysevent", + "hitrace:hitrace_meter", + "ipc:ipc_core", + "safwk:system_ability_fwk", + "samgr:samgr_proxy", + "window_manager:libdm", + ] +} diff --git a/services/security_component_service/sa/sa_main/app_mgr_death_recipient.cpp b/services/security_component_service/sa/sa_main/app_mgr_death_recipient.cpp new file mode 100644 index 0000000..7e37725 --- /dev/null +++ b/services/security_component_service/sa/sa_main/app_mgr_death_recipient.cpp @@ -0,0 +1,28 @@ +/* + * 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 "app_mgr_death_recipient.h" +#include "sec_comp_manager.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +void AppMgrDeathRecipient::OnRemoteDied(const wptr& object) +{ + SecCompManager::GetInstance().ExitWhenAppMgrDied(); +} +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS + diff --git a/services/security_component_service/sa/sa_main/app_mgr_death_recipient.h b/services/security_component_service/sa/sa_main/app_mgr_death_recipient.h new file mode 100644 index 0000000..d4dc41c --- /dev/null +++ b/services/security_component_service/sa/sa_main/app_mgr_death_recipient.h @@ -0,0 +1,33 @@ +/* + * 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 APP_MGR_DEATH_RECIPIENT_H +#define APP_MGR_DEATH_RECIPIENT_H + +#include "iremote_object.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +class AppMgrDeathRecipient : public IRemoteObject::DeathRecipient { +public: + AppMgrDeathRecipient() {} + virtual ~AppMgrDeathRecipient() = default; + void OnRemoteDied(const wptr& object) override; +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // APP_MGR_DEATH_RECIPIENT_H + diff --git a/services/security_component_service/sa/sa_main/app_state_observer.cpp b/services/security_component_service/sa/sa_main/app_state_observer.cpp new file mode 100644 index 0000000..be4fa4e --- /dev/null +++ b/services/security_component_service/sa/sa_main/app_state_observer.cpp @@ -0,0 +1,129 @@ +/* + * 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 "app_state_observer.h" + +#include "sec_comp_log.h" +#include "sec_comp_manager.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +namespace { +constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "AppStateObserver"}; +} + +AppStateObserver::AppStateObserver() +{ +} + +AppStateObserver::~AppStateObserver() +{ +} + +bool AppStateObserver::IsProcessForeground(int32_t pid, int32_t uid) +{ + Utils::UniqueReadGuard infoGuard(this->fgProcLock_); + for (auto iter = foregrandProcList_.begin(); iter != foregrandProcList_.end(); ++iter) { + if (pid == iter->pid) { + return true; + } + + if ((iter->pid == -1) && (uid == iter->uid)) { + iter->pid = pid; + return true; + } + } + return false; +} + +void AppStateObserver::AddProcessToForegroundSet(int32_t pid, const SecCompProcessData& data) +{ + Utils::UniqueWriteGuard infoGuard(this->fgProcLock_); + for (auto iter = foregrandProcList_.begin(); iter != foregrandProcList_.end(); ++iter) { + if (pid == -1) { + if (iter->uid == data.uid) { + SC_LOG_INFO(LABEL, "uid %{public}d is already in foreground", data.uid); + return; + } + } else if (pid == iter->pid) { + SC_LOG_INFO(LABEL, "pid %{public}d is already in foreground", pid); + return; + } + } + foregrandProcList_.emplace_back(data); +} + +void AppStateObserver::AddProcessToForegroundSet(const AppExecFwk::AppStateData& stateData) +{ + SecCompProcessData proc = { + .bundleName = stateData.bundleName, + .pid = stateData.pid, + .uid = stateData.uid + }; + AddProcessToForegroundSet(stateData.pid, proc); +} + +void AppStateObserver::AddProcessToForegroundSet(const AppExecFwk::ProcessData &processData) +{ + SecCompProcessData proc = { + .bundleName = processData.bundleName, + .pid = processData.pid, + .uid = processData.uid + }; + AddProcessToForegroundSet(processData.pid, proc); +} + +void AppStateObserver::RemoveProcessFromForegroundSet(const AppExecFwk::ProcessData &processData) +{ + Utils::UniqueWriteGuard infoGuard(this->fgProcLock_); + for (auto iter = foregrandProcList_.begin(); iter != foregrandProcList_.end(); ++iter) { + if (processData.pid == iter->pid) { + foregrandProcList_.erase(iter); + return; + } + } +} + +void AppStateObserver::OnProcessStateChanged(const AppExecFwk::ProcessData &processData) +{ + if (processData.state == AppExecFwk::AppProcessState::APP_STATE_FOREGROUND) { + AddProcessToForegroundSet(processData); + SecCompManager::GetInstance().NotifyProcessForeground(processData.pid); + } else if (processData.state == AppExecFwk::AppProcessState::APP_STATE_BACKGROUND) { + RemoveProcessFromForegroundSet(processData); + SecCompManager::GetInstance().NotifyProcessBackground(processData.pid); + } +} + +void AppStateObserver::OnProcessDied(const AppExecFwk::ProcessData& processData) +{ + SC_LOG_INFO(LABEL, "OnProcessDied die %{public}s pid %{public}d", + processData.bundleName.c_str(), processData.pid); + RemoveProcessFromForegroundSet(processData); + SecCompManager::GetInstance().NotifyProcessDied(processData.pid); +} + +void AppStateObserver::DumpProcess(std::string& dumpStr) +{ + Utils::UniqueWriteGuard infoGuard(this->fgProcLock_); + for (auto iter = foregrandProcList_.begin(); iter != foregrandProcList_.end(); ++iter) { + dumpStr.append("uid:" + std::to_string(iter->uid) + ", pid:" + std::to_string(iter->pid)); + dumpStr.append(", procName:" + iter->bundleName + "\n"); + } +} +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS + diff --git a/services/security_component_service/sa/sa_main/app_state_observer.h b/services/security_component_service/sa/sa_main/app_state_observer.h new file mode 100644 index 0000000..56998a0 --- /dev/null +++ b/services/security_component_service/sa/sa_main/app_state_observer.h @@ -0,0 +1,57 @@ +/* + * 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 SECURITY_COMPONENT_SA_APP_STATE_OBSERVER_APP_STATE_OBSERVER_H +#define SECURITY_COMPONENT_SA_APP_STATE_OBSERVER_APP_STATE_OBSERVER_H + +#include +#include +#include "app_mgr_interface.h" +#include "application_state_observer_stub.h" +#include "iremote_object.h" +#include "rwlock.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +struct SecCompProcessData { + std::string bundleName; + int32_t pid = -1; + int32_t uid = -1; +}; + +class AppStateObserver : public AppExecFwk::ApplicationStateObserverStub { +public: + explicit AppStateObserver(); + virtual ~AppStateObserver(); + + void OnProcessStateChanged(const AppExecFwk::ProcessData& processData) override; + void OnProcessDied(const AppExecFwk::ProcessData& processData) override; + bool IsProcessForeground(int32_t pid, int32_t uid); + void AddProcessToForegroundSet(int32_t pid, const SecCompProcessData& data); + void AddProcessToForegroundSet(const AppExecFwk::ProcessData& processData); + void AddProcessToForegroundSet(const AppExecFwk::AppStateData& stateData); + void DumpProcess(std::string& dumpStr); + +private: + void RemoveProcessFromForegroundSet(const AppExecFwk::ProcessData& processData); + std::vector foregrandProcList_; + OHOS::Utils::RWLock fgProcLock_; +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS + +#endif // SECURITY_COMPONENT_SA_APP_STATE_OBSERVER_APP_STATE_OBSERVER_H + diff --git a/services/security_component_service/sa/sa_main/delay_exit_task.cpp b/services/security_component_service/sa/sa_main/delay_exit_task.cpp new file mode 100644 index 0000000..5d78873 --- /dev/null +++ b/services/security_component_service/sa/sa_main/delay_exit_task.cpp @@ -0,0 +1,72 @@ +/* + * 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 "delay_exit_task.h" + +#include "sec_comp_log.h" +#include "sec_comp_manager.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +namespace { +constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "DelayExitTask"}; +static const std::string DELAY_EXIT_TASK = "DelayExitTask"; +static const int32_t DELAY_EXIT_MILLISECONDS = 30 * 1000; // 30s +} + +DelayExitTask::DelayExitTask() +{ +} + +DelayExitTask& DelayExitTask::GetInstance() +{ + static DelayExitTask instance; + return instance; +} + +void DelayExitTask::Init(const std::shared_ptr& secHandler) +{ + secHandler_ = secHandler; +} + +void DelayExitTask::Start() +{ + if (secHandler_ == nullptr) { + SC_LOG_ERROR(LABEL, "fail to get EventHandler"); + return; + } + + std::function delayed = ([]() { + SecCompManager::GetInstance().ExitSaProcess(); + }); + + SC_LOG_INFO(LABEL, "Delay exit service after %{public}d ms", DELAY_EXIT_MILLISECONDS); + secHandler_->ProxyPostTask(delayed, DELAY_EXIT_TASK, DELAY_EXIT_MILLISECONDS); +} + +void DelayExitTask::Stop() +{ + if (secHandler_ == nullptr) { + SC_LOG_ERROR(LABEL, "fail to get EventHandler"); + return; + } + + SC_LOG_INFO(LABEL, "service delay exit handler stop"); + secHandler_->ProxyRemoveTask(DELAY_EXIT_TASK); +} +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS + diff --git a/services/security_component_service/sa/sa_main/delay_exit_task.h b/services/security_component_service/sa/sa_main/delay_exit_task.h new file mode 100644 index 0000000..d4315df --- /dev/null +++ b/services/security_component_service/sa/sa_main/delay_exit_task.h @@ -0,0 +1,44 @@ +/* + * 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 SECURITY_COMPONENT_DELAY_EXIT_TASK_H +#define SECURITY_COMPONENT_DELAY_EXIT_TASK_H + +#include +#include +#include "nocopyable.h" +#include "sec_event_handler.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +class DelayExitTask { +public: + static DelayExitTask& GetInstance(); + virtual ~DelayExitTask() = default; + + void Init(const std::shared_ptr& secHandler); + void Start(); + void Stop(); +private: + DelayExitTask(); + std::shared_ptr secHandler_; + + DISALLOW_COPY_AND_MOVE(DelayExitTask); +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // SECURITY_COMPONENT_DELAY_EXIT_TASK_H + diff --git a/services/security_component_service/sa/sa_main/first_use_dialog.cpp b/services/security_component_service/sa/sa_main/first_use_dialog.cpp new file mode 100644 index 0000000..6439824 --- /dev/null +++ b/services/security_component_service/sa/sa_main/first_use_dialog.cpp @@ -0,0 +1,297 @@ +/* + * 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 "first_use_dialog.h" + +#include +#include +#include +#include +#include +#include "ability_manager_client.h" +#include "accesstoken_kit.h" +#include "sec_comp_err.h" +#include "sec_comp_log.h" +#include "want_params_wrapper.h" +#include "want.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +namespace { +constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "FirstUseDialog"}; +static const std::string SEC_COMP_SRV_CFG_PATH = "/data/service/el1/public/security_component_service"; +static const std::string FIRST_USE_RECORD_JSON = SEC_COMP_SRV_CFG_PATH + "/first_use_record.json"; +static const std::string FIRST_USE_RECORD_TAG = "FirstUseRecord"; +static const std::string TOKEN_ID_TAG = "TokenId"; +static const std::string COMP_TYPE_TAG = "CompType"; + +const std::string GRANT_ABILITY_BUNDLE_NAME = "com.ohos.permissionmanager"; +const std::string GRANT_ABILITY_ABILITY_NAME = "com.ohos.permissionmanager.SecurityExtAbility"; +const std::string TYPE_KEY = "ohos.user.security.type"; +const std::string TOKEN_KEY = "ohos.ability.params.token"; + +constexpr uint32_t MAX_CFG_FILE_SIZE = 100 * 1024; // 100k +} + +bool FirstUseDialog::IsCfgDirExist(void) +{ + struct stat fstat = {}; + if (stat(SEC_COMP_SRV_CFG_PATH.c_str(), &fstat) != 0) { + SC_LOG_INFO(LABEL, "path %{public}s errno %{public}d.", SEC_COMP_SRV_CFG_PATH.c_str(), errno); + return false; + } + + if (!S_ISDIR(fstat.st_mode)) { + SC_LOG_ERROR(LABEL, "path %{public}s is not directory.", SEC_COMP_SRV_CFG_PATH.c_str()); + return false; + } + return true; +} + +bool FirstUseDialog::IsCfgFileExist(void) +{ + struct stat fstat = {}; + if (stat(FIRST_USE_RECORD_JSON.c_str(), &fstat) != 0) { + SC_LOG_INFO(LABEL, "path %{public}s errno %{public}d.", FIRST_USE_RECORD_JSON.c_str(), errno); + return false; + } + return true; +} + +bool FirstUseDialog::IsCfgFileValid(void) +{ + struct stat fstat = {}; + if (stat(FIRST_USE_RECORD_JSON.c_str(), &fstat) != 0) { + SC_LOG_INFO(LABEL, "path %{public}s errno %{public}d.", FIRST_USE_RECORD_JSON.c_str(), errno); + return false; + } + if (fstat.st_size > MAX_CFG_FILE_SIZE) { + SC_LOG_INFO(LABEL, "path %{public}s errno %{public}d.", FIRST_USE_RECORD_JSON.c_str(), errno); + return false; + } + return true; +} + +bool FirstUseDialog::ReadCfgContent(std::string& content) +{ + std::stringstream buffer; + std::ifstream i(FIRST_USE_RECORD_JSON); + if (!i.is_open()) { + SC_LOG_ERROR(LABEL, "cannot open file %{public}s, errno %{public}d.", FIRST_USE_RECORD_JSON.c_str(), errno); + return false; + } + buffer << i.rdbuf(); + content = buffer.str(); + i.close(); + return true; +} + +void FirstUseDialog::WriteCfgContent(const std::string& content) +{ + std::ofstream out(FIRST_USE_RECORD_JSON); + if (!out.is_open()) { + SC_LOG_ERROR(LABEL, "cannot open file %{public}s, errno %{public}d.", FIRST_USE_RECORD_JSON.c_str(), errno); + return; + } + out << content; + out.close(); +} + +bool FirstUseDialog::ParseRecord(nlohmann::json& jsonRes, + AccessToken::AccessTokenID& id, uint64_t& type) +{ + if (jsonRes.find(TOKEN_ID_TAG) == jsonRes.end() || + !jsonRes.at(TOKEN_ID_TAG).is_number()) { + SC_LOG_ERROR(LABEL, "parse TokenId failed."); + return false; + } + id = jsonRes.at(TOKEN_ID_TAG).get(); + if (id == AccessToken::INVALID_TOKENID) { + SC_LOG_ERROR(LABEL, "TokenId is not invalid."); + return false; + } + + if (jsonRes.find(COMP_TYPE_TAG) == jsonRes.end() || + !jsonRes.at(COMP_TYPE_TAG).is_number()) { + SC_LOG_ERROR(LABEL, "parse CompType failed."); + return false; + } + type = jsonRes.at(COMP_TYPE_TAG).get(); + return true; +} + +void FirstUseDialog::ParseRecords(nlohmann::json& jsonRes) +{ + std::unique_lock lock(useMapMutex_); + if (jsonRes.find(FIRST_USE_RECORD_TAG) == jsonRes.end() || + !jsonRes.at(FIRST_USE_RECORD_TAG).is_array()) { + SC_LOG_ERROR(LABEL, "parse tag failed."); + return; + } + + nlohmann::json recordListJson = jsonRes.at(FIRST_USE_RECORD_TAG); + for (auto& recordJson : recordListJson) { + AccessToken::AccessTokenID id; + uint64_t type; + if (!ParseRecord(recordJson, id, type)) { + SC_LOG_ERROR(LABEL, "parse record failed."); + return; + } + firstUseMap_[id] = type; + } +} + +void FirstUseDialog::LoadFirstUseRecord(void) +{ + if (!IsCfgFileValid()) { + SC_LOG_INFO(LABEL, "first use record is invalid."); + return; + } + + std::string content; + if (!ReadCfgContent(content)) { + return; + } + + nlohmann::json jsonRes = nlohmann::json::parse(content, nullptr, false); + if (jsonRes.is_discarded()) { + SC_LOG_ERROR(LABEL, "cfg info format is invalid"); + return; + } + + ParseRecords(jsonRes); +} + +void FirstUseDialog::SaveFirstUseRecord(void) +{ + SC_LOG_INFO(LABEL, "start save first_use_record json"); + if (!IsCfgDirExist()) { + SC_LOG_ERROR(LABEL, "dir %{public}s is not exist, errno %{public}d", + SEC_COMP_SRV_CFG_PATH.c_str(), errno); + return; + } + + if (!IsCfgFileExist()) { + if (creat(FIRST_USE_RECORD_JSON.c_str(), S_IRUSR | S_IWUSR) == -1) { + SC_LOG_ERROR(LABEL, "create %{public}s failed, errno %{public}d", + FIRST_USE_RECORD_JSON.c_str(), errno); + return; + } + } + + nlohmann::json jsonRes; + { + std::unique_lock lock(useMapMutex_); + nlohmann::json recordsJson; + for (auto iter = firstUseMap_.begin(); iter != firstUseMap_.end(); ++iter) { + AccessToken::AccessTokenID id = iter->first; + AccessToken::HapTokenInfo info; + if (AccessToken::AccessTokenKit::GetHapTokenInfo(id, info) != AccessToken::RET_SUCCESS) { + SC_LOG_INFO(LABEL, "token id %{public}d is not exist, do not update it.", id); + continue; + } + nlohmann::json recordJson; + recordJson[TOKEN_ID_TAG] = id; + recordJson[COMP_TYPE_TAG] = iter->second; + recordsJson.emplace_back(recordJson); + } + + jsonRes[FIRST_USE_RECORD_TAG] = recordsJson; + } + WriteCfgContent(jsonRes.dump()); +} + +void FirstUseDialog::StartDialogAbility(SecCompType type, sptr callerToken) +{ + int32_t typeNum; + if (type == LOCATION_COMPONENT) { + typeNum = 0; + } else if (type == SAVE_COMPONENT) { + typeNum = 1; + } else { + SC_LOG_ERROR(LABEL, "unknown type."); + return; + } + + AAFwk::Want want; + want.SetElementName(GRANT_ABILITY_BUNDLE_NAME, GRANT_ABILITY_ABILITY_NAME); + want.SetParam(TYPE_KEY, typeNum); + want.SetParam(TOKEN_KEY, callerToken); + int startRes = AAFwk::AbilityManagerClient::GetInstance()->StartExtensionAbility(want, callerToken); + SC_LOG_INFO(LABEL, "start ability res %{public}d", startRes); +} + +void FirstUseDialog::SendSaveEventHandler(void) +{ + std::function delayed = ([this]() { + this->SaveFirstUseRecord(); + }); + + SC_LOG_INFO(LABEL, "Delay first_use_record json"); + secHandler_->ProxyPostTask(delayed); +} + +void FirstUseDialog::NotifyFirstUseDialog(AccessToken::AccessTokenID tokenId, SecCompType type, + sptr callerToken) +{ + if (secHandler_ == nullptr) { + SC_LOG_ERROR(LABEL, "event handler invalid."); + return; + } + if (callerToken == nullptr) { + SC_LOG_INFO(LABEL, "callerToken is null, no need to notify dialog"); + return; + } + + uint64_t typeMask; + if (type == LOCATION_COMPONENT) { + typeMask = LOCATION_BUTTON_FIRST_USE; + } else if (type == SAVE_COMPONENT) { + typeMask = SAVE_BUTTON_FIRST_USE; + } else { + SC_LOG_INFO(LABEL, "this type need not notify dialog to user"); + return; + } + + std::unique_lock lock(useMapMutex_); + auto iter = firstUseMap_.find(tokenId); + if (iter == firstUseMap_.end()) { + SC_LOG_INFO(LABEL, "has not use record, start dialog"); + StartDialogAbility(type, callerToken); + firstUseMap_[tokenId] = typeMask; + SendSaveEventHandler(); + return; + } + + uint64_t compTypes = firstUseMap_[tokenId]; + if ((compTypes & typeMask) == typeMask) { + SC_LOG_INFO(LABEL, "no need notify again."); + return; + } + StartDialogAbility(type, callerToken); + firstUseMap_[tokenId] |= typeMask; + SendSaveEventHandler(); +} + +void FirstUseDialog::Init(std::shared_ptr secHandler) +{ + SC_LOG_DEBUG(LABEL, "Init!!"); + secHandler_ = secHandler; + LoadFirstUseRecord(); +} +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS + diff --git a/services/security_component_service/sa/sa_main/first_use_dialog.h b/services/security_component_service/sa/sa_main/first_use_dialog.h new file mode 100644 index 0000000..fd04777 --- /dev/null +++ b/services/security_component_service/sa/sa_main/first_use_dialog.h @@ -0,0 +1,64 @@ +/* + * 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 FIRST_USE_DIALOG_H +#define FIRST_USE_DIALOG_H + +#include +#include +#include +#include +#include "access_token.h" +#include "iremote_object.h" +#include "nlohmann/json.hpp" +#include "sec_comp_err.h" +#include "sec_comp_info.h" +#include "sec_event_handler.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +constexpr uint64_t LOCATION_BUTTON_FIRST_USE = 1 << 0; +constexpr uint64_t SAVE_BUTTON_FIRST_USE = 1 << 1; + +class FirstUseDialog final { +public: + FirstUseDialog() = default; + ~FirstUseDialog() = default; + void NotifyFirstUseDialog(AccessToken::AccessTokenID tokenId, SecCompType type, sptr callerToken); + void Init(std::shared_ptr secHandler); + +private: + bool IsCfgDirExist(void); + bool IsCfgFileExist(void); + bool IsCfgFileValid(void); + bool ReadCfgContent(std::string& content); + void WriteCfgContent(const std::string& content); + bool ParseRecord(nlohmann::json& jsonRes, + AccessToken::AccessTokenID& id, uint64_t& type); + void ParseRecords(nlohmann::json& jsonRes); + void LoadFirstUseRecord(void); + void SaveFirstUseRecord(void); + void StartDialogAbility(SecCompType type, sptr callerToken); + void SendSaveEventHandler(void); + + std::mutex useMapMutex_; + std::unordered_map firstUseMap_; + std::shared_ptr secHandler_; +}; +} // namespace SecurityComponentEnhance +} // namespace Security +} // namespace OHOS +#endif // FIRST_USE_DIALOG_H + diff --git a/services/security_component_service/sa/sa_main/sec_comp_entity.cpp b/services/security_component_service/sa/sa_main/sec_comp_entity.cpp new file mode 100644 index 0000000..e1bc9e4 --- /dev/null +++ b/services/security_component_service/sa/sa_main/sec_comp_entity.cpp @@ -0,0 +1,85 @@ +/* + * 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 "sec_comp_entity.h" + +#include +#include "hisysevent.h" +#include "ipc_skeleton.h" +#include "sec_comp_err.h" +#include "sec_comp_enhance_adapter.h" +#include "sec_comp_info_helper.h" +#include "sec_comp_log.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +namespace { +constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompEntity"}; +static constexpr uint64_t MAX_TOUCH_INTERVAL = 1000000L; // 1000ms +static constexpr uint64_t TIME_CONVERSION_UNIT = 1000; +} + +int32_t SecCompEntity::RevokeTempPermission() +{ + if (!isGrant_) { + SC_LOG_ERROR(LABEL, "security component is not granted"); + return SC_OK; + } + isGrant_ = false; + return SecCompInfoHelper::RevokeTempPermission(tokenId_, componentInfo_); +} + +int32_t SecCompEntity::GrantTempPermission() +{ + isGrant_ = true; + return SecCompInfoHelper::GrantTempPermission(tokenId_, componentInfo_); +} + +bool SecCompEntity::CompareComponentBasicInfo(SecCompBase* other, bool isRectCheck) const +{ + return componentInfo_->CompareComponentBasicInfo(other, isRectCheck); +} + +bool SecCompEntity::CheckTouchInfo(const SecCompClickEvent& touchInfo) const +{ + auto current = static_cast( + std::chrono::high_resolution_clock::now().time_since_epoch().count()) / TIME_CONVERSION_UNIT; + if (touchInfo.timestamp < current - MAX_TOUCH_INTERVAL || touchInfo.timestamp > current) { + SC_LOG_ERROR(LABEL, "touch timestamp invalid touchInfo. timestamp: %{public}llu, current: %{public}llu", + static_cast(touchInfo.timestamp), static_cast(current)); + return false; + } + + if (!componentInfo_->rect_.IsInRect(touchInfo.touchX, touchInfo.touchY)) { + SC_LOG_ERROR(LABEL, "touch point is not in component rect"); + return false; + } + + int32_t res = SecCompEnhanceAdapter::CheckExtraInfo(touchInfo); + if ((res != SC_OK) && (res != SC_ENHANCE_ERROR_NOT_EXIST_ENHANCE)) { + SC_LOG_ERROR(LABEL, "HMAC checkout failed," + "touchX:%{public}f, touchY:%{public}f, timestamp:%{public}llu, dataSize:%{public}d", + touchInfo.touchX, touchInfo.touchY, static_cast(touchInfo.timestamp), + touchInfo.extraInfo.dataSize); + HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::SEC_COMPONENT, "CLICK_INFO_CHECK_FAILED", + HiviewDFX::HiSysEvent::EventType::SECURITY, "CALLER_UID", IPCSkeleton::GetCallingUid(), + "CALLER_PID", IPCSkeleton::GetCallingPid(), "SC_ID", scId_, "SC_TYPE", componentInfo_->type_); + return false; + } + return true; +} +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS diff --git a/services/security_component_service/sa/sa_main/sec_comp_entity.h b/services/security_component_service/sa/sa_main/sec_comp_entity.h new file mode 100644 index 0000000..d95f6f6 --- /dev/null +++ b/services/security_component_service/sa/sa_main/sec_comp_entity.h @@ -0,0 +1,80 @@ +/* + * 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 SECURITY_COMPONENT_ENTITY_H +#define SECURITY_COMPONENT_ENTITY_H + +#include +#include "accesstoken_kit.h" +#include "sec_comp_base.h" +#include "sec_comp_info.h" +#include "sec_comp_perm_manager.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +class SecCompEntity { +public: + SecCompEntity(std::shared_ptr component, + AccessToken::AccessTokenID token, int32_t scId) : componentInfo_(component), + tokenId_(token), scId_(scId){}; + ~SecCompEntity() = default; + int32_t RevokeTempPermission(); + int32_t GrantTempPermission(); + int32_t GetScId() const + { + return scId_; + }; + + SecCompType GetType() const + { + if (componentInfo_ == nullptr) { + return UNKNOWN_SC_TYPE; + } + return componentInfo_->type_; + }; + + bool IsGrant() const + { + return isGrant_; + } + + std::shared_ptr GetComponentInfo() const + { + return componentInfo_; + }; + + void SetComponentInfo(const std::shared_ptr& com) + { + componentInfo_ = com; + }; + + std::shared_ptr GetComponentInfo() + { + return componentInfo_; + }; + + bool CompareComponentBasicInfo(SecCompBase* other, bool isRectCheck) const; + bool CheckTouchInfo(const SecCompClickEvent& touchInfo) const; + +private: + std::shared_ptr componentInfo_; + bool isGrant_ = false; + AccessToken::AccessTokenID tokenId_; + int32_t scId_; +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // SECURITY_COMPONENT_ENTITY_H diff --git a/services/security_component_service/sa/sa_main/sec_comp_info_helper.cpp b/services/security_component_service/sa/sa_main/sec_comp_info_helper.cpp new file mode 100644 index 0000000..7058200 --- /dev/null +++ b/services/security_component_service/sa/sa_main/sec_comp_info_helper.cpp @@ -0,0 +1,272 @@ +/* + * 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 "sec_comp_info_helper.h" + +#include "display.h" +#include "display_info.h" +#include "display_manager.h" +#include "location_button.h" +#include "paste_button.h" +#include "save_button.h" +#include "sec_comp_err.h" +#include "sec_comp_log.h" +#include "sec_comp_service.h" +#include "sec_comp_tool.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +namespace { +constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompInfoHelper"}; +static constexpr double MAX_RECT_PERCENT = 0.1F; // 10% +static constexpr double ZERO_OFFSET = 0.0F; +static std::mutex g_renderLock; +} + +SecCompBase* SecCompInfoHelper::ParseComponent(SecCompType type, const nlohmann::json& jsonComponent) +{ + SecCompBase* comp = nullptr; + switch (type) { + case LOCATION_COMPONENT: + comp = ConstructComponent(jsonComponent); + break; + case PASTE_COMPONENT: + comp = ConstructComponent(jsonComponent); + break; + case SAVE_COMPONENT: + comp = ConstructComponent(jsonComponent); + break; + default: + SC_LOG_ERROR(LABEL, "Parse component type unknown"); + break; + } + if (comp == nullptr) { + SC_LOG_ERROR(LABEL, "Parse component failed"); + return comp; + } + + comp->SetValid(CheckComponentValid(comp)); + return comp; +} + +static bool GetScreenSize(double& width, double& height) +{ + sptr display = + OHOS::Rosen::DisplayManager::GetInstance().GetDefaultDisplaySync(); + if (display == nullptr) { + SC_LOG_ERROR(LABEL, "Get display manager failed"); + return false; + } + + auto info = display->GetDisplayInfo(); + if (info == nullptr) { + SC_LOG_ERROR(LABEL, "Get display info failed"); + return false; + } + + width = static_cast(info->GetWidth()); + height = static_cast(info->GetHeight()); + SC_LOG_DEBUG(LABEL, "display manager Screen width %{public}f height %{public}f", + width, height); + return true; +} + +bool SecCompInfoHelper::CheckRectValid(const SecCompRect& rect, const SecCompRect& windowRect) +{ + double curScreenWidth = 0.0F; + double curScreenHeight = 0.0F; + if (!GetScreenSize(curScreenWidth, curScreenHeight)) { + SC_LOG_ERROR(LABEL, "Get screen size is invalid"); + return false; + } + + if (GreatOrEqual(0.0, rect.width_) || GreatOrEqual(0.0, rect.height_)) { + SC_LOG_ERROR(LABEL, "width or height is <= 0"); + return false; + } + + if (GreatNotEqual(ZERO_OFFSET, rect.x_) || GreatNotEqual(ZERO_OFFSET, rect.y_) || + GreatNotEqual(rect.x_, curScreenWidth) || GreatNotEqual(rect.y_, curScreenHeight)) { + SC_LOG_ERROR(LABEL, "start point is out of screen"); + return false; + } + + if (GreatOrEqual((rect.x_ + rect.width_), curScreenWidth) || + GreatOrEqual((rect.y_ + rect.height_), curScreenHeight)) { + SC_LOG_ERROR(LABEL, "rect is out of screen"); + return false; + } + + if (GreatNotEqual(windowRect.x_, rect.x_) || GreatNotEqual(windowRect.y_, rect.y_) || + GreatNotEqual(rect.width_, windowRect.width_) || GreatNotEqual(rect.height_, windowRect.height_)) { + SC_LOG_ERROR(LABEL, "rect is out of window"); + return false; + } + + // check rect > 10% + if (GreatOrEqual((rect.width_ * rect.height_), (curScreenWidth * curScreenHeight * MAX_RECT_PERCENT))) { + SC_LOG_ERROR(LABEL, "rect area is too large"); + return false; + } + SC_LOG_DEBUG(LABEL, "check component rect success."); + return true; +} + +static bool CheckSecCompBaseButton(const SecCompBase* comp) +{ + if ((comp->text_ < 0) && (comp->icon_ < 0)) { + SC_LOG_INFO(LABEL, "both text and icon do not exist."); + return false; + } + if ((comp->text_ >= 0) && comp->fontSize_ < MIN_FONT_SIZE) { + SC_LOG_INFO(LABEL, "font size invalid."); + return false; + } + if ((comp->icon_ >= 0) && comp->iconSize_ < MIN_ICON_SIZE) { + SC_LOG_INFO(LABEL, "icon size invalid."); + return false; + } + + if ((comp->bg_ != SecCompBackground::NO_BG_TYPE) && + (((comp->text_ != NO_TEXT) && (IsColorSimilar(comp->fontColor_, comp->bgColor_))) || + ((comp->icon_ != NO_ICON) && (IsColorSimilar(comp->iconColor_, comp->bgColor_))))) { + SC_LOG_INFO(LABEL, "fontColor or iconColor is similar whith backgroundColor."); + return false; + } + + if (comp->bg_ == SecCompBackground::NO_BG_TYPE && + ((comp->padding_.top != MIN_PADDING_WITHOUT_BG) || (comp->padding_.right != MIN_PADDING_WITHOUT_BG) || + (comp->padding_.bottom != MIN_PADDING_WITHOUT_BG) || (comp->padding_.left != MIN_PADDING_WITHOUT_BG))) { + SC_LOG_INFO(LABEL, "padding can not change without background."); + return false; + } + + return true; +} + +static bool CheckSecCompBase(const SecCompBase* comp) +{ + if (comp->parentEffect_) { + SC_LOG_ERROR(LABEL, "parentEffect is active, security component invalid."); + return false; + } + + if ((comp->padding_.top < MIN_PADDING_SIZE) || (comp->padding_.right < MIN_PADDING_SIZE) || + (comp->padding_.bottom < MIN_PADDING_SIZE) || (comp->padding_.left < MIN_PADDING_SIZE) || + (comp->textIconSpace_ < MIN_PADDING_SIZE)) { + SC_LOG_ERROR(LABEL, "size is invalid."); + return false; + } + + if (((comp->bg_ != SecCompBackground::NO_BG_TYPE) && (IsColorTransparent(comp->bgColor_))) || + ((comp->text_ != NO_TEXT) && (IsColorTransparent(comp->fontColor_))) || + ((comp->icon_ != NO_ICON) && (IsColorTransparent(comp->iconColor_)))) { + SC_LOG_ERROR(LABEL, "bgColor or fontColor or iconColor is too transparent."); + return false; + } + if (!CheckSecCompBaseButton(comp)) { + return false; + } + return true; +} + +bool SecCompInfoHelper::CheckComponentValid(const SecCompBase* comp) +{ + if ((comp == nullptr) || !IsComponentTypeValid(comp->type_)) { + SC_LOG_INFO(LABEL, "comp is null or type is invalid."); + return false; + } + + if (!CheckSecCompBase(comp)) { + SC_LOG_INFO(LABEL, "SecComp base is invalid."); + return false; + } + + return true; +} + +int32_t SecCompInfoHelper::GrantTempPermission(AccessToken::AccessTokenID tokenId, + const std::shared_ptr& componentInfo) +{ + if ((tokenId <= 0) || (componentInfo == nullptr)) { + SC_LOG_ERROR(LABEL, "revoke component is null"); + return SC_SERVICE_ERROR_PERMISSION_OPER_FAIL; + } + + SecCompType type = componentInfo->type_; + switch (type) { + case LOCATION_COMPONENT: + { + int32_t res = SecCompPermManager::GetInstance().GrantLocationPermission(tokenId, + "ohos.permission.APPROXIMATELY_LOCATION", AccessToken::PermissionFlag::PERMISSION_COMPONENT_SET); + if (res != SC_OK) { + return SC_SERVICE_ERROR_PERMISSION_OPER_FAIL; + } + res = SecCompPermManager::GetInstance().GrantLocationPermission(tokenId, "ohos.permission.LOCATION", + AccessToken::PermissionFlag::PERMISSION_COMPONENT_SET); + if (res != SC_OK) { + SecCompPermManager::GetInstance().RevokeLocationPermission( + tokenId, "ohos.permission.APPROXIMATELY_LOCATION", + AccessToken::PermissionFlag::PERMISSION_COMPONENT_SET); + return SC_SERVICE_ERROR_PERMISSION_OPER_FAIL; + } + return SC_OK; + } + case PASTE_COMPONENT: + SC_LOG_DEBUG(LABEL, "grant paste permission"); + return SC_OK; + case SAVE_COMPONENT: + SC_LOG_DEBUG(LABEL, "grant save permission"); + return SecCompPermManager::GetInstance().GrantTempSavePermission(tokenId); + default: + SC_LOG_ERROR(LABEL, "Parse component type unknown"); + break; + } + return SC_SERVICE_ERROR_PERMISSION_OPER_FAIL; +} + +int32_t SecCompInfoHelper::RevokeTempPermission(AccessToken::AccessTokenID tokenId, + const std::shared_ptr& componentInfo) +{ + if (componentInfo == nullptr) { + SC_LOG_ERROR(LABEL, "revoke component is null"); + return SC_SERVICE_ERROR_PERMISSION_OPER_FAIL; + } + + SecCompType type = componentInfo->type_; + switch (type) { + case LOCATION_COMPONENT: + { + int32_t locationRes = SecCompPermManager::GetInstance().RevokeLocationPermission(tokenId, + "ohos.permission.LOCATION", AccessToken::PermissionFlag::PERMISSION_COMPONENT_SET); + int32_t approxLocationRes = SecCompPermManager::GetInstance().RevokeLocationPermission(tokenId, + "ohos.permission.APPROXIMATELY_LOCATION", AccessToken::PermissionFlag::PERMISSION_COMPONENT_SET); + if ((locationRes != SC_OK) || (approxLocationRes != SC_OK)) { + return SC_SERVICE_ERROR_PERMISSION_OPER_FAIL; + } + return SC_OK; + } + case PASTE_COMPONENT: + SC_LOG_DEBUG(LABEL, "revoke paste permission"); + return SC_OK; + default: + SC_LOG_ERROR(LABEL, "revoke component type unknown"); + break; + } + return SC_SERVICE_ERROR_PERMISSION_OPER_FAIL; +} +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS diff --git a/services/security_component_service/sa/sa_main/sec_comp_info_helper.h b/services/security_component_service/sa/sa_main/sec_comp_info_helper.h new file mode 100644 index 0000000..463c9fc --- /dev/null +++ b/services/security_component_service/sa/sa_main/sec_comp_info_helper.h @@ -0,0 +1,51 @@ +/* + * 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 I_SECURITY_COMPONENT_INFO_HELPER_H +#define I_SECURITY_COMPONENT_INFO_HELPER_H + +#include "accesstoken_kit.h" +#include "nlohmann/json.hpp" +#include "sec_comp_base.h" +#include "sec_comp_info.h" +#include "sec_comp_perm_manager.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +template +T* ConstructComponent(const nlohmann::json& jsonComponent) +{ + T *componentPtr = new (std::nothrow)T(); + if ((componentPtr != nullptr) && !componentPtr->FromJson(jsonComponent)) { + delete componentPtr; + return nullptr; + } + return componentPtr; +} + +class SecCompInfoHelper { +public: + static SecCompBase* ParseComponent(SecCompType type, const nlohmann::json& jsonComponent); + static int32_t RevokeTempPermission(AccessToken::AccessTokenID tokenId, + const std::shared_ptr& componentInfo); + static int32_t GrantTempPermission(AccessToken::AccessTokenID tokenId, + const std::shared_ptr& componentInfo); + static bool CheckComponentValid(const SecCompBase* comp); + static bool CheckRectValid(const SecCompRect& rect, const SecCompRect& windowRect); +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // I_SECURITY_COMPONENT_INFO_HELPER_H diff --git a/services/security_component_service/sa/sa_main/sec_comp_manager.cpp b/services/security_component_service/sa/sa_main/sec_comp_manager.cpp new file mode 100644 index 0000000..899e2b4 --- /dev/null +++ b/services/security_component_service/sa/sa_main/sec_comp_manager.cpp @@ -0,0 +1,519 @@ +/* + * 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 "sec_comp_manager.h" + +#include "delay_exit_task.h" +#include "hisysevent.h" +#include "i_sec_comp_service.h" +#include "ipc_skeleton.h" +#include "iservice_registry.h" +#include "sec_comp_enhance_adapter.h" +#include "sec_comp_err.h" +#include "sec_comp_info_helper.h" +#include "sec_comp_log.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +namespace { +constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompManager"}; +static constexpr int32_t SC_ID_START = 1000; +static constexpr int32_t MAX_INT_NUM = 0x7fffffff; +static constexpr int32_t ROOT_UID = 0; +} + +SecCompManager::SecCompManager() +{ + scIdStart_ = SC_ID_START; +} + +SecCompManager& SecCompManager::GetInstance() +{ + static SecCompManager instance; + return instance; +} + +int32_t SecCompManager::CreateScId() +{ + std::lock_guard lock(scIdMtx_); + if (scIdStart_ == MAX_INT_NUM) { + scIdStart_ = SC_ID_START; + } else { + scIdStart_++; + } + return scIdStart_; +} + +int32_t SecCompManager::AddSecurityComponentToList(int32_t pid, const SecCompEntity& newEntity) +{ + OHOS::Utils::UniqueWriteGuard lk(this->componentInfoLock_); + if (isSaExit_) { + SC_LOG_ERROR(LABEL, "SA is exiting, retry..."); + return SC_SERVICE_ERROR_SERVICE_NOT_EXIST; + } + + auto iter = componentMap_.find(pid); + if (iter != componentMap_.end()) { + iter->second.isForeground = true; + iter->second.compList.emplace_back(newEntity); + SecCompEnhanceAdapter::EnableInputEnhance(); + return SC_OK; + } + + ProcessCompInfos newProcess; + newProcess.isForeground = true; + newProcess.compList.emplace_back(newEntity); + componentMap_[pid] = newProcess; + SecCompEnhanceAdapter::EnableInputEnhance(); + return SC_OK; +} + +int32_t SecCompManager::DeleteSecurityComponentFromList(int32_t pid, int32_t scId) +{ + OHOS::Utils::UniqueWriteGuard lk(this->componentInfoLock_); + auto iter = componentMap_.find(pid); + if (iter == componentMap_.end()) { + SC_LOG_ERROR(LABEL, "Can not find registered process"); + return SC_SERVICE_ERROR_COMPONENT_NOT_EXIST; + } + std::vector& list = iter->second.compList; + for (auto it = list.begin(); it != list.end(); ++it) { + if (it->GetScId() == scId) { + it->RevokeTempPermission(); + list.erase(it); + if (!IsForegroundCompExist()) { + SecCompEnhanceAdapter::DisableInputEnhance(); + } + return SC_OK; + } + } + SC_LOG_ERROR(LABEL, "Can not find component"); + return SC_SERVICE_ERROR_COMPONENT_NOT_EXIST; +} + +bool SecCompManager::IsInMaliciousAppList(int32_t pid) +{ + std::lock_guard lock(maliciousMtx_); + if (IPCSkeleton::GetCallingUid() == ROOT_UID) { + return false; + } + return (maliciousAppList_.find(pid) != maliciousAppList_.end()); +} + +void SecCompManager::AddAppToMaliciousAppList(int32_t pid) +{ + std::lock_guard lock(maliciousMtx_); + maliciousAppList_.insert(pid); +} + +void SecCompManager::RemoveAppFromMaliciousAppList(int32_t pid) +{ + std::lock_guard lock(maliciousMtx_); + maliciousAppList_.erase(pid); +} + +bool SecCompManager::IsMaliciousAppListEmpty() +{ + std::lock_guard lock(maliciousMtx_); + return (maliciousAppList_.size() == 0); +} + +static std::string TransformCallBackResult(enum SCErrCode error) +{ + std::string errMsg = ""; + switch (error) { + case SC_ENHANCE_ERROR_NOT_EXIST_ENHANCE: + errMsg = "enhance do not exist"; + break; + case SC_ENHANCE_ERROR_VALUE_INVALID: + errMsg = "value is invalid"; + break; + case SC_ENHANCE_ERROR_CALLBACK_NOT_EXIST: + errMsg = "callback do not exist"; + break; + case SC_ENHANCE_ERROR_CALLBACK_OPER_FAIL: + errMsg = "callback operate fail"; + break; + case SC_SERVICE_ERROR_COMPONENT_INFO_INVALID: + errMsg = "component info invalid"; + break; + case SC_ENHANCE_ERROR_CALLBACK_CHECK_FAIL: + errMsg = "callback check fail"; + break; + default: + errMsg = "unknown error"; + break; + } + return errMsg; +} + +SecCompEntity* SecCompManager::GetSecurityComponentFromList(int32_t pid, int32_t scId) +{ + auto iter = componentMap_.find(pid); + if (iter == componentMap_.end()) { + return nullptr; + } + std::vector& list = iter->second.compList; + for (auto it = list.begin(); it != list.end(); ++it) { + if (it->GetScId() == scId) { + return std::addressof(*it); + } + } + return nullptr; +} + +bool SecCompManager::IsForegroundCompExist() +{ + return std::any_of(componentMap_.begin(), componentMap_.end(), [](const auto & iter) { + return (iter.second.isForeground) && (iter.second.compList.size() > 0); + }); +} + +void SecCompManager::NotifyProcessForeground(int32_t pid) +{ + OHOS::Utils::UniqueWriteGuard lk(this->componentInfoLock_); + auto iter = componentMap_.find(pid); + if (iter == componentMap_.end()) { + return; + } + iter->second.isForeground = true; + if (IsForegroundCompExist()) { + SecCompEnhanceAdapter::EnableInputEnhance(); + } + + SC_LOG_INFO(LABEL, "App pid %{public}d to foreground", pid); +} + +void SecCompManager::NotifyProcessBackground(int32_t pid) +{ + OHOS::Utils::UniqueWriteGuard lk(this->componentInfoLock_); + auto iter = componentMap_.find(pid); + if (iter == componentMap_.end()) { + return; + } + + iter->second.isForeground = false; + if (!IsForegroundCompExist()) { + SecCompEnhanceAdapter::DisableInputEnhance(); + } + SC_LOG_INFO(LABEL, "App pid %{public}d to background", pid); +} + +void SecCompManager::NotifyProcessDied(int32_t pid) +{ + // notify enhance process died. + SecCompEnhanceAdapter::NotifyProcessDied(pid); + + RemoveAppFromMaliciousAppList(pid); + OHOS::Utils::UniqueWriteGuard lk(this->componentInfoLock_); + auto iter = componentMap_.find(pid); + if (iter == componentMap_.end()) { + return; + } + SC_LOG_INFO(LABEL, "App pid %{public}d died", pid); + std::vector& list = iter->second.compList; + for (auto it = list.begin(); it != list.end(); ++it) { + it->RevokeTempPermission(); + } + list.clear(); + componentMap_.erase(pid); + + if (!IsForegroundCompExist()) { + SecCompEnhanceAdapter::DisableInputEnhance(); + } + + DelayExitTask::GetInstance().Start(); +} + +void SecCompManager::ExitSaProcess() +{ + OHOS::Utils::UniqueReadGuard lk(this->componentInfoLock_); + if (!componentMap_.empty() || !IsMaliciousAppListEmpty()) { + SC_LOG_INFO(LABEL, "Apps using security component still exist, no exit sa"); + return; + } + isSaExit_ = true; + SecCompEnhanceAdapter::DisableInputEnhance(); + SecCompEnhanceAdapter::ExistEnhanceService(); + + SC_LOG_INFO(LABEL, "All processes using security component died, start sa exit"); + auto systemAbilityMgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + if (systemAbilityMgr == nullptr) { + SC_LOG_ERROR(LABEL, "Failed to get SystemAbilityManager."); + return; + } + int32_t ret = systemAbilityMgr->UnloadSystemAbility(SA_ID_SECURITY_COMPONENT_SERVICE); + if (ret != SC_OK) { + SC_LOG_ERROR(LABEL, "Failed to UnloadSystemAbility service! errcode=%{public}d", ret); + return; + } + SC_LOG_INFO(LABEL, "UnloadSystemAbility successfully!"); +} + +void SecCompManager::ExitWhenAppMgrDied() +{ + OHOS::Utils::UniqueWriteGuard lk(this->componentInfoLock_); + for (auto iter = componentMap_.begin(); iter != componentMap_.end(); ++iter) { + std::vector& list = iter->second.compList; + for (auto it = list.begin(); it != list.end(); ++it) { + it->RevokeTempPermission(); + } + list.clear(); + } + componentMap_.clear(); + + // no need exit enhance service, only disable input enhance. + SecCompEnhanceAdapter::DisableInputEnhance(); + isSaExit_ = true; + + SC_LOG_INFO(LABEL, "app mgr died, start sa exit"); + auto systemAbilityMgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + if (systemAbilityMgr == nullptr) { + SC_LOG_ERROR(LABEL, "failed to get SystemAbilityManager."); + return; + } + int32_t ret = systemAbilityMgr->UnloadSystemAbility(SA_ID_SECURITY_COMPONENT_SERVICE); + if (ret != SC_OK) { + SC_LOG_ERROR(LABEL, "failed to UnloadSystemAbility service! errcode=%{public}d", ret); + return; + } + SC_LOG_INFO(LABEL, "UnloadSystemAbility successfully!"); +} + +void SecCompManager::SendCheckInfoEnhanceSysEvent(int32_t scId, + SecCompType type, const std::string& scene, int32_t res) +{ + if (res == SC_ENHANCE_ERROR_CHALLENGE_CHECK_FAIL) { + HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::SEC_COMPONENT, "CHALLENGE_CHECK_FAILED", + HiviewDFX::HiSysEvent::EventType::SECURITY, "CALLER_UID", IPCSkeleton::GetCallingUid(), + "CALLER_PID", IPCSkeleton::GetCallingPid(), "SC_ID", scId, "SC_TYPE", type, "CALL_SCENE", + scene); + } else { + HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::SEC_COMPONENT, "CALLBACK_FAILED", + HiviewDFX::HiSysEvent::EventType::SECURITY, "CALLER_UID", IPCSkeleton::GetCallingUid(), + "CALLER_PID", IPCSkeleton::GetCallingPid(), "SC_TYPE", type, + "CALL_SCENE", scene, "REASON", TransformCallBackResult(static_cast(res))); + } +} + +int32_t SecCompManager::RegisterSecurityComponent(SecCompType type, + const nlohmann::json& jsonComponent, const SecCompCallerInfo& caller, int32_t& scId) +{ + DelayExitTask::GetInstance().Stop(); + SC_LOG_DEBUG(LABEL, "PID: %{public}d, register security component", caller.pid); + if (IsInMaliciousAppList(caller.pid)) { + SC_LOG_ERROR(LABEL, "app is in MaliciousAppList, never allow it"); + return SC_ENHANCE_ERROR_IN_MALICIOUS_LIST; + } + + SecCompBase* componentPtr = SecCompInfoHelper::ParseComponent(type, jsonComponent); + std::shared_ptr component(componentPtr); + if (component == nullptr) { + SC_LOG_ERROR(LABEL, "Parse component info invalid"); + HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::SEC_COMPONENT, "COMPONENT_INFO_CHECK_FAILED", + HiviewDFX::HiSysEvent::EventType::SECURITY, "CALLER_UID", IPCSkeleton::GetCallingUid(), + "CALLER_PID", IPCSkeleton::GetCallingPid(), "SC_ID", scId, "CALL_SCENE", "REGITSTER", "SC_TYPE", type); + return SC_SERVICE_ERROR_COMPONENT_INFO_INVALID; + } + + int32_t enhanceRes = + SecCompEnhanceAdapter::CheckComponentInfoEnhnace(caller.pid, component, jsonComponent); + if (enhanceRes != SC_OK) { + SendCheckInfoEnhanceSysEvent(INVALID_SC_ID, type, "REGISTER", enhanceRes); + SC_LOG_ERROR(LABEL, "enhance check failed"); + AddAppToMaliciousAppList(caller.pid); + return enhanceRes; + } + + int32_t registerId = CreateScId(); + SecCompEntity entity(component, caller.tokenId, registerId); + int32_t ret = AddSecurityComponentToList(caller.pid, entity); + if (ret == SC_OK) { + scId = registerId; + } else { + SC_LOG_ERROR(LABEL, "Register security component failed"); + scId = INVALID_SC_ID; + } + return ret; +} + +int32_t SecCompManager::UpdateSecurityComponent(int32_t scId, const nlohmann::json& jsonComponent, + const SecCompCallerInfo& caller) +{ + SC_LOG_DEBUG(LABEL, "PID: %{public}d, update security component", caller.pid); + if (IsInMaliciousAppList(caller.pid)) { + SC_LOG_ERROR(LABEL, "app is in MaliciousAppList, never allow it"); + return SC_ENHANCE_ERROR_IN_MALICIOUS_LIST; + } + + OHOS::Utils::UniqueWriteGuard lk(this->componentInfoLock_); + SecCompEntity* sc = GetSecurityComponentFromList(caller.pid, scId); + if (sc == nullptr) { + SC_LOG_ERROR(LABEL, "Can not find target component"); + return SC_SERVICE_ERROR_COMPONENT_NOT_EXIST; + } + SecCompBase* report = SecCompInfoHelper::ParseComponent(sc->GetType(), jsonComponent); + std::shared_ptr reportComponentInfo(report); + if (reportComponentInfo == nullptr) { + SC_LOG_ERROR(LABEL, "Update component info invalid"); + HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::SEC_COMPONENT, "COMPONENT_INFO_CHECK_FAILED", + HiviewDFX::HiSysEvent::EventType::SECURITY, "CALLER_UID", IPCSkeleton::GetCallingUid(), + "CALLER_PID", IPCSkeleton::GetCallingPid(), "SC_ID", scId, "CALL_SCENE", "UPDATE", + "SC_TYPE", sc->GetType()); + return SC_SERVICE_ERROR_COMPONENT_INFO_INVALID; + } + + int32_t enhanceRes = + SecCompEnhanceAdapter::CheckComponentInfoEnhnace(caller.pid, reportComponentInfo, jsonComponent); + if (enhanceRes != SC_OK) { + SendCheckInfoEnhanceSysEvent(scId, sc->GetType(), "UPDATE", enhanceRes); + SC_LOG_ERROR(LABEL, "enhance check failed"); + AddAppToMaliciousAppList(caller.pid); + return enhanceRes; + } + + sc->SetComponentInfo(reportComponentInfo); + return SC_OK; +} + +int32_t SecCompManager::UnregisterSecurityComponent(int32_t scId, const SecCompCallerInfo& caller) +{ + SC_LOG_DEBUG(LABEL, "PID: %{public}d, unregister security component", caller.pid); + if (scId < 0) { + SC_LOG_ERROR(LABEL, "ScId is invalid"); + return SC_SERVICE_ERROR_VALUE_INVALID; + } + return DeleteSecurityComponentFromList(caller.pid, scId); +} + +int32_t SecCompManager::CheckClickSecurityComponentInfo(SecCompEntity* sc, int32_t scId, + const nlohmann::json& jsonComponent, const SecCompCallerInfo& caller) +{ + SC_LOG_DEBUG(LABEL, "PID: %{public}d, Check security component", caller.pid); + SecCompBase* report = SecCompInfoHelper::ParseComponent(sc->GetType(), jsonComponent); + std::shared_ptr reportComponentInfo(report); + if ((reportComponentInfo == nullptr) || (!reportComponentInfo->GetValid())) { + SC_LOG_ERROR(LABEL, "report component info invalid"); + HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::SEC_COMPONENT, "COMPONENT_INFO_CHECK_FAILED", + HiviewDFX::HiSysEvent::EventType::SECURITY, "CALLER_UID", IPCSkeleton::GetCallingUid(), + "CALLER_PID", IPCSkeleton::GetCallingPid(), "SC_ID", scId, "CALL_SCENE", "CLICK", "SC_TYPE", + sc->GetType()); + return SC_SERVICE_ERROR_COMPONENT_INFO_INVALID; + } + if ((!SecCompInfoHelper::CheckRectValid(reportComponentInfo->rect_, reportComponentInfo->windowRect_))) { + SC_LOG_ERROR(LABEL, "compare component info failed."); + HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::SEC_COMPONENT, "COMPONENT_INFO_CHECK_FAILED", + HiviewDFX::HiSysEvent::EventType::SECURITY, "CALLER_UID", IPCSkeleton::GetCallingUid(), + "CALLER_PID", IPCSkeleton::GetCallingPid(), "SC_ID", scId, "CALL_SCENE", "CLICK", "SC_TYPE", + sc->GetType()); + return SC_SERVICE_ERROR_COMPONENT_INFO_INVALID; + } + int32_t enhanceRes = + SecCompEnhanceAdapter::CheckComponentInfoEnhnace(caller.pid, reportComponentInfo, jsonComponent); + if (enhanceRes != SC_OK) { + SendCheckInfoEnhanceSysEvent(scId, sc->GetType(), "CLICK", enhanceRes); + SC_LOG_ERROR(LABEL, "enhance check failed"); + AddAppToMaliciousAppList(caller.pid); + return enhanceRes; + } + + sc->SetComponentInfo(reportComponentInfo); + return SC_OK; +} + +int32_t SecCompManager::ReportSecurityComponentClickEvent(int32_t scId, + const nlohmann::json& jsonComponent, const SecCompCallerInfo& caller, + const SecCompClickEvent& touchInfo, sptr callerToken) +{ + if (IsInMaliciousAppList(caller.pid)) { + SC_LOG_ERROR(LABEL, "app is in MaliciousAppList, never allow it"); + return SC_ENHANCE_ERROR_IN_MALICIOUS_LIST; + } + + OHOS::Utils::UniqueReadGuard lk(this->componentInfoLock_); + SecCompEntity* sc = GetSecurityComponentFromList(caller.pid, scId); + if (sc == nullptr) { + SC_LOG_ERROR(LABEL, "Can not find target component"); + return SC_SERVICE_ERROR_COMPONENT_NOT_EXIST; + } + + int32_t res = CheckClickSecurityComponentInfo(sc, scId, jsonComponent, caller); + if (res != SC_OK) { + return res; + } + + if (!sc->CheckTouchInfo(touchInfo)) { + HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::SEC_COMPONENT, "CLICK_INFO_CHECK_FAILED", + HiviewDFX::HiSysEvent::EventType::SECURITY, "CALLER_UID", IPCSkeleton::GetCallingUid(), + "CALLER_PID", IPCSkeleton::GetCallingPid(), "SC_ID", scId, "SC_TYPE", sc->GetType()); + AddAppToMaliciousAppList(caller.pid); + return SC_SERVICE_ERROR_CLICK_EVENT_INVALID; + } + res = sc->GrantTempPermission(); + if (res != SC_OK) { + HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::SEC_COMPONENT, "TEMP_GRANT_FAILED", + HiviewDFX::HiSysEvent::EventType::FAULT, "CALLER_UID", IPCSkeleton::GetCallingUid(), + "CALLER_PID", IPCSkeleton::GetCallingPid(), "SC_ID", scId, "SC_TYPE", sc->GetType()); + return res; + } + HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::SEC_COMPONENT, "TEMP_GRANT_SUCCESS", + HiviewDFX::HiSysEvent::EventType::BEHAVIOR, "CALLER_UID", IPCSkeleton::GetCallingUid(), + "CALLER_PID", IPCSkeleton::GetCallingPid(), "SC_ID", scId, "SC_TYPE", sc->GetType()); + firstUseDialog_.NotifyFirstUseDialog(caller.tokenId, sc->GetType(), callerToken); + return res; +} + +bool SecCompManager::ReduceAfterVerifySavePermission(AccessToken::AccessTokenID tokenId) +{ + if (SecCompPermManager::GetInstance().RevokeTempSavePermission(tokenId) == SC_OK) { + return true; + } + return false; +} + +void SecCompManager::DumpSecComp(std::string& dumpStr) +{ + OHOS::Utils::UniqueReadGuard lk(this->componentInfoLock_); + for (auto iter = componentMap_.begin(); iter != componentMap_.end(); ++iter) { + dumpStr.append("pid:" + std::to_string(iter->first) + "\n"); + for (auto compIter = iter->second.compList.begin(); compIter != iter->second.compList.end(); compIter ++) { + nlohmann::json json; + compIter->GetComponentInfo()->ToJson(json); + dumpStr.append(" scId:" + std::to_string(compIter->GetScId()) + + ", isGrant:" + std::to_string(compIter->IsGrant()) + ", " + json.dump() + "\n"); + } + } +} + +bool SecCompManager::Initialize() +{ + SC_LOG_DEBUG(LABEL, "Initialize!!"); + SecCompEnhanceAdapter::StartEnhanceService(); + + secRunner_ = AppExecFwk::EventRunner::Create(true); + if (!secRunner_) { + SC_LOG_ERROR(LABEL, "failed to create a recvRunner."); + return false; + } + + secHandler_ = std::make_shared(secRunner_); + DelayExitTask::GetInstance().Init(secHandler_); + firstUseDialog_.Init(secHandler_); + + return SecCompPermManager::GetInstance().InitEventHandler(secHandler_); +} +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS diff --git a/services/security_component_service/sa/sa_main/sec_comp_manager.h b/services/security_component_service/sa/sa_main/sec_comp_manager.h new file mode 100644 index 0000000..3c0848c --- /dev/null +++ b/services/security_component_service/sa/sa_main/sec_comp_manager.h @@ -0,0 +1,101 @@ +/* + * 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 SECURITY_COMPONENT_MANAGER_H +#define SECURITY_COMPONENT_MANAGER_H + +#include +#include +#include +#include +#include +#include "accesstoken_kit.h" +#include "app_state_observer.h" +#include "first_use_dialog.h" +#include "nocopyable.h" +#include "rwlock.h" +#include "sec_comp_base.h" +#include "sec_comp_entity.h" +#include "sec_comp_info.h" +#include "sec_event_handler.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +struct SecCompCallerInfo { + AccessToken::AccessTokenID tokenId; + int32_t uid; + int32_t pid; +}; + +struct ProcessCompInfos { + std::vector compList; + bool isForeground = false; +}; + +class SecCompManager { +public: + static SecCompManager& GetInstance(); + virtual ~SecCompManager() = default; + + int32_t RegisterSecurityComponent(SecCompType type, const nlohmann::json& jsonComponent, + const SecCompCallerInfo& caller, int32_t& scId); + int32_t UpdateSecurityComponent(int32_t scId, const nlohmann::json& jsonComponent, + const SecCompCallerInfo& caller); + int32_t UnregisterSecurityComponent(int32_t scId, const SecCompCallerInfo& caller); + int32_t ReportSecurityComponentClickEvent(int32_t scId, const nlohmann::json& jsonComponent, + const SecCompCallerInfo& caller, const SecCompClickEvent& touchInfo, sptr callerToken); + bool ReduceAfterVerifySavePermission(AccessToken::AccessTokenID tokenId); + void NotifyProcessForeground(int32_t pid); + void NotifyProcessBackground(int32_t pid); + void NotifyProcessDied(int32_t pid); + void DumpSecComp(std::string& dumpStr); + bool Initialize(); + void ExitSaProcess(); + void ExitWhenAppMgrDied(); + +private: + SecCompManager(); + bool IsForegroundCompExist(); + int32_t AddSecurityComponentToList(int32_t pid, const SecCompEntity& newEntity); + int32_t DeleteSecurityComponentFromList(int32_t pid, int32_t scId); + SecCompEntity* GetSecurityComponentFromList(int32_t pid, int32_t scId); + int32_t CheckClickSecurityComponentInfo(SecCompEntity* sc, int32_t scId, + const nlohmann::json& jsonComponent, const SecCompCallerInfo& caller); + bool IsInMaliciousAppList(int32_t pid); + void AddAppToMaliciousAppList(int32_t pid); + void RemoveAppFromMaliciousAppList(int32_t pid); + bool IsMaliciousAppListEmpty(); + void SendCheckInfoEnhanceSysEvent(int32_t scId, + SecCompType type, const std::string& scene, int32_t res); + int32_t CreateScId(); + + OHOS::Utils::RWLock componentInfoLock_; + std::mutex scIdMtx_; + std::unordered_map componentMap_; + int32_t scIdStart_; + bool isSaExit_ = false; + + std::shared_ptr secRunner_; + std::shared_ptr secHandler_; + std::set maliciousAppList_; // pid set + std::mutex maliciousMtx_; + FirstUseDialog firstUseDialog_; + + DISALLOW_COPY_AND_MOVE(SecCompManager); +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // SECURITY_COMPONENT_MANAGER_H diff --git a/services/security_component_service/sa/sa_main/sec_comp_perm_manager.cpp b/services/security_component_service/sa/sa_main/sec_comp_perm_manager.cpp new file mode 100644 index 0000000..7c10b7a --- /dev/null +++ b/services/security_component_service/sa/sa_main/sec_comp_perm_manager.cpp @@ -0,0 +1,132 @@ +/* + * 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 "sec_comp_perm_manager.h" + +#include "location_button.h" +#include "paste_button.h" +#include "save_button.h" +#include "sec_comp_err.h" +#include "sec_comp_log.h" +#include "sec_comp_service.h" +#include "sec_comp_tool.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +namespace { +constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompPermManager"}; +static const int32_t WAIT_MILLISECONDS = 5 * 1000; +} + +SecCompPermManager& SecCompPermManager::GetInstance() +{ + static SecCompPermManager instance; + return instance; +} + +bool SecCompPermManager::DelayRevokePermission(AccessToken::AccessTokenID tokenId, const std::string& taskName) +{ + if (secHandler_ == nullptr) { + SC_LOG_ERROR(LABEL, "fail to get EventHandler"); + return false; + } + + std::function delayed = ([tokenId]() { + SC_LOG_DEBUG(LABEL, "delay revoke save permission"); + SecCompPermManager::GetInstance().RevokeTempSavePermission(tokenId); + }); + + SC_LOG_DEBUG(LABEL, "revoke save permission after %{public}d ms", WAIT_MILLISECONDS); + secHandler_->ProxyPostTask(delayed, taskName, WAIT_MILLISECONDS); + return true; +} + +bool SecCompPermManager::RevokeSavePermissionTask(const std::string& taskName) +{ + if (secHandler_ == nullptr) { + SC_LOG_ERROR(LABEL, "fail to get EventHandler"); + return false; + } + + SC_LOG_DEBUG(LABEL, "revoke save permission task name:%{public}s", taskName.c_str()); + secHandler_->ProxyRemoveTask(taskName); + return true; +} + +int32_t SecCompPermManager::GrantLocationPermission(AccessToken::AccessTokenID tokenId, + const std::string& permissionName, int flag) +{ + int32_t res = AccessToken::AccessTokenKit::GrantPermission(tokenId, permissionName, + AccessToken::PermissionFlag::PERMISSION_COMPONENT_SET); + SC_LOG_INFO(LABEL, "grant permission res: %{public}d, permission: %{public}s, tokenId:%{public}d", + res, permissionName.c_str(), tokenId); + return res; +} + +int32_t SecCompPermManager::RevokeLocationPermission(AccessToken::AccessTokenID tokenId, + const std::string& permissionName, int flag) +{ + int32_t res = AccessToken::AccessTokenKit::RevokePermission(tokenId, permissionName, + AccessToken::PermissionFlag::PERMISSION_COMPONENT_SET); + SC_LOG_INFO(LABEL, "revoke permission res: %{public}d, permission: %{public}s, tokenId:%{public}d", + res, permissionName.c_str(), tokenId); + return res; +} + +int32_t SecCompPermManager::GrantTempSavePermission(AccessToken::AccessTokenID tokenId) +{ + auto current = static_cast(std::chrono::high_resolution_clock::now().time_since_epoch().count()); + std::string taskName = std::to_string(tokenId) + std::to_string(current); + if (!DelayRevokePermission(tokenId, taskName)) { + return SC_SERVICE_ERROR_PERMISSION_OPER_FAIL; + } + std::lock_guard lock(mutex_); + taskQue_.push_back(taskName); + applySaveCountMap_[tokenId]++; + SC_LOG_DEBUG(LABEL, "tokenId: %{public}d current permission apply counts is: %{public}d.", + tokenId, applySaveCountMap_[tokenId]); + return SC_OK; +} + +int32_t SecCompPermManager::RevokeTempSavePermission(AccessToken::AccessTokenID tokenId) +{ + std::lock_guard lock(mutex_); + auto iter = applySaveCountMap_.find(tokenId); + if (iter == applySaveCountMap_.end() || applySaveCountMap_[tokenId] == 0) { + SC_LOG_ERROR(LABEL, "This hap has no permissions to save files."); + return SC_SERVICE_ERROR_PERMISSION_OPER_FAIL; + } + std::string taskName = taskQue_.front(); + if (!RevokeSavePermissionTask(taskName)) { + return false; + } + taskQue_.pop_front(); + SC_LOG_DEBUG(LABEL, "tokenId: %{public}d current permission apply counts is: %{public}d.", + tokenId, applySaveCountMap_[tokenId]); + if ((--applySaveCountMap_[tokenId]) == 0) { + applySaveCountMap_.erase(tokenId); + } + return SC_OK; +} + +bool SecCompPermManager::InitEventHandler(const std::shared_ptr& secHandler) +{ + secHandler_ = secHandler; + return true; +} + +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS diff --git a/services/security_component_service/sa/sa_main/sec_comp_perm_manager.h b/services/security_component_service/sa/sa_main/sec_comp_perm_manager.h new file mode 100644 index 0000000..0cd7f76 --- /dev/null +++ b/services/security_component_service/sa/sa_main/sec_comp_perm_manager.h @@ -0,0 +1,57 @@ +/* + * 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 SECURITY_COMPONENT_PERMISSION_MANAGER_H +#define SECURITY_COMPONENT_PERMISSION_MANAGER_H + +#include +#include +#include "accesstoken_kit.h" +#include "rwlock.h" +#include "sec_comp_base.h" +#include "sec_event_handler.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +class SecCompPermManager { +public: + SecCompPermManager() = default; + virtual ~SecCompPermManager() = default; + static SecCompPermManager& GetInstance(); + + int32_t GrantLocationPermission(AccessToken::AccessTokenID tokenId, + const std::string& permissionName, int flag); + int32_t RevokeLocationPermission(AccessToken::AccessTokenID tokenId, + const std::string& permissionName, int flag); + + int32_t GrantTempSavePermission(AccessToken::AccessTokenID tokenId); + int32_t RevokeTempSavePermission(AccessToken::AccessTokenID tokenId); + + bool InitEventHandler(const std::shared_ptr& secHandler); + std::shared_ptr GetSecEventHandler() const; + +private: + bool DelayRevokePermission(AccessToken::AccessTokenID tokenId, const std::string& taskName); + bool RevokeSavePermissionTask(const std::string& taskName); + + std::unordered_map applySaveCountMap_; + std::deque taskQue_; + std::mutex mutex_; + std::shared_ptr secHandler_; +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // SECURITY_COMPONENT_PERMISSION_MANAGER_H diff --git a/services/security_component_service/sa/sa_main/sec_comp_service.cpp b/services/security_component_service/sa/sa_main/sec_comp_service.cpp new file mode 100644 index 0000000..40aad2d --- /dev/null +++ b/services/security_component_service/sa/sa_main/sec_comp_service.cpp @@ -0,0 +1,284 @@ +/* + * 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 "sec_comp_service.h" + +#include + +#include "app_mgr_death_recipient.h" +#include "hisysevent.h" +#include "hitrace_meter.h" +#include "ipc_skeleton.h" +#include "iservice_registry.h" +#include "sec_comp_enhance_adapter.h" +#include "sec_comp_err.h" +#include "sec_comp_manager.h" +#include "sec_comp_log.h" +#include "system_ability_definition.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +namespace { +constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompService"}; +static const int32_t ROOT_UID = 0; +} + +REGISTER_SYSTEM_ABILITY_BY_ID(SecCompService, SA_ID_SECURITY_COMPONENT_SERVICE, true); + +SecCompService::SecCompService(int32_t saId, bool runOnCreate) + : SystemAbility(saId, runOnCreate), state_(ServiceRunningState::STATE_NOT_START) +{ +} + +SecCompService::~SecCompService() +{ +} + +void SecCompService::OnStart() +{ + StartTrace(HITRACE_TAG_ACCESS_CONTROL, "SecurityComponentOnStart"); + if (state_ == ServiceRunningState::STATE_RUNNING) { + SC_LOG_INFO(LABEL, "SecCompService has already started!"); + FinishTrace(HITRACE_TAG_ACCESS_CONTROL); + return; + } + SC_LOG_INFO(LABEL, "SecCompService is starting"); + if (!RegisterAppStateObserver()) { + SC_LOG_ERROR(LABEL, "Failed to register app state observer!"); + FinishTrace(HITRACE_TAG_ACCESS_CONTROL); + return; + } + if (!Initialize()) { + SC_LOG_ERROR(LABEL, "Failed to initialize"); + FinishTrace(HITRACE_TAG_ACCESS_CONTROL); + return; + } + + state_ = ServiceRunningState::STATE_RUNNING; + bool ret = Publish(this); + if (!ret) { + SC_LOG_ERROR(LABEL, "Failed to publish service!"); + FinishTrace(HITRACE_TAG_ACCESS_CONTROL); + return; + } + HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::SEC_COMPONENT, "SERVICE_INIT_SUCCESS", + HiviewDFX::HiSysEvent::EventType::BEHAVIOR, "PID", getpid()); + SC_LOG_INFO(LABEL, "Congratulations, SecCompService start successfully!"); + FinishTrace(HITRACE_TAG_ACCESS_CONTROL); +} + +void SecCompService::OnStop() +{ + SC_LOG_INFO(LABEL, "Stop service"); + state_ = ServiceRunningState::STATE_NOT_START; + UnregisterAppStateObserver(); + iAppMgr_ = nullptr; + appStateObserver_ = nullptr; +} + +bool SecCompService::RegisterAppStateObserver() +{ + if (appStateObserver_ != nullptr) { + SC_LOG_INFO(LABEL, "AppStateObserver instance already create"); + return true; + } + appStateObserver_ = new (std::nothrow) AppStateObserver(); + if (appStateObserver_ == nullptr) { + SC_LOG_ERROR(LABEL, "Failed to create AppStateObserver instance"); + return false; + } + sptr samgrClient = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + if (samgrClient == nullptr) { + SC_LOG_ERROR(LABEL, "Failed to get system ability manager"); + appStateObserver_ = nullptr; + return false; + } + auto remoteObject = samgrClient->GetSystemAbility(APP_MGR_SERVICE_ID); + iAppMgr_ = iface_cast(remoteObject); + if (iAppMgr_ == nullptr) { + SC_LOG_ERROR(LABEL, "Failed to get ability manager service"); + appStateObserver_ = nullptr; + return false; + } + + if (iAppMgr_->RegisterApplicationStateObserver(appStateObserver_) != ERR_OK) { + SC_LOG_ERROR(LABEL, "Failed to Register app state observer"); + iAppMgr_ = nullptr; + appStateObserver_ = nullptr; + return false; + } + + sptr appMgrDeathRecipient = new (std::nothrow) AppMgrDeathRecipient(); + if (appMgrDeathRecipient == nullptr) { + SC_LOG_ERROR(LABEL, "Alloc appMgr death observer fail"); + return false; + } + + if (!remoteObject->AddDeathRecipient(appMgrDeathRecipient)) { + SC_LOG_ERROR(LABEL, "Add service death observer fail"); + return false; + } + + std::vector list; + if (iAppMgr_->GetForegroundApplications(list) == ERR_OK) { + for (auto it = list.begin(); it != list.end(); ++it) { + appStateObserver_->AddProcessToForegroundSet(*it); + } + } + SC_LOG_ERROR(LABEL, "Register app state observer success"); + return true; +} + +void SecCompService::UnregisterAppStateObserver() +{ + if (iAppMgr_ != nullptr && appStateObserver_ != nullptr) { + iAppMgr_->UnregisterApplicationStateObserver(appStateObserver_); + } +} + +bool SecCompService::GetCallerInfo(SecCompCallerInfo& caller) +{ + AccessToken::AccessTokenID tokenId = IPCSkeleton::GetCallingTokenID(); + int32_t pid = IPCSkeleton::GetCallingPid(); + int32_t uid = IPCSkeleton::GetCallingUid(); + if ((uid != ROOT_UID) && (AccessToken::AccessTokenKit::GetTokenTypeFlag(tokenId) != AccessToken::TOKEN_HAP)) { + SC_LOG_ERROR(LABEL, "Get caller tokenId invalid"); + return false; + } + if ((uid != ROOT_UID) && (!appStateObserver_->IsProcessForeground(pid, uid))) { + SC_LOG_ERROR(LABEL, "caller pid is not in foreground"); + return false; + } + caller.tokenId = tokenId; + caller.pid = pid; + caller.uid = uid; + return true; +} + +int32_t SecCompService::RegisterSecurityComponent(SecCompType type, + const std::string& componentInfo, int32_t& scId) +{ + StartTrace(HITRACE_TAG_ACCESS_CONTROL, "SecurityComponentRegister"); + SecCompCallerInfo caller; + if (!GetCallerInfo(caller)) { + SC_LOG_ERROR(LABEL, "Check caller failed"); + FinishTrace(HITRACE_TAG_ACCESS_CONTROL); + return SC_SERVICE_ERROR_VALUE_INVALID; + } + + nlohmann::json jsonRes = nlohmann::json::parse(componentInfo, nullptr, false); + if (jsonRes.is_discarded()) { + SC_LOG_ERROR(LABEL, "component info invalid %{public}s", componentInfo.c_str()); + FinishTrace(HITRACE_TAG_ACCESS_CONTROL); + return SC_SERVICE_ERROR_VALUE_INVALID; + } + + int32_t res = SecCompManager::GetInstance().RegisterSecurityComponent(type, jsonRes, caller, scId); + FinishTrace(HITRACE_TAG_ACCESS_CONTROL); + return res; +} + +int32_t SecCompService::UpdateSecurityComponent(int32_t scId, const std::string& componentInfo) +{ + SecCompCallerInfo caller; + if (!GetCallerInfo(caller)) { + SC_LOG_ERROR(LABEL, "Check caller failed"); + return SC_SERVICE_ERROR_VALUE_INVALID; + } + + nlohmann::json jsonRes = nlohmann::json::parse(componentInfo, nullptr, false); + if (jsonRes.is_discarded()) { + SC_LOG_ERROR(LABEL, "component info invalid %{public}s", componentInfo.c_str()); + return SC_SERVICE_ERROR_VALUE_INVALID; + } + return SecCompManager::GetInstance().UpdateSecurityComponent(scId, jsonRes, caller); +} + +int32_t SecCompService::UnregisterSecurityComponent(int32_t scId) +{ + SecCompCallerInfo caller; + if (!GetCallerInfo(caller)) { + SC_LOG_ERROR(LABEL, "Check caller failed"); + return SC_SERVICE_ERROR_VALUE_INVALID; + } + + return SecCompManager::GetInstance().UnregisterSecurityComponent(scId, caller); +} + +int32_t SecCompService::ReportSecurityComponentClickEvent(int32_t scId, + const std::string& componentInfo, const SecCompClickEvent& touchInfo, sptr callerToken) +{ + StartTrace(HITRACE_TAG_ACCESS_CONTROL, "SecurityComponentClick"); + SecCompCallerInfo caller; + if (!GetCallerInfo(caller)) { + SC_LOG_ERROR(LABEL, "Check caller failed"); + FinishTrace(HITRACE_TAG_ACCESS_CONTROL); + return SC_SERVICE_ERROR_VALUE_INVALID; + } + + nlohmann::json jsonRes = nlohmann::json::parse(componentInfo, nullptr, false); + if (jsonRes.is_discarded()) { + SC_LOG_ERROR(LABEL, "component info invalid %{public}s", componentInfo.c_str()); + FinishTrace(HITRACE_TAG_ACCESS_CONTROL); + return SC_SERVICE_ERROR_VALUE_INVALID; + } + int32_t res = + SecCompManager::GetInstance().ReportSecurityComponentClickEvent(scId, jsonRes, caller, touchInfo, callerToken); + FinishTrace(HITRACE_TAG_ACCESS_CONTROL); + return res; +} + +bool SecCompService::ReduceAfterVerifySavePermission(AccessToken::AccessTokenID tokenId) +{ + return SecCompManager::GetInstance().ReduceAfterVerifySavePermission(tokenId); +} + +sptr SecCompService::GetEnhanceRemoteObject() +{ + return SecCompEnhanceAdapter::GetEnhanceRemoteObject(); +} + +int SecCompService::Dump(int fd, const std::vector& args) +{ + if (fd < 0) { + return ERR_INVALID_VALUE; + } + + dprintf(fd, "SecCompService Dump:\n"); + std::string arg0 = ((args.size() == 0)? "" : Str16ToStr8(args.at(0))); + if (arg0.compare("-h") == 0) { + dprintf(fd, "Usage:\n"); + dprintf(fd, " -h: command help\n"); + dprintf(fd, " -a: dump all sec component\n"); + dprintf(fd, " -p: dump foreground processes\n"); + } else if (arg0.compare("-p") == 0) { + std::string dumpStr; + appStateObserver_->DumpProcess(dumpStr); + dprintf(fd, "%s\n", dumpStr.c_str()); + } else if (arg0.compare("-a") == 0 || arg0 == "") { + std::string dumpStr; + SecCompManager::GetInstance().DumpSecComp(dumpStr); + dprintf(fd, "%s\n", dumpStr.c_str()); + } + return ERR_OK; +} + +bool SecCompService::Initialize() const +{ + return SecCompManager::GetInstance().Initialize(); +} +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS diff --git a/services/security_component_service/sa/sa_main/sec_comp_service.h b/services/security_component_service/sa/sa_main/sec_comp_service.h new file mode 100644 index 0000000..99d21f2 --- /dev/null +++ b/services/security_component_service/sa/sa_main/sec_comp_service.h @@ -0,0 +1,65 @@ +/* + * 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 SECURITY_COMPONENT_SERVICE_H +#define SECURITY_COMPONENT_SERVICE_H + +#include +#include +#include "app_state_observer.h" +#include "iremote_object.h" +#include "nocopyable.h" +#include "sec_comp_manager.h" +#include "sec_comp_stub.h" +#include "singleton.h" +#include "system_ability.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +enum class ServiceRunningState { STATE_NOT_START, STATE_RUNNING }; +class SecCompService final : public SystemAbility, public SecCompStub { + DECLARE_DELAYED_SINGLETON(SecCompService); + DECLEAR_SYSTEM_ABILITY(SecCompService); + +public: + SecCompService(int32_t saId, bool runOnCreate); + + void OnStart() override; + void OnStop() override; + + int32_t RegisterSecurityComponent(SecCompType type, const std::string& componentInfo, int32_t& scId) override; + int32_t UpdateSecurityComponent(int32_t scId, const std::string& componentInfo) override; + int32_t UnregisterSecurityComponent(int32_t scId) override; + int32_t ReportSecurityComponentClickEvent(int32_t scId, + const std::string& componentInfo, const SecCompClickEvent& touchInfo, sptr callerToken) override; + bool ReduceAfterVerifySavePermission(AccessToken::AccessTokenID tokenId) override; + sptr GetEnhanceRemoteObject() override; + + int Dump(int fd, const std::vector& args) override; + +private: + bool Initialize() const; + bool RegisterAppStateObserver(); + void UnregisterAppStateObserver(); + bool GetCallerInfo(SecCompCallerInfo& caller); + + ServiceRunningState state_; + sptr iAppMgr_; + sptr appStateObserver_; +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // SECURITY_COMPONENT_SERVICE_H diff --git a/services/security_component_service/sa/sa_main/sec_comp_stub.cpp b/services/security_component_service/sa/sa_main/sec_comp_stub.cpp new file mode 100644 index 0000000..1a66227 --- /dev/null +++ b/services/security_component_service/sa/sa_main/sec_comp_stub.cpp @@ -0,0 +1,244 @@ +/* + * 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 "sec_comp_stub.h" + +#include "ipc_skeleton.h" +#include "sec_comp_click_event_parcel.h" +#include "sec_comp_err.h" +#include "sec_comp_log.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +namespace { +static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompStub"}; +static constexpr int32_t ROOT_UID = 0; +static constexpr int32_t BASE_USER_RANGE = 200000; +} // namespace + +int32_t SecCompStub::OnRemoteRequest( + uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) +{ + std::u16string descripter = SecCompStub::GetDescriptor(); + std::u16string remoteDescripter = data.ReadInterfaceToken(); + if (descripter != remoteDescripter) { + SC_LOG_ERROR(LABEL, "Deal remote request fail, descriptor is not matched"); + return SC_SERVICE_ERROR_IPC_REQUEST_FAIL; + } + + auto itFunc = requestFuncMap_.find(code); + if (itFunc != requestFuncMap_.end()) { + auto requestFunc = itFunc->second; + if (requestFunc != nullptr) { + return (this->*requestFunc)(data, reply); + } + } + return IPCObjectStub::OnRemoteRequest(code, data, reply, option); +} + +int32_t SecCompStub::RegisterSecurityComponentInner(MessageParcel& data, MessageParcel& reply) +{ + uint32_t type; + if (!data.ReadUint32(type)) { + SC_LOG_ERROR(LABEL, "Read component type fail"); + return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; + } + + if (type <= UNKNOWN_SC_TYPE || type >= MAX_SC_TYPE) { + SC_LOG_ERROR(LABEL, "Security component type invalid"); + return SC_SERVICE_ERROR_VALUE_INVALID; + } + + std::string componentInfo; + if (!data.ReadString(componentInfo)) { + SC_LOG_ERROR(LABEL, "Read component info fail"); + return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; + } + + int32_t scId = INVALID_SC_ID; + int32_t res = this->RegisterSecurityComponent(static_cast(type), componentInfo, scId); + if (!reply.WriteInt32(res)) { + SC_LOG_ERROR(LABEL, "Register security component result fail"); + return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; + } + + if (!reply.WriteInt32(scId)) { + SC_LOG_ERROR(LABEL, "Register security component result fail"); + return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; + } + + return SC_OK; +} + +int32_t SecCompStub::UpdateSecurityComponentInner(MessageParcel& data, MessageParcel& reply) +{ + int32_t scId; + if (!data.ReadInt32(scId)) { + SC_LOG_ERROR(LABEL, "Read component id fail"); + return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; + } + + if (scId < 0) { + SC_LOG_ERROR(LABEL, "Security component id invalid"); + return SC_SERVICE_ERROR_VALUE_INVALID; + } + + std::string componentInfo; + if (!data.ReadString(componentInfo)) { + SC_LOG_ERROR(LABEL, "Read component info fail"); + return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; + } + + int32_t res = this->UpdateSecurityComponent(scId, componentInfo); + if (!reply.WriteInt32(res)) { + SC_LOG_ERROR(LABEL, "Update security component result fail"); + return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; + } + + return res; +} + +int32_t SecCompStub::UnregisterSecurityComponentInner(MessageParcel& data, MessageParcel& reply) +{ + int32_t scId; + if (!data.ReadInt32(scId)) { + SC_LOG_ERROR(LABEL, "Read component id fail"); + return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; + } + + if (scId < 0) { + SC_LOG_ERROR(LABEL, "Security component id invalid"); + return SC_SERVICE_ERROR_VALUE_INVALID; + } + + int32_t res = this->UnregisterSecurityComponent(scId); + if (!reply.WriteInt32(res)) { + SC_LOG_ERROR(LABEL, "Unregister security component result fail"); + return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; + } + return SC_OK; +} + +int32_t SecCompStub::ReportSecurityComponentClickEventInner(MessageParcel& data, MessageParcel& reply) +{ + int32_t scId; + if (!data.ReadInt32(scId)) { + SC_LOG_ERROR(LABEL, "Read component id fail"); + return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; + } + + if (scId < 0) { + SC_LOG_ERROR(LABEL, "Security component id invalid"); + return SC_SERVICE_ERROR_VALUE_INVALID; + } + + std::string componentInfo; + if (!data.ReadString(componentInfo)) { + SC_LOG_ERROR(LABEL, "Read component info fail"); + return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; + } + sptr touchInfoParcel = data.ReadParcelable(); + if (touchInfoParcel == nullptr) { + SC_LOG_ERROR(LABEL, "Read touchInfo info fail"); + return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; + } + + sptr callerToken = data.ReadRemoteObject(); + int32_t res = + this->ReportSecurityComponentClickEvent(scId, componentInfo, touchInfoParcel->touchInfoParams_, callerToken); + if (!reply.WriteInt32(res)) { + SC_LOG_ERROR(LABEL, "Register security component result fail"); + return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; + } + return SC_OK; +} + +int32_t SecCompStub::ReduceAfterVerifySavePermissionInner(MessageParcel& data, MessageParcel& reply) +{ + if (!IsMediaLibraryCalling()) { + SC_LOG_ERROR(LABEL, "Not medialibrary called"); + return SC_SERVICE_ERROR_CALLER_INVALID; + } + uint32_t tokenId; + if (!data.ReadUint32(tokenId)) { + SC_LOG_ERROR(LABEL, "Read component id fail"); + return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; + } + + if (tokenId == 0) { + SC_LOG_ERROR(LABEL, "AccessTokenId invalid"); + return SC_SERVICE_ERROR_VALUE_INVALID; + } + + bool res = this->ReduceAfterVerifySavePermission(tokenId); + if (!reply.WriteBool(res)) { + SC_LOG_ERROR(LABEL, "verify temp save permission result fail"); + return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; + } + return SC_OK; +} + +int32_t SecCompStub::GetEnhanceRemoteObjectInner(MessageParcel& data, MessageParcel& reply) +{ + auto res = this->GetEnhanceRemoteObject(); + if (!reply.WriteRemoteObject(res)) { + SC_LOG_ERROR(LABEL, "Register security component enhance remote object fail"); + return SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL; + } + return SC_OK; +} + +bool SecCompStub::IsMediaLibraryCalling() +{ + int32_t uid = IPCSkeleton::GetCallingUid(); + if (uid == ROOT_UID) { + return true; + } + int32_t userId = uid / BASE_USER_RANGE; + uint32_t tokenCaller = IPCSkeleton::GerCallingTokenID(); + if (mediaLibraryTokenId_ == 0) { + mediaLibraryTokenId_ = AccessToken::AccessTokenKit::GetHapTokenID( + userId, "com.ohos.medialibrary.medialibrarydata", 0) + } + return tokenCaller == mediaLibraryTokenId_; +} + +SecCompStub::SecCompStub() +{ + requestFuncMap_[static_cast(SecurityComponentServiceInterfaceCode::REGISTER_SECURITY_COMPONENT)] = + &SecCompStub::RegisterSecurityComponentInner; + requestFuncMap_[static_cast(SecurityComponentServiceInterfaceCode::UPDATE_SECURITY_COMPONENT)] = + &SecCompStub::UpdateSecurityComponentInner; + requestFuncMap_[static_cast(SecurityComponentServiceInterfaceCode::UNREGISTER_SECURITY_COMPONENT)] = + &SecCompStub::UnregisterSecurityComponentInner; + requestFuncMap_[static_cast( + SecurityComponentServiceInterfaceCode::REPORT_SECURITY_COMPONENT_CLICK_EVENT)] = + &SecCompStub::ReportSecurityComponentClickEventInner; + requestFuncMap_[static_cast(SecurityComponentServiceInterfaceCode::VERIFY_TEMP_SAVE_PERMISSION)] = + &SecCompStub::ReduceAfterVerifySavePermissionInner; + requestFuncMap_[static_cast( + SecurityComponentServiceInterfaceCode::GET_SECURITY_COMPONENT_ENHANCE_OBJECT)] = + &SecCompStub::GetEnhanceRemoteObjectInner; +} + +SecCompStub::~SecCompStub() +{ + SC_LOG_ERROR(LABEL, "~SecCompStub"); + requestFuncMap_.clear(); + SC_LOG_ERROR(LABEL, "~SecCompStub end"); +} +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS diff --git a/services/security_component_service/sa/sa_main/sec_comp_stub.h b/services/security_component_service/sa/sa_main/sec_comp_stub.h new file mode 100644 index 0000000..f0f2f2f --- /dev/null +++ b/services/security_component_service/sa/sa_main/sec_comp_stub.h @@ -0,0 +1,49 @@ +/* + * 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 SECURITY_COMPONENT_STUB_H +#define SECURITY_COMPONENT_STUB_H + +#include +#include "i_sec_comp_service.h" +#include "iremote_stub.h" +#include "nocopyable.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +class SecCompStub : public IRemoteStub { +public: + SecCompStub(); + virtual ~SecCompStub(); + + int OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) override; + +private: + int32_t RegisterSecurityComponentInner(MessageParcel& data, MessageParcel& reply); + int32_t UpdateSecurityComponentInner(MessageParcel& data, MessageParcel& reply); + int32_t UnregisterSecurityComponentInner(MessageParcel& data, MessageParcel& reply); + int32_t ReportSecurityComponentClickEventInner(MessageParcel& data, MessageParcel& reply); + int32_t ReduceAfterVerifySavePermissionInner(MessageParcel& data, MessageParcel& reply); + int32_t GetEnhanceRemoteObjectInner(MessageParcel& data, MessageParcel& reply); + bool IsMediaLibraryCalling(); + + using RequestFuncType = int32_t (SecCompStub::*)(MessageParcel& data, MessageParcel& reply); + std::map requestFuncMap_; + AccessToken::AccessTokenID mediaLibraryTokenId_ = 0;111 +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // SECURITY_COMPONENT_STUB_H diff --git a/services/security_component_service/sa/sa_main/sec_event_handler.cpp b/services/security_component_service/sa/sa_main/sec_event_handler.cpp new file mode 100644 index 0000000..32e3d8b --- /dev/null +++ b/services/security_component_service/sa/sa_main/sec_event_handler.cpp @@ -0,0 +1,40 @@ +/* + * 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 "sec_event_handler.h" + +#include "sec_comp_log.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +SecEventHandler::SecEventHandler( + const std::shared_ptr& runner) + : AppExecFwk::EventHandler(runner) {} + +SecEventHandler::~SecEventHandler() = default; + +bool SecEventHandler::ProxyPostTask( + const Callback &callback, const std::string &name, int64_t delayTime) +{ + return AppExecFwk::EventHandler::PostTask(callback, name, delayTime); +} + +void SecEventHandler::ProxyRemoveTask(const std::string &name) +{ + AppExecFwk::EventHandler::RemoveTask(name); +} +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS \ No newline at end of file diff --git a/services/security_component_service/sa/sa_main/sec_event_handler.h b/services/security_component_service/sa/sa_main/sec_event_handler.h new file mode 100644 index 0000000..86b0734 --- /dev/null +++ b/services/security_component_service/sa/sa_main/sec_event_handler.h @@ -0,0 +1,37 @@ +/* + * 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 SEC_EVENT_HANDLER_H +#define SEC_EVENT_HANDLER_H + +#include +#include "event_handler.h" +#include "event_runner.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +class SecEventHandler : public AppExecFwk::EventHandler { +public: + explicit SecEventHandler(const std::shared_ptr& runner); + ~SecEventHandler() override; + + bool ProxyPostTask(const Callback &callback, const std::string &name = std::string(), int64_t delayTime = 0); + + void ProxyRemoveTask(const std::string &name); +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // SEC_EVENT_HANDLER_H diff --git a/services/security_component_service/sa/sa_profile/3506.json b/services/security_component_service/sa/sa_profile/3506.json new file mode 100644 index 0000000..83650d4 --- /dev/null +++ b/services/security_component_service/sa/sa_profile/3506.json @@ -0,0 +1,12 @@ +{ + "process": "security_component_service", + "systemability": [ + { + "name": 3506, + "libpath": "libsecurity_component_service.z.so", + "run-on-create": false, + "distributed": false, + "dump_level": 1 + } + ] +} \ No newline at end of file diff --git a/services/security_component_service/sa/sa_profile/BUILD.gn b/services/security_component_service/sa/sa_profile/BUILD.gn new file mode 100644 index 0000000..dc0c6d9 --- /dev/null +++ b/services/security_component_service/sa/sa_profile/BUILD.gn @@ -0,0 +1,19 @@ +# 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("//build/ohos/sa_profile/sa_profile.gni") + +ohos_sa_profile("security_component_sa_profile_standard") { + sources = [ "3506.json" ] + part_name = "security_component" +} diff --git a/services/security_component_service/sa/security_component_service.cfg b/services/security_component_service/sa/security_component_service.cfg new file mode 100644 index 0000000..009ac03 --- /dev/null +++ b/services/security_component_service/sa/security_component_service.cfg @@ -0,0 +1,24 @@ +{ + "jobs" : [{ + "name" : "post-fs-data", + "cmds" : [ + "mkdir /data/service/el1/public/security_component_service 0750 security_component security_component" + ] + } + ], + "services" : [{ + "name" : "security_component_service", + "path" : ["/system/bin/sa_main", "/system/profile/security_component_service.json"], + "ondemand" : true, + "start-mode" : "condition", + "uid" : "security_component", + "gid" : ["security_component"], + "apl" : "system_basic", + "permission" : [ + "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", + "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS" + ], + "secon" : "u:r:security_component_service:s0" + } + ] +} diff --git a/services/security_component_service/sa/security_component_service.rc b/services/security_component_service/sa/security_component_service.rc new file mode 100644 index 0000000..68b6fbc --- /dev/null +++ b/services/security_component_service/sa/security_component_service.rc @@ -0,0 +1,19 @@ +# 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. + +service security_component_service /system/bin/sa_main /system/profile/security_component.json + class security_component_service + priority -20 + user security_component + group security_component + seclabel u:r:security_component_service:s0 diff --git a/services/security_component_service/sa/test/BUILD.gn b/services/security_component_service/sa/test/BUILD.gn new file mode 100644 index 0000000..84cd54b --- /dev/null +++ b/services/security_component_service/sa/test/BUILD.gn @@ -0,0 +1,147 @@ +# 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("//build/test.gni") + +sec_comp_root_dir = "../../../.." + +ohos_unittest("sec_comp_service_test") { + subsystem_name = "security" + part_name = "security_component" + module_out_path = part_name + "/" + part_name + + include_dirs = [ + "${sec_comp_root_dir}/frameworks/common/include", + "${sec_comp_root_dir}/frameworks/enhance_adapter/include", + "${sec_comp_root_dir}/frameworks/security_component/include", + "${sec_comp_root_dir}/interfaces/inner_api/security_component/include", + "${sec_comp_root_dir}/services/security_component_service/sa/sa_main", + "${sec_comp_root_dir}/services/security_component_service/sa/test/mock/include", + "//third_party/json/include", + ] + + sources = [ + "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/app_mgr_death_recipient.cpp", + "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/app_state_observer.cpp", + "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/delay_exit_task.cpp", + "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/first_use_dialog.cpp", + "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/sec_comp_entity.cpp", + "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/sec_comp_info_helper.cpp", + "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/sec_comp_manager.cpp", + "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/sec_comp_perm_manager.cpp", + "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/sec_comp_service.cpp", + "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/sec_comp_stub.cpp", + "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/sec_event_handler.cpp", + "${sec_comp_root_dir}/services/security_component_service/sa/test/mock/src/mock_app_mgr_proxy.cpp", + "${sec_comp_root_dir}/services/security_component_service/sa/test/mock/src/mock_iservice_registry.cpp", + "unittest/src/app_state_observer_test.cpp", + "unittest/src/sec_comp_entity_test.cpp", + "unittest/src/sec_comp_info_helper_test.cpp", + "unittest/src/sec_comp_manager_test.cpp", + "unittest/src/sec_comp_service_test.cpp", + "unittest/src/sec_comp_stub_test.cpp", + "unittest/src/service_test_common.cpp", + ] + + configs = [ "${sec_comp_root_dir}/config:coverage_flags" ] + cflags_cc = [ "-DHILOG_ENABLE" ] + + deps = [ + "${sec_comp_root_dir}/frameworks:libsecurity_component_enhance_adapter", + "${sec_comp_root_dir}/frameworks:libsecurity_component_framework", + "//third_party/googletest:gmock_main", + ] + + external_deps = [ + "ability_base:base", + "ability_base:want", + "ability_runtime:ability_manager", + "ability_runtime:runtime", + "access_token:libtoken_setproc", + "c_utils:utils", + "eventhandler:libeventhandler", + "graphic_2d:librender_service_client", + "hilog:libhilog", + "hisysevent:libhisysevent", + "hitrace:hitrace_meter", + "ipc:ipc_core", + "window_manager:libdm", + ] +} + +ohos_unittest("sec_comp_service_mock_test") { + subsystem_name = "security" + part_name = "security_component" + module_out_path = part_name + "/" + part_name + + include_dirs = [ + "${sec_comp_root_dir}/frameworks/common/include", + "${sec_comp_root_dir}/frameworks/security_component/include", + "${sec_comp_root_dir}/frameworks/enhance_adapter/include", + "${sec_comp_root_dir}/interfaces/inner_api/security_component/include", + "${sec_comp_root_dir}/services/security_component_service/sa/sa_main", + "${sec_comp_root_dir}/services/security_component_service/sa/test/mock/include", + "//third_party/json/include", + ] + + sources = [ + "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/app_mgr_death_recipient.cpp", + "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/app_state_observer.cpp", + "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/delay_exit_task.cpp", + "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/first_use_dialog.cpp", + "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/sec_comp_entity.cpp", + "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/sec_comp_info_helper.cpp", + "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/sec_comp_manager.cpp", + "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/sec_comp_perm_manager.cpp", + "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/sec_comp_service.cpp", + "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/sec_comp_stub.cpp", + "${sec_comp_root_dir}/services/security_component_service/sa/sa_main/sec_event_handler.cpp", + "${sec_comp_root_dir}/services/security_component_service/sa/test/mock/src/mock_app_mgr_proxy.cpp", + "${sec_comp_root_dir}/services/security_component_service/sa/test/mock/src/mock_iservice_registry.cpp", + "${sec_comp_root_dir}/services/security_component_service/sa/test/mock/src/sec_comp_enhance_adapter.cpp", + "unittest/src/sec_comp_service_mock_test.cpp", + "unittest/src/service_test_common.cpp", + ] + + configs = [ "${sec_comp_root_dir}/config:coverage_flags" ] + cflags_cc = [ "-DHILOG_ENABLE" ] + + deps = [ + "${sec_comp_root_dir}/frameworks:libsecurity_component_framework", + "//third_party/googletest:gmock_main", + ] + + external_deps = [ + "ability_base:base", + "ability_base:want", + "ability_runtime:ability_manager", + "ability_runtime:runtime", + "access_token:libtoken_setproc", + "c_utils:utils", + "eventhandler:libeventhandler", + "graphic_2d:librender_service_client", + "hilog:libhilog", + "hisysevent:libhisysevent", + "hitrace:hitrace_meter", + "ipc:ipc_core", + "window_manager:libdm", + ] +} + +group("unittest") { + testonly = true + deps = [ + ":sec_comp_service_mock_test", + ":sec_comp_service_test", + ] +} diff --git a/services/security_component_service/sa/test/mock/include/access_token.h b/services/security_component_service/sa/test/mock/include/access_token.h new file mode 100644 index 0000000..654bb5b --- /dev/null +++ b/services/security_component_service/sa/test/mock/include/access_token.h @@ -0,0 +1,57 @@ +/* + * 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 SECURITY_COMPONENT_MOCK_ACCESS_TOKEN_DEF_H +#define SECURITY_COMPONENT_MOCK_ACCESS_TOKEN_DEF_H + +namespace OHOS { +namespace Security { +namespace AccessToken { +typedef unsigned int AccessTokenID; +static const AccessTokenID INVALID_TOKENID = 0; + +enum AccessTokenKitRet { + RET_FAILED = -1, + RET_SUCCESS = 0, +}; + +typedef enum TypeATokenTypeEnum { + TOKEN_INVALID = -1, + TOKEN_HAP = 0, + TOKEN_NATIVE, + TOKEN_SHELL, + TOKEN_TYPE_BUTT, +} ATokenTypeEnum; + +typedef enum TypePermissionFlag { + PERMISSION_DEFAULT_FLAG = 0, + PERMISSION_USER_SET = 1 << 0, + PERMISSION_USER_FIXED = 1 << 1, + PERMISSION_SYSTEM_FIXED = 1 << 2, + PERMISSION_GRANTED_BY_POLICY = 1 << 3, + PERMISSION_COMPONENT_SET = 1 << 4, + PERMISSION_POLICY_FIXED = 1 << 5, +} PermissionFlag; + +typedef struct { + unsigned int tokenUniqueID : 20; + unsigned int res : 6; + unsigned int dlpFlag : 1; + unsigned int type : 2; + unsigned int version : 3; +} AccessTokenIDInner; +} // namespace AccessToken +} // namespace Security +} // namespace OHOS +#endif // SECURITY_COMPONENT_MOCK_ACCESS_TOKEN_DEF_H diff --git a/services/security_component_service/sa/test/mock/include/accesstoken_kit.h b/services/security_component_service/sa/test/mock/include/accesstoken_kit.h new file mode 100644 index 0000000..0a746c2 --- /dev/null +++ b/services/security_component_service/sa/test/mock/include/accesstoken_kit.h @@ -0,0 +1,58 @@ +/* + * 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 SECURITY_COMPONENT_INTERFACES_INNER_KITS_ACCESSTOKEN_KIT_H +#define SECURITY_COMPONENT_INTERFACES_INNER_KITS_ACCESSTOKEN_KIT_H + +#include +#include "access_token.h" + +namespace OHOS { +namespace Security { +namespace AccessToken { +struct HapTokenInfo { +}; + +class AccessTokenKit { +public: + static int RevokePermission(AccessTokenID tokenID, const std::string& permissionName, int flag) + { + return 0; + }; + + static int GrantPermission(AccessTokenID tokenID, const std::string& permissionName, int flag) + { + return 0; + }; + + static int GetHapTokenInfo(AccessTokenID tokenID, HapTokenInfo& hapTokenInfoRes) + { + return 0; + }; + + static AccessTokenID GetHapTokenID(int32_t userID, const std::string& bundleName, int32_t instIndex) + { + return 0; + }; + + static ATokenTypeEnum GetTokenTypeFlag(AccessTokenID tokenID) + { + AccessTokenIDInner *idInner = reinterpret_cast(&tokenID); + return static_cast(idInner->type); + }; +}; +} // namespace SECURITY_COMPONENT_INTERFACES_INNER_KITS_ACCESSTOKEN_KIT_H +} // namespace Security +} // namespace OHOS +#endif diff --git a/services/security_component_service/sa/test/mock/include/app_mgr_interface.h b/services/security_component_service/sa/test/mock/include/app_mgr_interface.h new file mode 100644 index 0000000..b0a36ec --- /dev/null +++ b/services/security_component_service/sa/test/mock/include/app_mgr_interface.h @@ -0,0 +1,38 @@ +/* + * 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 SECURITY_COMPONENT_MOCK_ABILITY_RUNTIME_APP_MGR_INTERFACE_H +#define SECURITY_COMPONENT_MOCK_ABILITY_RUNTIME_APP_MGR_INTERFACE_H + +#include "iremote_broker.h" +#include "iremote_object.h" +#include "application_state_observer_stub.h" + +namespace OHOS { +namespace AppExecFwk { + +class IAppMgr : public IRemoteBroker { +public: + DECLARE_INTERFACE_DESCRIPTOR(u"ohos.appexecfwk.mock.AppMgr"); + + virtual int32_t RegisterApplicationStateObserver(const sptr &observer, + const std::vector &bundleNameList = {}) = 0; + + virtual int32_t UnregisterApplicationStateObserver(const sptr &observer) = 0; + + virtual int32_t GetForegroundApplications(std::vector &list) = 0; +}; +} // namespace AppExecFwk +} // namespace OHOS +#endif // SECURITY_COMPONENT_MOCK_ABILITY_RUNTIME_APP_MGR_INTERFACE_H diff --git a/services/security_component_service/sa/test/mock/include/application_state_observer_stub.h b/services/security_component_service/sa/test/mock/include/application_state_observer_stub.h new file mode 100644 index 0000000..9271160 --- /dev/null +++ b/services/security_component_service/sa/test/mock/include/application_state_observer_stub.h @@ -0,0 +1,73 @@ +/* + * 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 SECURITY_COMPONENT_MOCK_ABILITY_RUNTIME_APPLICATION_STATE_OBSERVER_STUB_H +#define SECURITY_COMPONENT_MOCK_ABILITY_RUNTIME_APPLICATION_STATE_OBSERVER_STUB_H + +#include +#include + +#include "iremote_stub.h" +#include "nocopyable.h" +#include "string_ex.h" + +namespace OHOS { +namespace AppExecFwk { +enum class AppProcessState { + APP_STATE_BEGIN = 0, + APP_STATE_CREATE = APP_STATE_BEGIN, + APP_STATE_READY, + APP_STATE_FOREGROUND, + APP_STATE_FOCUS, + APP_STATE_BACKGROUND, + APP_STATE_TERMINATED, + APP_STATE_END, +}; + +struct ProcessData { + std::string bundleName; + int32_t pid = 0; + int32_t uid = 0; + AppProcessState state; + bool isContinuousTask = false; + bool isKeepAlive = false; + bool isFocused = false; + int32_t requestProcCode = 0; +}; + +struct AppStateData { + std::string bundleName; + int32_t pid = -1; + int32_t uid = 0; + int32_t state = 0; + int32_t accessTokenId = 0; + bool isFocused = false; +}; + +class IApplicationStateObserver : public IRemoteBroker { +public: + DECLARE_INTERFACE_DESCRIPTOR(u"ohos.appexecfwk.IApplicationStateObserver"); + virtual void OnProcessStateChanged(const ProcessData &processData) {} + virtual void OnProcessDied(const ProcessData &processData) = 0; +}; + +class ApplicationStateObserverStub : public IRemoteStub { +public: + ApplicationStateObserverStub() = default; + virtual ~ApplicationStateObserverStub() = default; + DISALLOW_COPY_AND_MOVE(ApplicationStateObserverStub); +}; +} // namespace AppExecFwk +} // namespace OHOS +#endif // SECURITY_COMPONENT_MOCK_ABILITY_RUNTIME_APPLICATION_STATE_OBSERVER_STUB_H diff --git a/services/security_component_service/sa/test/mock/include/if_system_ability_manager.h b/services/security_component_service/sa/test/mock/include/if_system_ability_manager.h new file mode 100644 index 0000000..eee66c0 --- /dev/null +++ b/services/security_component_service/sa/test/mock/include/if_system_ability_manager.h @@ -0,0 +1,51 @@ +/* +* 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 SEC_COMP_MOCK_SYSTEM_ABILITY_IF_MANAGER_CLINET_INCLUDE_H +#define SEC_COMP_MOCK_SYSTEM_ABILITY_IF_MANAGER_CLINET_INCLUDE_H +#include "iremote_broker.h" +#include "iremote_object.h" +#include "iremote_proxy.h" +#include "mock_app_mgr_proxy.h" + +namespace OHOS { +class MockIRemoteObject : public virtual RefBase { +public: + bool AddDeathRecipient(const sptr& recipient) + { + (void)recipient; + return addResult; + } + bool addResult = true; +}; + +template inline sptr iface_cast(const sptr &object) +{ + if (object == nullptr) { + return nullptr; + } + const std::u16string descriptor = INTERFACE::GetDescriptor(); + if (descriptor == u"ohos.appexecfwk.mock.AppMgr") { + return static_cast(MockAppMgrProxy::g_MockAppMgrProxy); + } + return nullptr; +} + +class ISystemAbilityManager : public IRemoteBroker { +public: + virtual sptr GetSystemAbility(int32_t systemAbilityId) = 0; + virtual int32_t UnloadSystemAbility(int32_t systemAbilityId) = 0; +}; +} // namespace OHOS +#endif // SEC_COMP_MOCK_SYSTEM_ABILITY_IF_MANAGER_CLINET_INCLUDE_H diff --git a/services/security_component_service/sa/test/mock/include/ipc_mock_skeleton.h b/services/security_component_service/sa/test/mock/include/ipc_mock_skeleton.h new file mode 100644 index 0000000..f1ca97c --- /dev/null +++ b/services/security_component_service/sa/test/mock/include/ipc_mock_skeleton.h @@ -0,0 +1,38 @@ +/* +* 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 SEC_COMP_MOCK_IPC_SKELETON_INCLUDE_H +#define SEC_COMP_MOCK_IPC_SKELETON_INCLUDE_H +#include + +namespace OHOS { +class IPCSkeleton { +public: + IPCSkeleton() = default; + ~IPCSkeleton() = default; + static uint32_t GetCallingTokenID() + { + return tokenID; + }; + + static pid_t GetCallingPid() + { + return pid; + }; + + static uint32_t tokenID; + static pid_t pid; +}; +} // namespace OHOS +#endif // SEC_COMP_MOCK_IPC_SKELETON_INCLUDE_H diff --git a/services/security_component_service/sa/test/mock/include/iservice_registry.h b/services/security_component_service/sa/test/mock/include/iservice_registry.h new file mode 100644 index 0000000..8a4aa3d --- /dev/null +++ b/services/security_component_service/sa/test/mock/include/iservice_registry.h @@ -0,0 +1,33 @@ +/* +* 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 SEC_COMP_MOCK_SYSTEM_ABILITY_MANAGER_CLINET_INCLUDE_H +#define SEC_COMP_MOCK_SYSTEM_ABILITY_MANAGER_CLINET_INCLUDE_H +#include +#include "if_system_ability_manager.h" + +namespace OHOS { +class SystemAbilityManagerClient { +public: + static SystemAbilityManagerClient& GetInstance(); + SystemAbilityManagerClient() = default; + ~SystemAbilityManagerClient() = default; + + static SystemAbilityManagerClient* clientInstance; + static SystemAbilityManagerClient defaultInstance; + static std::mutex instanceMtx; + MOCK_METHOD0(GetSystemAbilityManager, sptr()); +}; +} // namespace OHOS +#endif // SEC_COMP_MOCK_SYSTEM_ABILITY_MANAGER_CLINET_INCLUDE_H \ No newline at end of file diff --git a/services/security_component_service/sa/test/mock/include/mock_app_mgr_proxy.h b/services/security_component_service/sa/test/mock/include/mock_app_mgr_proxy.h new file mode 100644 index 0000000..eab8644 --- /dev/null +++ b/services/security_component_service/sa/test/mock/include/mock_app_mgr_proxy.h @@ -0,0 +1,37 @@ +/* + * 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 SECURITY_COMPONET_MOCK_APP_MGR_PROXY_H +#define SECURITY_COMPONET_MOCK_APP_MGR_PROXY_H +#include +#include +#include "app_mgr_interface.h" +#include "iremote_proxy.h" + +namespace OHOS { +class MockAppMgrProxy : public IRemoteProxy { +public: + explicit MockAppMgrProxy(const sptr& impl) + : IRemoteProxy(impl) {} + ~MockAppMgrProxy() = default; + + static MockAppMgrProxy* g_MockAppMgrProxy; + + MOCK_METHOD2(RegisterApplicationStateObserver, + int32_t(const sptr&, const std::vector&)); + MOCK_METHOD1(UnregisterApplicationStateObserver, int32_t(const sptr &)); + MOCK_METHOD1(GetForegroundApplications, int32_t(std::vector&)); +}; +} // namespace OHOS +#endif diff --git a/services/security_component_service/sa/test/mock/include/mock_system_ability_proxy.h b/services/security_component_service/sa/test/mock/include/mock_system_ability_proxy.h new file mode 100644 index 0000000..ee833e6 --- /dev/null +++ b/services/security_component_service/sa/test/mock/include/mock_system_ability_proxy.h @@ -0,0 +1,32 @@ +/* + * 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 SECURITY_COMPONENT_MOCK_SYSTEM_ABILITY_MANAGER_PROXY +#define SECURITY_COMPONENT_MOCK_SYSTEM_ABILITY_MANAGER_PROXY +#include +#include +#include "if_system_ability_manager.h" + +namespace OHOS { +class SystemAbilityManagerProxy : public IRemoteProxy { +public: + explicit SystemAbilityManagerProxy(const sptr& impl) + : IRemoteProxy(impl) {} + ~SystemAbilityManagerProxy() = default; + + MOCK_METHOD1(GetSystemAbility, sptr(int32_t)); + MOCK_METHOD1(UnloadSystemAbility, int32_t(int32_t)); +}; +} // namespace OHOS +#endif diff --git a/services/security_component_service/sa/test/mock/include/system_ability.h b/services/security_component_service/sa/test/mock/include/system_ability.h new file mode 100644 index 0000000..9127f3a --- /dev/null +++ b/services/security_component_service/sa/test/mock/include/system_ability.h @@ -0,0 +1,47 @@ +/* + * 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 MOCK_SECURITY_COMPONENT_SYSTEM_ABILITY_H +#define MOCK_SECURITY_COMPONENT_SYSTEM_ABILITY_H + +#include +#include "if_system_ability_manager.h" +#include "iremote_object.h" + +namespace OHOS { +#define DECLEAR_SYSTEM_ABILITY(className) +#define SA_ID_SECURITY_COMPONENT_SERVICE 1000 +#define REGISTER_SYSTEM_ABILITY_BY_ID(a, b, c) + +class SystemAbility { +public: + static bool MakeAndRegisterAbility(SystemAbility*) + { + return true; + } + + virtual void OnStart() {}; + + virtual void OnStop() {}; + + MOCK_METHOD1(Publish, bool(sptr)); + + SystemAbility(bool runOnCreate = false) {}; + + SystemAbility(const int32_t serviceId, bool runOnCreate = false) {}; + + virtual ~SystemAbility() = default; +}; +} // namespace OHOS +#endif // MOCK_SECURITY_COMPONENT_SYSTEM_ABILITY_H diff --git a/services/security_component_service/sa/test/mock/src/mock_app_mgr_proxy.cpp b/services/security_component_service/sa/test/mock/src/mock_app_mgr_proxy.cpp new file mode 100644 index 0000000..d83e9f0 --- /dev/null +++ b/services/security_component_service/sa/test/mock/src/mock_app_mgr_proxy.cpp @@ -0,0 +1,20 @@ +/* +* 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 "mock_app_mgr_proxy.h" + +namespace OHOS { +MockAppMgrProxy* MockAppMgrProxy::g_MockAppMgrProxy = nullptr; +} diff --git a/services/security_component_service/sa/test/mock/src/mock_ipc_skeleton.cpp b/services/security_component_service/sa/test/mock/src/mock_ipc_skeleton.cpp new file mode 100644 index 0000000..62174e8 --- /dev/null +++ b/services/security_component_service/sa/test/mock/src/mock_ipc_skeleton.cpp @@ -0,0 +1,20 @@ +/* +* 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 "ipc_skeleton.h" + +namespace OHOS { +uint32_t IPCSkeleton::tokenID = 0; +pid_t IPCSkeleton::pid = -1; +} // namespace OHOS diff --git a/services/security_component_service/sa/test/mock/src/mock_iservice_registry.cpp b/services/security_component_service/sa/test/mock/src/mock_iservice_registry.cpp new file mode 100644 index 0000000..7abc1fa --- /dev/null +++ b/services/security_component_service/sa/test/mock/src/mock_iservice_registry.cpp @@ -0,0 +1,34 @@ + /* + * 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 "iservice_registry.h" + +namespace OHOS { +SystemAbilityManagerClient* SystemAbilityManagerClient::clientInstance = nullptr; +SystemAbilityManagerClient SystemAbilityManagerClient::defaultInstance; +std::mutex SystemAbilityManagerClient::instanceMtx; + +SystemAbilityManagerClient& SystemAbilityManagerClient::GetInstance() +{ + std::lock_guard lock(instanceMtx); + if (clientInstance == nullptr) { + clientInstance = new (std::nothrow)SystemAbilityManagerClient(); + if (clientInstance == nullptr) { + return defaultInstance; + } + } + return *clientInstance; +} +} // namespace OHOS diff --git a/services/security_component_service/sa/test/mock/src/sec_comp_enhance_adapter.cpp b/services/security_component_service/sa/test/mock/src/sec_comp_enhance_adapter.cpp new file mode 100644 index 0000000..812f046 --- /dev/null +++ b/services/security_component_service/sa/test/mock/src/sec_comp_enhance_adapter.cpp @@ -0,0 +1,110 @@ +/* + * 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 "sec_comp_enhance_adapter.h" + +#include "sec_comp_err.h" +#include "sec_comp_log.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +namespace { +static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { + LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "MockSecCompEnhanceAdapter"}; +} + +int32_t SecCompEnhanceAdapter::SetEnhanceCfg(uint8_t* cfg, uint32_t cfgLen) +{ + SC_LOG_DEBUG(LABEL, "SetEnhanceCfg success"); + return SC_OK; +} + +int32_t SecCompEnhanceAdapter::GetPointerEventEnhanceData(void* data, uint32_t dataLen, + uint8_t* enhanceData, uint32_t& enHancedataLen) +{ + SC_LOG_DEBUG(LABEL, "GetPointerEventEnhanceData success"); + return SC_OK; +} + +int32_t SecCompEnhanceAdapter::CheckExtraInfo(const SecCompClickEvent& touchInfo) +{ + SC_LOG_DEBUG(LABEL, "CheckExtraInfo success"); + return SC_OK; +} + +int32_t SecCompEnhanceAdapter::EnableInputEnhance() +{ + SC_LOG_DEBUG(LABEL, "EnableInputEnhance success"); + return SC_OK; +} + +int32_t SecCompEnhanceAdapter::DisableInputEnhance() +{ + SC_LOG_DEBUG(LABEL, "DisableInputEnhance success"); + return SC_OK; +} + +bool SecCompEnhanceAdapter::EnhanceDataPreprocess(std::string& componentInfo) +{ + SC_LOG_DEBUG(LABEL, "EnhanceDataPreprocess success"); + return true; +} + +bool SecCompEnhanceAdapter::EnhanceDataPreprocess(int32_t scId, std::string& componentInfo) +{ + SC_LOG_DEBUG(LABEL, "EnhanceDataPreprocess success"); + return true; +} + +void SecCompEnhanceAdapter::RegisterScIdEnhance(int32_t scId) +{ + SC_LOG_DEBUG(LABEL, "RegisterScIdEnhance success"); +} + +void SecCompEnhanceAdapter::UnregisterScIdEnhance(int32_t scId) +{ + SC_LOG_DEBUG(LABEL, "UnregisterScIdEnhance success"); +} + +void SecCompEnhanceAdapter::StartEnhanceService() +{ + SC_LOG_DEBUG(LABEL, "StartEnhanceService success"); +} + +void SecCompEnhanceAdapter::ExistEnhanceService() +{ + SC_LOG_DEBUG(LABEL, "ExistEnhanceService success"); +} + +void SecCompEnhanceAdapter::NotifyProcessDied(int32_t pid) +{ + SC_LOG_DEBUG(LABEL, "NotifyProcessDied success"); +} + +int32_t SecCompEnhanceAdapter::CheckComponentInfoEnhnace(int32_t pid, + std::shared_ptr& compInfo, const nlohmann::json& jsonComponent) +{ + SC_LOG_DEBUG(LABEL, "CheckComponentInfoEnhnace success"); + return SC_OK; +} + +sptr SecCompEnhanceAdapter::GetEnhanceRemoteObject() +{ + SC_LOG_DEBUG(LABEL, "GetEnhanceRemoteObject success"); + return nullptr; +} +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS diff --git a/services/security_component_service/sa/test/unittest/src/app_state_observer_test.cpp b/services/security_component_service/sa/test/unittest/src/app_state_observer_test.cpp new file mode 100644 index 0000000..946262a --- /dev/null +++ b/services/security_component_service/sa/test/unittest/src/app_state_observer_test.cpp @@ -0,0 +1,179 @@ +/* + * 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 "app_state_observer_test.h" + +#include "sec_comp_log.h" +#include "sec_comp_err.h" +#include "service_test_common.h" + +using namespace testing::ext; +using namespace OHOS; +using namespace OHOS::Security::SecurityComponent; + +namespace { +static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { + LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "AppStateObserverTest"}; +} + +void AppStateObserverTest::SetUpTestCase() +{} + +void AppStateObserverTest::TearDownTestCase() +{} + +void AppStateObserverTest::SetUp() +{ + SC_LOG_INFO(LABEL, "setup"); + if (observer_ != nullptr) { + return; + } + + observer_ = std::make_shared(); + ASSERT_NE(nullptr, observer_); +} + +void AppStateObserverTest::TearDown() +{ + observer_ = nullptr; +} + +/** + * @tc.name: IsProcessForeground001 + * @tc.desc: Test is process foreground + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(AppStateObserverTest, IsProcessForeground001, TestSize.Level1) +{ + ASSERT_FALSE(observer_->IsProcessForeground(TEST_PID_1, TEST_UID_1)); + AppExecFwk::AppStateData stateData = { + .pid = TEST_PID_1, + .uid = TEST_UID_1, + }; + observer_->AddProcessToForegroundSet(stateData); + ASSERT_TRUE(observer_->IsProcessForeground(TEST_PID_1, TEST_UID_1)); +} + +/** + * @tc.name: AddProcessToForegroundSet001 + * @tc.desc: Test add process to foreground + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(AppStateObserverTest, AddProcessToForegroundSet001, TestSize.Level1) +{ + AppExecFwk::AppStateData stateData = { + .pid = TEST_PID_1, + .uid = TEST_UID_1, + }; + observer_->AddProcessToForegroundSet(stateData); + observer_->AddProcessToForegroundSet(stateData); + ASSERT_TRUE(observer_->IsProcessForeground(TEST_PID_1, TEST_UID_1)); + + AppExecFwk::ProcessData procData = { + .pid = TEST_PID_2, + .uid = TEST_UID_2, + }; + observer_->AddProcessToForegroundSet(procData); + observer_->AddProcessToForegroundSet(procData); + ASSERT_TRUE(observer_->IsProcessForeground(TEST_PID_2, TEST_UID_2)); +} + +/** + * @tc.name: RemoveProcessFromForegroundSet001 + * @tc.desc: Test remove process from foreground + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(AppStateObserverTest, RemoveProcessFromForegroundSet001, TestSize.Level1) +{ + AppExecFwk::ProcessData procData = { + .pid = TEST_PID_1, + .uid = TEST_UID_1, + }; + observer_->AddProcessToForegroundSet(procData); + ASSERT_TRUE(observer_->IsProcessForeground(TEST_PID_1, TEST_UID_1)); + observer_->RemoveProcessFromForegroundSet(procData); + observer_->RemoveProcessFromForegroundSet(procData); + ASSERT_FALSE(observer_->IsProcessForeground(TEST_PID_1, TEST_UID_1)); +} + +/** + * @tc.name: RemoveProcessFromForegroundSet002 + * @tc.desc: Test remove process with different uid + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(AppStateObserverTest, RemoveProcessFromForegroundSet002, TestSize.Level1) +{ + AppExecFwk::ProcessData procData = { + .pid = TEST_PID_1, + .uid = TEST_UID_1, + }; + observer_->AddProcessToForegroundSet(procData); + ASSERT_TRUE(observer_->IsProcessForeground(TEST_PID_1, TEST_UID_1)); + procData.pid = TEST_PID_2; + observer_->RemoveProcessFromForegroundSet(procData); + ASSERT_TRUE(observer_->IsProcessForeground(TEST_PID_1, TEST_UID_1)); +} + +/** + * @tc.name: OnProcessStateChanged001 + * @tc.desc: Test recieve process state changed + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(AppStateObserverTest, OnProcessStateChanged001, TestSize.Level1) +{ + AppExecFwk::ProcessData processData; + processData.state = AppExecFwk::AppProcessState::APP_STATE_CREATE; + observer_->OnProcessStateChanged(processData); + ASSERT_EQ(observer_->foregrandProcList_.size(), static_cast(0)); + + processData.state = AppExecFwk::AppProcessState::APP_STATE_FOREGROUND; + processData.pid = TEST_PID_1; + observer_->OnProcessStateChanged(processData); + ASSERT_TRUE(observer_->IsProcessForeground(TEST_PID_1, TEST_UID_1)); + + processData.state = AppExecFwk::AppProcessState::APP_STATE_BACKGROUND; + processData.pid = TEST_PID_1; + observer_->OnProcessStateChanged(processData); + ASSERT_FALSE(observer_->IsProcessForeground(TEST_PID_1, TEST_UID_1)); +} + +/** + * @tc.name: OnProcessDied001 + * @tc.desc: Test recieve process state died + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(AppStateObserverTest, OnProcessDied001, TestSize.Level1) +{ + AppExecFwk::ProcessData processData; + processData.state = AppExecFwk::AppProcessState::APP_STATE_FOREGROUND; + processData.pid = TEST_PID_1; + observer_->OnProcessStateChanged(processData); + ASSERT_TRUE(observer_->IsProcessForeground(TEST_PID_1, TEST_UID_1)); + + // if last process died, the sec_comp service will exit. + processData.pid = TEST_PID_2; + observer_->OnProcessStateChanged(processData); + ASSERT_TRUE(observer_->IsProcessForeground(TEST_PID_2, TEST_UID_2)); + + // notify process 1 died + processData.pid = TEST_PID_1; + observer_->OnProcessDied(processData); + ASSERT_FALSE(observer_->IsProcessForeground(TEST_PID_1, TEST_UID_1)); +} diff --git a/services/security_component_service/sa/test/unittest/src/app_state_observer_test.h b/services/security_component_service/sa/test/unittest/src/app_state_observer_test.h new file mode 100644 index 0000000..7195cf2 --- /dev/null +++ b/services/security_component_service/sa/test/unittest/src/app_state_observer_test.h @@ -0,0 +1,41 @@ +/* + * 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 APP_STATE_OBSERVER_TEST_H +#define APP_STATE_OBSERVER_TEST_H + +#include +#define private public +#include "app_state_observer.h" +#undef private + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +class AppStateObserverTest : public testing::Test { +public: + static void SetUpTestCase(); + + static void TearDownTestCase(); + + void SetUp(); + + void TearDown(); + + std::shared_ptr observer_ = nullptr; +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // APP_STATE_OBSERVER_TEST_H diff --git a/services/security_component_service/sa/test/unittest/src/sec_comp_entity_test.cpp b/services/security_component_service/sa/test/unittest/src/sec_comp_entity_test.cpp new file mode 100644 index 0000000..2304db6 --- /dev/null +++ b/services/security_component_service/sa/test/unittest/src/sec_comp_entity_test.cpp @@ -0,0 +1,156 @@ +/* + * 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 "sec_comp_entity_test.h" + +#include "sec_comp_log.h" +#include "location_button.h" +#include "paste_button.h" +#include "save_button.h" +#include "sec_comp_err.h" +#include "sec_comp_tool.h" +#include "service_test_common.h" + +using namespace testing::ext; +using namespace OHOS; +using namespace OHOS::Security::SecurityComponent; +using namespace OHOS::Security::AccessToken; + +namespace { +static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { + LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompEntityTest"}; +} + +void SecCompEntityTest::SetUpTestCase() +{} + +void SecCompEntityTest::TearDownTestCase() +{} + +void SecCompEntityTest::SetUp() +{ + SC_LOG_INFO(LABEL, "setup"); + if (entity_ != nullptr) { + return; + } + + std::shared_ptr component = std::make_shared(); + ASSERT_NE(nullptr, component); + + entity_ = std::make_shared(component, 1, 1); + ASSERT_NE(nullptr, entity_); +} + +void SecCompEntityTest::TearDown() +{ + entity_ = nullptr; +} + +/** + * @tc.name: RevokeTempPermission001 + * @tc.desc: Test revoke temp permission + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompEntityTest, RevokeTempPermission001, TestSize.Level1) +{ + entity_->isGrant_ = false; + ASSERT_EQ(SC_OK, entity_->RevokeTempPermission()); + + entity_->isGrant_ = true; + entity_->componentInfo_->type_ = UNKNOWN_SC_TYPE; + ASSERT_EQ(SC_SERVICE_ERROR_PERMISSION_OPER_FAIL, entity_->RevokeTempPermission()); + ASSERT_FALSE(entity_->isGrant_); + + entity_->isGrant_ = true; + entity_->componentInfo_->type_ = LOCATION_COMPONENT; + ASSERT_EQ(SC_OK, entity_->RevokeTempPermission()); + ASSERT_FALSE(entity_->isGrant_); +} + +/** + * @tc.name: GrantTempPermission001 + * @tc.desc: Test grant location permission + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompEntityTest, GrantTempPermission001, TestSize.Level1) +{ + entity_->isGrant_ = false; + entity_->componentInfo_->type_ = UNKNOWN_SC_TYPE; + ASSERT_EQ(SC_SERVICE_ERROR_PERMISSION_OPER_FAIL, entity_->GrantTempPermission()); + ASSERT_TRUE(entity_->isGrant_); + + entity_->isGrant_ = false; + entity_->componentInfo_->type_ = LOCATION_COMPONENT; + ASSERT_EQ(SC_OK, entity_->GrantTempPermission()); + ASSERT_TRUE(entity_->isGrant_); + + entity_->isGrant_ = false; + entity_->componentInfo_->type_ = PASTE_COMPONENT; + ASSERT_EQ(SC_OK, entity_->GrantTempPermission()); + ASSERT_TRUE(entity_->isGrant_); +} + +/** + * @tc.name: GrantTempPermission002 + * @tc.desc: Test grant paste permission with invalid tokenId. + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompEntityTest, GrantTempPermission002, TestSize.Level1) +{ + std::shared_ptr pasteComponent = std::make_shared(); + ASSERT_NE(nullptr, pasteComponent); + + entity_ = std::make_shared(pasteComponent, 0, 1); + ASSERT_NE(nullptr, entity_); + + ASSERT_EQ(SC_SERVICE_ERROR_PERMISSION_OPER_FAIL, entity_->GrantTempPermission()); + ASSERT_EQ(SC_SERVICE_ERROR_PERMISSION_OPER_FAIL, entity_->RevokeTempPermission()); +} + +/** + * @tc.name: CheckTouchInfo001 + * @tc.desc: Test touch info + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompEntityTest, CheckTouchInfo001, TestSize.Level1) +{ + SecCompClickEvent touch = { + .touchX = TEST_COORDINATE, + .touchY = TEST_COORDINATE, + .timestamp = 0, + }; + ASSERT_FALSE(entity_->CheckTouchInfo(touch)); + + uint64_t current = static_cast(std::chrono::high_resolution_clock::now().time_since_epoch().count()); + touch.timestamp = current + 10000L; // 10s + ASSERT_FALSE(entity_->CheckTouchInfo(touch)); + + entity_->componentInfo_->rect_.x_ = TEST_DIFF_COORDINATE; // click event will not hit this rect + entity_->componentInfo_->rect_.y_ = TEST_DIFF_COORDINATE; + entity_->componentInfo_->rect_.width_ = TEST_DIFF_COORDINATE; + entity_->componentInfo_->rect_.height_ = TEST_DIFF_COORDINATE; + touch.timestamp = static_cast( + std::chrono::high_resolution_clock::now().time_since_epoch().count()) / TIME_CONVERSION_UNIT; + ASSERT_FALSE(entity_->CheckTouchInfo(touch)); + + entity_->componentInfo_->rect_.x_ = TEST_COORDINATE; + entity_->componentInfo_->rect_.y_ = TEST_COORDINATE; + touch.timestamp = static_cast( + std::chrono::high_resolution_clock::now().time_since_epoch().count()) / TIME_CONVERSION_UNIT; + ASSERT_FALSE(entity_->CheckTouchInfo(touch)); +} diff --git a/services/security_component_service/sa/test/unittest/src/sec_comp_entity_test.h b/services/security_component_service/sa/test/unittest/src/sec_comp_entity_test.h new file mode 100644 index 0000000..c65cf37 --- /dev/null +++ b/services/security_component_service/sa/test/unittest/src/sec_comp_entity_test.h @@ -0,0 +1,42 @@ +/* + * 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 SEC_COMP_ENTITY_TEST_H +#define SEC_COMP_ENTITY_TEST_H + +#include +#define private public +#include "sec_comp_entity.h" +#undef private + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +class SecCompEntityTest : public testing::Test { +public: + static void SetUpTestCase(); + + static void TearDownTestCase(); + + void SetUp(); + + void TearDown(); + + std::shared_ptr entity_ = nullptr; +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // SEC_COMP_ENTITY_TEST_H diff --git a/services/security_component_service/sa/test/unittest/src/sec_comp_info_helper_test.cpp b/services/security_component_service/sa/test/unittest/src/sec_comp_info_helper_test.cpp new file mode 100644 index 0000000..8c6c251 --- /dev/null +++ b/services/security_component_service/sa/test/unittest/src/sec_comp_info_helper_test.cpp @@ -0,0 +1,654 @@ +/* + * 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 "sec_comp_info_helper_test.h" + +#include "display.h" +#include "display_info.h" +#include "display_manager.h" +#include "location_button.h" +#include "paste_button.h" +#include "save_button.h" +#include "sec_comp_log.h" +#include "sec_comp_err.h" +#include "service_test_common.h" + +using namespace testing::ext; +using namespace OHOS; +using namespace OHOS::Security::SecurityComponent; + +namespace { +static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { + LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompInfoHelperTest"}; +static double g_curScreenWidth = 0.0F; +static double g_curScreenHeight = 0.0F; +static double g_testWidth = 0.0F; +static double g_testHeight = 0.0F; + +static bool GetScreenSize() +{ + sptr display = + OHOS::Rosen::DisplayManager::GetInstance().GetDefaultDisplaySync(); + if (display == nullptr) { + return false; + } + + auto info = display->GetDisplayInfo(); + if (info == nullptr) { + return false; + } + + g_curScreenWidth = static_cast(info->GetWidth()); + g_curScreenHeight = static_cast(info->GetHeight()); + return true; +} +} + +void SecCompInfoHelperTest::SetUpTestCase() +{ + ASSERT_TRUE(GetScreenSize()); + g_testWidth = (ZERO_OFFSET + g_curScreenWidth) / QUARTER; + g_testHeight = (ZERO_OFFSET + g_curScreenHeight) / QUARTER; +} + +void SecCompInfoHelperTest::TearDownTestCase() +{} + +void SecCompInfoHelperTest::SetUp() +{ + SC_LOG_INFO(LABEL, "setup"); +} + +void SecCompInfoHelperTest::TearDown() +{} + +/** + * @tc.name: ParseComponent001 + * @tc.desc: Test parse component info success + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompInfoHelperTest, ParseComponent001, TestSize.Level1) +{ + nlohmann::json jsonComponent; + ServiceTestCommon::BuildLocationComponentJson(jsonComponent); + SecCompBase* comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); + ASSERT_NE(nullptr, comp); + ASSERT_TRUE(comp->GetValid()); +} + +/** + * @tc.name: ParseComponent002 + * @tc.desc: Test parse component info with empty json + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompInfoHelperTest, ParseComponent002, TestSize.Level1) +{ + nlohmann::json jsonComponent; + ASSERT_EQ(nullptr, SecCompInfoHelper::ParseComponent(UNKNOWN_SC_TYPE, jsonComponent)); + + ASSERT_EQ(nullptr, SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent)); + ASSERT_EQ(nullptr, SecCompInfoHelper::ParseComponent(PASTE_COMPONENT, jsonComponent)); + ASSERT_EQ(nullptr, SecCompInfoHelper::ParseComponent(SAVE_COMPONENT, jsonComponent)); +} + +/** + * @tc.name: ParseComponent003 + * @tc.desc: Test parse component info with invalid type + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompInfoHelperTest, ParseComponent003, TestSize.Level1) +{ + nlohmann::json jsonComponent; + ServiceTestCommon::BuildLocationComponentJson(jsonComponent); + + SecCompBase* comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); + ASSERT_TRUE(comp->GetValid()); + + jsonComponent[JsonTagConstants::JSON_SC_TYPE] = UNKNOWN_SC_TYPE; + comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); + ASSERT_EQ(nullptr, comp); +} + +/** + * @tc.name: ParseComponent004 + * @tc.desc: Test parse component info with invalid rect + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompInfoHelperTest, ParseComponent004, TestSize.Level1) +{ + SecCompRect rect = { + .x_ = g_testWidth, + .y_ = g_testHeight, + .width_ = g_testWidth, + .height_ = g_testHeight + }; + SecCompRect windowRect = { + .x_ = g_testWidth, + .y_ = g_testHeight, + .width_ = g_testWidth, + .height_ = g_testHeight + }; + ASSERT_TRUE(SecCompInfoHelper::CheckRectValid(rect, windowRect)); + + rect.x_ = TEST_INVALID_DIMENSION; + ASSERT_FALSE(SecCompInfoHelper::CheckRectValid(rect, windowRect)); + rect.y_ = TEST_INVALID_DIMENSION; + ASSERT_FALSE(SecCompInfoHelper::CheckRectValid(rect, windowRect)); + rect.x_ = g_curScreenWidth + 1; + ASSERT_FALSE(SecCompInfoHelper::CheckRectValid(rect, windowRect)); + rect.y_ = g_curScreenHeight + 1; + ASSERT_FALSE(SecCompInfoHelper::CheckRectValid(rect, windowRect)); + rect.width_ = g_curScreenWidth; + ASSERT_FALSE(SecCompInfoHelper::CheckRectValid(rect, windowRect)); + rect.height_ = g_curScreenHeight; + ASSERT_FALSE(SecCompInfoHelper::CheckRectValid(rect, windowRect)); + rect.x_ = g_curScreenWidth - g_testWidth; + ASSERT_FALSE(SecCompInfoHelper::CheckRectValid(rect, windowRect)); + rect.y_ = g_curScreenHeight - g_testHeight; + ASSERT_FALSE(SecCompInfoHelper::CheckRectValid(rect, windowRect)); +} + +/** + * @tc.name: ParseComponent005 + * @tc.desc: Test parse component info with windowRect invalid + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompInfoHelperTest, ParseComponent005, TestSize.Level1) +{ + SecCompRect rect = { + .x_ = g_testWidth, + .y_ = g_testHeight, + .width_ = g_testWidth, + .height_ = g_testHeight + }; + SecCompRect windowRect = { + .x_ = g_testWidth, + .y_ = g_testHeight, + .width_ = g_testWidth, + .height_ = g_testHeight + }; + ASSERT_TRUE(SecCompInfoHelper::CheckRectValid(rect, windowRect)); + + windowRect.x_ = g_testWidth + 1; + ASSERT_FALSE(SecCompInfoHelper::CheckRectValid(rect, windowRect)); + windowRect.y_ = g_testHeight + 1; + ASSERT_FALSE(SecCompInfoHelper::CheckRectValid(rect, windowRect)); + windowRect.width_ = g_testWidth - 1; + ASSERT_FALSE(SecCompInfoHelper::CheckRectValid(rect, windowRect)); + windowRect.height_ = g_testHeight - 1; + ASSERT_FALSE(SecCompInfoHelper::CheckRectValid(rect, windowRect)); + windowRect.width_ = TEST_INVALID_DIMENSION; + ASSERT_FALSE(SecCompInfoHelper::CheckRectValid(rect, windowRect)); + windowRect.height_ = TEST_INVALID_DIMENSION; + ASSERT_FALSE(SecCompInfoHelper::CheckRectValid(rect, windowRect)); +} + +/** + * @tc.name: ParseComponent006 + * @tc.desc: Test parse component info with parentEffect active + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompInfoHelperTest, ParseComponent006, TestSize.Level1) +{ + nlohmann::json jsonComponent; + ServiceTestCommon::BuildLocationComponentJson(jsonComponent); + + SecCompBase* comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); + ASSERT_TRUE(comp->GetValid()); + + jsonComponent[JsonTagConstants::JSON_PARENT_TAG] = nlohmann::json { + { JsonTagConstants::JSON_PARENT_EFFECT_TAG, true }, + }; + comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); + ASSERT_FALSE(comp->GetValid()); +} + +/** + * @tc.name: ParseComponent007 + * @tc.desc: Test parse component info with invalid size + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompInfoHelperTest, ParseComponent007, TestSize.Level1) +{ + nlohmann::json jsonComponent; + ServiceTestCommon::BuildLocationComponentJson(jsonComponent); + + SecCompBase* comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); + ASSERT_TRUE(comp->GetValid()); + + nlohmann::json jsonPadding = nlohmann::json { + { JsonTagConstants::JSON_PADDING_TOP_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_RIGHT_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_LEFT_TAG, TEST_DIMENSION }, + }; + + jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_INVALID_DIMENSION }, + { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, + }; + comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); + ASSERT_FALSE(comp->GetValid()); + + jsonPadding = nlohmann::json { + { JsonTagConstants::JSON_PADDING_TOP_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_RIGHT_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_LEFT_TAG, TEST_DIMENSION }, + }; + + jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_INVALID_DIMENSION }, + { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, + }; + comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); + ASSERT_FALSE(comp->GetValid()); + + jsonPadding = nlohmann::json { + { JsonTagConstants::JSON_PADDING_TOP_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_RIGHT_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_LEFT_TAG, TEST_DIMENSION }, + }; + + jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_INVALID_DIMENSION }, + { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, + }; + comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); + ASSERT_FALSE(comp->GetValid()); +} + +/** + * @tc.name: ParseComponent008 + * @tc.desc: Test parse component info with invalid size + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompInfoHelperTest, ParseComponent008, TestSize.Level1) +{ + nlohmann::json jsonComponent; + ServiceTestCommon::BuildLocationComponentJson(jsonComponent); + SecCompBase* comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); + ASSERT_TRUE(comp->GetValid()); + + nlohmann::json jsonPadding = nlohmann::json { + { JsonTagConstants::JSON_PADDING_TOP_TAG, TEST_INVALID_DIMENSION }, + { JsonTagConstants::JSON_PADDING_RIGHT_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_LEFT_TAG, TEST_DIMENSION }, + }; + + jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, + }; + comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); + ASSERT_FALSE(comp->GetValid()); + + jsonPadding = nlohmann::json { + { JsonTagConstants::JSON_PADDING_TOP_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_RIGHT_TAG, TEST_INVALID_DIMENSION }, + { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_LEFT_TAG, TEST_DIMENSION }, + }; + + jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, + }; + comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); + ASSERT_FALSE(comp->GetValid()); +} + +/** + * @tc.name: ParseComponent009 + * @tc.desc: Test parse component info with invalid size + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompInfoHelperTest, ParseComponent009, TestSize.Level1) +{ + nlohmann::json jsonComponent; + ServiceTestCommon::BuildLocationComponentJson(jsonComponent); + SecCompBase* comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); + ASSERT_TRUE(comp->GetValid()); + + nlohmann::json jsonPadding = nlohmann::json { + { JsonTagConstants::JSON_PADDING_TOP_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_RIGHT_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, TEST_INVALID_DIMENSION }, + { JsonTagConstants::JSON_PADDING_LEFT_TAG, TEST_DIMENSION }, + }; + + jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, + }; + comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); + ASSERT_FALSE(comp->GetValid()); + + jsonPadding = nlohmann::json { + { JsonTagConstants::JSON_PADDING_TOP_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_RIGHT_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_LEFT_TAG, TEST_INVALID_DIMENSION }, + }; + + jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, + }; + comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); + ASSERT_FALSE(comp->GetValid()); +} + +/** + * @tc.name: ParseComponent010 + * @tc.desc: Test parse component info with invalid color + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompInfoHelperTest, ParseComponent010, TestSize.Level1) +{ + nlohmann::json jsonComponent; + ServiceTestCommon::BuildLocationComponentJson(jsonComponent); + SecCompBase* comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); + ASSERT_TRUE(comp->GetValid()); + + jsonComponent[JsonTagConstants::JSON_COLORS_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_COLOR_TAG, TEST_COLOR_INVALID }, + { JsonTagConstants::JSON_ICON_COLOR_TAG, TEST_COLOR_BLUE }, + { JsonTagConstants::JSON_BG_COLOR_TAG, TEST_COLOR_YELLOW } + }; + comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); + ASSERT_FALSE(comp->GetValid()); + + jsonComponent[JsonTagConstants::JSON_COLORS_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_COLOR_TAG, TEST_COLOR_RED }, + { JsonTagConstants::JSON_ICON_COLOR_TAG, TEST_COLOR_INVALID }, + { JsonTagConstants::JSON_BG_COLOR_TAG, TEST_COLOR_YELLOW } + }; + comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); + ASSERT_FALSE(comp->GetValid()); + + jsonComponent[JsonTagConstants::JSON_COLORS_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_COLOR_TAG, TEST_COLOR_RED }, + { JsonTagConstants::JSON_ICON_COLOR_TAG, TEST_COLOR_BLUE }, + { JsonTagConstants::JSON_BG_COLOR_TAG, TEST_COLOR_INVALID } + }; + comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); + ASSERT_FALSE(comp->GetValid()); +} + +/** + * @tc.name: ParseComponent011 + * @tc.desc: Test parse component info with invalid style + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompInfoHelperTest, ParseComponent011, TestSize.Level1) +{ + nlohmann::json jsonComponent; + ServiceTestCommon::BuildLocationComponentJson(jsonComponent); + SecCompBase* comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); + ASSERT_TRUE(comp->GetValid()); + + jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_TEXT_TAG, NO_TEXT }, + { JsonTagConstants::JSON_ICON_TAG, NO_ICON }, + { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, + }; + comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); + ASSERT_FALSE(comp->GetValid()); +} + +/** + * @tc.name: ParseComponent012 + * @tc.desc: Test parse component info with invalid style + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompInfoHelperTest, ParseComponent012, TestSize.Level1) +{ + nlohmann::json jsonComponent; + ServiceTestCommon::BuildLocationComponentJson(jsonComponent); + SecCompBase* comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); + ASSERT_TRUE(comp->GetValid()); + + jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_TEXT_TAG, LocationDesc::SELECT_LOCATION }, + { JsonTagConstants::JSON_ICON_TAG, LocationIcon::LINE_ICON }, + { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, + }; + jsonComponent[JsonTagConstants::JSON_COLORS_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_COLOR_TAG, TEST_COLOR_YELLOW }, + { JsonTagConstants::JSON_ICON_COLOR_TAG, TEST_COLOR_BLUE }, + { JsonTagConstants::JSON_BG_COLOR_TAG, TEST_COLOR_YELLOW } + }; + comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); + ASSERT_FALSE(comp->GetValid()); + + jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_TEXT_TAG, LocationDesc::SELECT_LOCATION }, + { JsonTagConstants::JSON_ICON_TAG, LocationIcon::LINE_ICON }, + { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, + }; + jsonComponent[JsonTagConstants::JSON_COLORS_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_COLOR_TAG, TEST_COLOR_RED }, + { JsonTagConstants::JSON_ICON_COLOR_TAG, TEST_COLOR_YELLOW }, + { JsonTagConstants::JSON_BG_COLOR_TAG, TEST_COLOR_YELLOW } + }; + comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); + ASSERT_FALSE(comp->GetValid()); + + jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_TEXT_TAG, LocationDesc::SELECT_LOCATION }, + { JsonTagConstants::JSON_ICON_TAG, LocationIcon::LINE_ICON }, + { JsonTagConstants::JSON_BG_TAG, SecCompBackground::NO_BG_TYPE }, + }; + jsonComponent[JsonTagConstants::JSON_COLORS_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_COLOR_TAG, TEST_COLOR_RED }, + { JsonTagConstants::JSON_ICON_COLOR_TAG, TEST_COLOR_YELLOW }, + { JsonTagConstants::JSON_BG_COLOR_TAG, TEST_COLOR_YELLOW } + }; + comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); + ASSERT_FALSE(comp->GetValid()); +} + +/** + * @tc.name: ParseComponent013 + * @tc.desc: Test parse component info with invalid style + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompInfoHelperTest, ParseComponent013, TestSize.Level1) +{ + nlohmann::json jsonComponent; + ServiceTestCommon::BuildLocationComponentJson(jsonComponent); + SecCompBase* comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); + ASSERT_TRUE(comp->GetValid()); + + jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_TEXT_TAG, LocationDesc::SELECT_LOCATION }, + { JsonTagConstants::JSON_ICON_TAG, LocationIcon::LINE_ICON }, + { JsonTagConstants::JSON_BG_TAG, SecCompBackground::NO_BG_TYPE }, + }; + nlohmann::json jsonPadding = nlohmann::json { + { JsonTagConstants::JSON_PADDING_TOP_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_RIGHT_TAG, MIN_PADDING_WITHOUT_BG }, + { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, MIN_PADDING_WITHOUT_BG }, + { JsonTagConstants::JSON_PADDING_LEFT_TAG, MIN_PADDING_WITHOUT_BG }, + }; + + jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, + }; + comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); + ASSERT_FALSE(comp->GetValid()); + + jsonPadding = nlohmann::json { + { JsonTagConstants::JSON_PADDING_TOP_TAG, MIN_PADDING_WITHOUT_BG }, + { JsonTagConstants::JSON_PADDING_RIGHT_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, MIN_PADDING_WITHOUT_BG }, + { JsonTagConstants::JSON_PADDING_LEFT_TAG, MIN_PADDING_WITHOUT_BG }, + }; + + jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, + }; + comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); + ASSERT_FALSE(comp->GetValid()); +} + +/** + * @tc.name: ParseComponent014 + * @tc.desc: Test parse component info with invalid style + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompInfoHelperTest, ParseComponent014, TestSize.Level1) +{ + nlohmann::json jsonComponent; + ServiceTestCommon::BuildLocationComponentJson(jsonComponent); + SecCompBase* comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); + ASSERT_TRUE(comp->GetValid()); + + jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_TEXT_TAG, LocationDesc::SELECT_LOCATION }, + { JsonTagConstants::JSON_ICON_TAG, LocationIcon::LINE_ICON }, + { JsonTagConstants::JSON_BG_TAG, SecCompBackground::NO_BG_TYPE }, + }; + + nlohmann::json jsonPadding = nlohmann::json { + { JsonTagConstants::JSON_PADDING_TOP_TAG, MIN_PADDING_WITHOUT_BG }, + { JsonTagConstants::JSON_PADDING_RIGHT_TAG, MIN_PADDING_WITHOUT_BG }, + { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_LEFT_TAG, MIN_PADDING_WITHOUT_BG }, + }; + + jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, + }; + comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); + ASSERT_FALSE(comp->GetValid()); + + jsonPadding = nlohmann::json { + { JsonTagConstants::JSON_PADDING_TOP_TAG, MIN_PADDING_WITHOUT_BG }, + { JsonTagConstants::JSON_PADDING_RIGHT_TAG, MIN_PADDING_WITHOUT_BG }, + { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, MIN_PADDING_WITHOUT_BG }, + { JsonTagConstants::JSON_PADDING_LEFT_TAG, TEST_DIMENSION }, + }; + + jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, + }; + comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); + ASSERT_FALSE(comp->GetValid()); +} + + +/** + * @tc.name: CheckComponentValid001 + * @tc.desc: Test CheckComponentValid with invalid color + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompInfoHelperTest, CheckComponentValid001, TestSize.Level1) +{ + nlohmann::json jsonComponent; + ServiceTestCommon::BuildLocationComponentJson(jsonComponent); + SecCompBase* comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); + ASSERT_TRUE(comp->GetValid()); + jsonComponent[JsonTagConstants::JSON_COLORS_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_COLOR_TAG, TEST_COLOR_RED }, + { JsonTagConstants::JSON_ICON_COLOR_TAG, TEST_COLOR_BLACK }, + { JsonTagConstants::JSON_BG_COLOR_TAG, TEST_COLOR_WHITE } + }; + ASSERT_TRUE(SecCompInfoHelper::CheckComponentValid(comp)); +} + +/** + * @tc.name: CheckComponentValid002 + * @tc.desc: Test CheckComponentValid with invalid text or icon + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompInfoHelperTest, CheckComponentValid002, TestSize.Level1) +{ + nlohmann::json jsonComponent; + ServiceTestCommon::BuildLocationComponentJson(jsonComponent); + SecCompBase* comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); + comp->text_ = UNKNOWN_TEXT; + ASSERT_TRUE(SecCompInfoHelper::CheckComponentValid(comp)); + + comp->text_ = static_cast(LocationDesc::SELECT_LOCATION); + comp->icon_ = UNKNOWN_ICON; + ASSERT_TRUE(SecCompInfoHelper::CheckComponentValid(comp)); + + comp->text_ = UNKNOWN_TEXT; + ASSERT_FALSE(SecCompInfoHelper::CheckComponentValid(comp)); +} + +/** + * @tc.name: CheckComponentValid003 + * @tc.desc: Test CheckComponentValid with invalid type + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompInfoHelperTest, CheckComponentValid003, TestSize.Level1) +{ + nlohmann::json jsonComponent; + ServiceTestCommon::BuildLocationComponentJson(jsonComponent); + SecCompBase* comp = SecCompInfoHelper::ParseComponent(LOCATION_COMPONENT, jsonComponent); + comp->type_ = SecCompType::UNKNOWN_SC_TYPE; + ASSERT_FALSE(SecCompInfoHelper::CheckComponentValid(comp)); + + comp->type_ = SecCompType::MAX_SC_TYPE; + ASSERT_FALSE(SecCompInfoHelper::CheckComponentValid(comp)); +} diff --git a/services/security_component_service/sa/test/unittest/src/sec_comp_info_helper_test.h b/services/security_component_service/sa/test/unittest/src/sec_comp_info_helper_test.h new file mode 100644 index 0000000..a9d8459 --- /dev/null +++ b/services/security_component_service/sa/test/unittest/src/sec_comp_info_helper_test.h @@ -0,0 +1,37 @@ +/* + * 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 SEC_COMP_INFO_HELPER_TEST_H +#define SEC_COMP_INFO_HELPER_TEST_H + +#include +#include "sec_comp_info_helper.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +class SecCompInfoHelperTest : public testing::Test { +public: + static void SetUpTestCase(); + + static void TearDownTestCase(); + + void SetUp(); + + void TearDown(); +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // SEC_COMP_ENTITY_TEST_H diff --git a/services/security_component_service/sa/test/unittest/src/sec_comp_manager_test.cpp b/services/security_component_service/sa/test/unittest/src/sec_comp_manager_test.cpp new file mode 100644 index 0000000..be5d04b --- /dev/null +++ b/services/security_component_service/sa/test/unittest/src/sec_comp_manager_test.cpp @@ -0,0 +1,342 @@ +/* + * 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 "sec_comp_manager_test.h" + +#include "sec_comp_log.h" +#include "location_button.h" +#include "save_button.h" +#include "sec_comp_err.h" +#include "service_test_common.h" + +using namespace testing::ext; +using namespace OHOS; +using namespace OHOS::Security::SecurityComponent; +using namespace OHOS::Security::AccessToken; + +namespace { +static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { + LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompManagerTest"}; + +static LocationButton BuildInvalidLocationComponent() +{ + LocationButton button; + button.fontSize_ = TEST_INVALID_SIZE; + button.iconSize_ = TEST_INVALID_SIZE; + button.padding_.top = TEST_INVALID_SIZE; + button.padding_.right = TEST_INVALID_SIZE; + button.padding_.bottom = TEST_INVALID_SIZE; + button.padding_.left = TEST_INVALID_SIZE; + button.textIconSpace_ = TEST_INVALID_SIZE; + button.fontColor_.value = TEST_COLOR_WHITE; + button.iconColor_.value = TEST_COLOR_WHITE; + button.bgColor_.value = TEST_COLOR_WHITE; + button.borderWidth_ = TEST_INVALID_SIZE; + button.type_ = LOCATION_COMPONENT; + button.rect_.x_ = TEST_COORDINATE; + button.rect_.y_ = TEST_COORDINATE; + button.rect_.width_ = TEST_COORDINATE; + button.rect_.height_ = TEST_COORDINATE; + button.windowRect_.x_ = TEST_COORDINATE; + button.windowRect_.y_ = TEST_COORDINATE; + button.windowRect_.width_ = TEST_COORDINATE; + button.windowRect_.height_ = TEST_COORDINATE; + button.text_ = UNKNOWN_TEXT; + button.icon_ = UNKNOWN_ICON; + button.bg_ = SecCompBackground::UNKNOWN_BG; + return button; +} + +static LocationButton BuildValidLocationComponent() +{ + LocationButton button; + button.fontSize_ = TEST_SIZE; + button.iconSize_ = TEST_SIZE; + button.padding_.top = TEST_SIZE; + button.padding_.right = TEST_SIZE; + button.padding_.bottom = TEST_SIZE; + button.padding_.left = TEST_SIZE; + button.textIconSpace_ = TEST_SIZE; + button.fontColor_.value = TEST_COLOR_YELLOW; + button.iconColor_.value = TEST_COLOR_RED; + button.bgColor_.value = TEST_COLOR_BLUE; + button.borderWidth_ = TEST_SIZE; + button.type_ = LOCATION_COMPONENT; + button.rect_.x_ = TEST_COORDINATE; + button.rect_.y_ = TEST_COORDINATE; + button.rect_.width_ = TEST_COORDINATE; + button.rect_.height_ = TEST_COORDINATE; + button.windowRect_.x_ = TEST_COORDINATE; + button.windowRect_.y_ = TEST_COORDINATE; + button.windowRect_.width_ = TEST_COORDINATE; + button.windowRect_.height_ = TEST_COORDINATE; + button.text_ = static_cast(LocationDesc::SELECT_LOCATION); + button.icon_ = static_cast(LocationIcon::LINE_ICON); + button.bg_ = SecCompBackground::CIRCLE; + return button; +} +} + +void SecCompManagerTest::SetUpTestCase() +{} + +void SecCompManagerTest::TearDownTestCase() +{} + +void SecCompManagerTest::SetUp() +{ + SC_LOG_INFO(LABEL, "setup"); +} + +void SecCompManagerTest::TearDown() +{ + SecCompManager::GetInstance().componentMap_.clear(); +} + + +/** + * @tc.name: CreateScId001 + * @tc.desc: Test create sc id + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompManagerTest, CreateScId001, TestSize.Level1) +{ + SecCompManager::GetInstance().scIdStart_ = MAX_INT_NUM; + ASSERT_EQ(SC_ID_START, SecCompManager::GetInstance().CreateScId()); + + SecCompManager::GetInstance().scIdStart_ = SC_ID_START; + ASSERT_EQ(SC_ID_START + 1, SecCompManager::GetInstance().CreateScId()); +} + +/** + * @tc.name: AddSecurityComponentToList001 + * @tc.desc: Test add security component to list + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompManagerTest, AddSecurityComponentToList001, TestSize.Level1) +{ + std::shared_ptr compPtr = std::make_shared(); + ASSERT_NE(nullptr, compPtr); + compPtr->rect_.x_ = TEST_COORDINATE; + compPtr->rect_.y_ = TEST_COORDINATE; + compPtr->rect_.width_ = TEST_COORDINATE; + compPtr->rect_.height_ = TEST_COORDINATE; + SecCompEntity entity(compPtr, TEST_TOKEN_ID, TEST_SC_ID_1); + + ASSERT_EQ(SC_OK, SecCompManager::GetInstance().AddSecurityComponentToList(1, entity)); + + std::shared_ptr compPtrNew = std::make_shared(); + ASSERT_NE(nullptr, compPtrNew); + compPtrNew->rect_.x_ = TEST_COORDINATE * 2; // not overlap + compPtrNew->rect_.y_ = TEST_COORDINATE * 2; // not overlap + compPtrNew->rect_.width_ = TEST_COORDINATE; + compPtrNew->rect_.height_ = TEST_COORDINATE; + SecCompEntity entityNew(compPtrNew, TEST_TOKEN_ID, TEST_SC_ID_2); + ASSERT_EQ(SC_OK, SecCompManager::GetInstance().AddSecurityComponentToList(1, entityNew)); +} + +/** + * @tc.name: DeleteSecurityComponentFromList001 + * @tc.desc: Test delete security component + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompManagerTest, DeleteSecurityComponentFromList001, TestSize.Level1) +{ + ASSERT_EQ(SecCompManager::GetInstance().DeleteSecurityComponentFromList(TEST_PID_1, TEST_SC_ID_1), + SC_SERVICE_ERROR_COMPONENT_NOT_EXIST); + + std::shared_ptr compPtr = std::make_shared(); + ASSERT_NE(nullptr, compPtr); + compPtr->rect_.x_ = TEST_COORDINATE; + compPtr->rect_.y_ = TEST_COORDINATE; + compPtr->rect_.width_ = TEST_COORDINATE; + compPtr->rect_.height_ = TEST_COORDINATE; + SecCompEntity entity(compPtr, TEST_TOKEN_ID, TEST_SC_ID_1); + ASSERT_EQ(SC_OK, SecCompManager::GetInstance().AddSecurityComponentToList(TEST_PID_1, entity)); + + ASSERT_EQ(SC_SERVICE_ERROR_COMPONENT_NOT_EXIST, + SecCompManager::GetInstance().DeleteSecurityComponentFromList(TEST_PID_1, TEST_SC_ID_2)); + + ASSERT_EQ(SC_OK, SecCompManager::GetInstance().DeleteSecurityComponentFromList(TEST_PID_1, TEST_SC_ID_1)); +} + +/** + * @tc.name: GetSecurityComponentFromList001 + * @tc.desc: Test get security component + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompManagerTest, GetSecurityComponentFromList001, TestSize.Level1) +{ + ASSERT_EQ(nullptr, SecCompManager::GetInstance().GetSecurityComponentFromList(TEST_PID_1, TEST_SC_ID_1)); + + std::shared_ptr compPtr = std::make_shared(); + ASSERT_NE(nullptr, compPtr); + compPtr->rect_.x_ = TEST_COORDINATE; + compPtr->rect_.y_ = TEST_COORDINATE; + compPtr->rect_.width_ = TEST_COORDINATE; + compPtr->rect_.height_ = TEST_COORDINATE; + SecCompEntity entity(compPtr, TEST_TOKEN_ID, TEST_SC_ID_1); + ASSERT_EQ(SC_OK, SecCompManager::GetInstance().AddSecurityComponentToList(TEST_PID_1, entity)); + ASSERT_EQ(nullptr, SecCompManager::GetInstance().GetSecurityComponentFromList(TEST_PID_1, TEST_SC_ID_2)); + ASSERT_NE(nullptr, SecCompManager::GetInstance().GetSecurityComponentFromList(TEST_PID_1, TEST_SC_ID_1)); +} + +/** + * @tc.name: NotifyProcessBackground001 + * @tc.desc: Test notify process background + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompManagerTest, NotifyProcessBackground001, TestSize.Level1) +{ + SecCompManager::GetInstance().NotifyProcessBackground(TEST_PID_1); + + std::shared_ptr compPtr = std::make_shared(); + ASSERT_NE(nullptr, compPtr); + compPtr->rect_.x_ = TEST_COORDINATE; + compPtr->rect_.y_ = TEST_COORDINATE; + compPtr->rect_.width_ = TEST_COORDINATE; + compPtr->rect_.height_ = TEST_COORDINATE; + SecCompEntity entity(compPtr, TEST_TOKEN_ID, TEST_SC_ID_1); + ASSERT_EQ(SC_OK, SecCompManager::GetInstance().AddSecurityComponentToList(TEST_PID_1, entity)); + auto component = SecCompManager::GetInstance().GetSecurityComponentFromList(TEST_PID_1, TEST_SC_ID_1); + ASSERT_NE(nullptr, component); + SecCompManager::GetInstance().NotifyProcessForeground(TEST_PID_1); + ASSERT_TRUE(SecCompManager::GetInstance().IsForegroundCompExist()); + + SecCompManager::GetInstance().NotifyProcessBackground(TEST_PID_1); + ASSERT_FALSE(SecCompManager::GetInstance().IsForegroundCompExist()); +} + +/** + * @tc.name: NotifyProcessDied001 + * @tc.desc: Test notify process died + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompManagerTest, NotifyProcessDied001, TestSize.Level1) +{ + std::shared_ptr compPtr = std::make_shared(); + ASSERT_NE(nullptr, compPtr); + compPtr->rect_.x_ = TEST_COORDINATE; + compPtr->rect_.y_ = TEST_COORDINATE; + compPtr->rect_.width_ = TEST_COORDINATE; + compPtr->rect_.height_ = TEST_COORDINATE; + SecCompEntity entity(compPtr, TEST_TOKEN_ID, TEST_SC_ID_1); + ASSERT_EQ(SC_OK, SecCompManager::GetInstance().AddSecurityComponentToList(TEST_PID_1, entity)); + + std::shared_ptr compPtr2 = std::make_shared(); + ASSERT_NE(nullptr, compPtr2); + compPtr2->rect_.x_ = TEST_COORDINATE * 2; // not overlap + compPtr2->rect_.y_ = TEST_COORDINATE * 2; // not overlap + compPtr2->rect_.width_ = TEST_COORDINATE; + compPtr2->rect_.height_ = TEST_COORDINATE; + SecCompEntity entity2(compPtr2, TEST_TOKEN_ID, TEST_SC_ID_2); + ASSERT_EQ(SC_OK, SecCompManager::GetInstance().AddSecurityComponentToList(TEST_PID_2, entity2)); + + SecCompManager::GetInstance().NotifyProcessDied(TEST_PID_3); + ASSERT_NE(nullptr, SecCompManager::GetInstance().GetSecurityComponentFromList(TEST_PID_1, TEST_SC_ID_1)); + + SecCompManager::GetInstance().NotifyProcessDied(TEST_PID_1); + ASSERT_EQ(nullptr, SecCompManager::GetInstance().GetSecurityComponentFromList(TEST_PID_1, TEST_SC_ID_1)); +} + +/** + * @tc.name: RegisterSecurityComponent001 + * @tc.desc: Test register security component + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompManagerTest, RegisterSecurityComponent001, TestSize.Level1) +{ + nlohmann::json jsonInvalid; + LocationButton buttonInvalid = BuildInvalidLocationComponent(); + buttonInvalid.ToJson(jsonInvalid); + int32_t scId; + SecCompCallerInfo caller = { + .tokenId = TEST_TOKEN_ID, + .pid = TEST_PID_1 + }; + ASSERT_EQ(SC_SERVICE_ERROR_COMPONENT_INFO_INVALID, + SecCompManager::GetInstance().RegisterSecurityComponent(LOCATION_COMPONENT, jsonInvalid, caller, scId)); + + nlohmann::json jsonValid; + LocationButton buttonValid = BuildValidLocationComponent(); + buttonValid.ToJson(jsonValid); + + // callback check failed + ASSERT_EQ(SC_ENHANCE_ERROR_CALLBACK_NOT_EXIST, + SecCompManager::GetInstance().RegisterSecurityComponent(LOCATION_COMPONENT, jsonValid, caller, scId)); + SecCompManager::GetInstance().maliciousAppList_.clear(); +} + +/** + * @tc.name: UpdateSecurityComponent001 + * @tc.desc: Test update security component + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompManagerTest, UpdateSecurityComponent001, TestSize.Level1) +{ + nlohmann::json jsonValid; + LocationButton buttonValid = BuildValidLocationComponent(); + buttonValid.ToJson(jsonValid); + SecCompCallerInfo caller = { + .tokenId = TEST_TOKEN_ID, + .pid = TEST_PID_1 + }; + ASSERT_NE(SC_OK, SecCompManager::GetInstance().UpdateSecurityComponent(TEST_SC_ID_1, jsonValid, caller)); +} + +/** + * @tc.name: UnregisterSecurityComponent001 + * @tc.desc: Test unregister security component + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompManagerTest, UnregisterSecurityComponent001, TestSize.Level1) +{ + SecCompCallerInfo caller = { + .tokenId = TEST_TOKEN_ID, + .pid = TEST_PID_1 + }; + + ASSERT_EQ(SC_SERVICE_ERROR_VALUE_INVALID, + SecCompManager::GetInstance().UnregisterSecurityComponent(TEST_INVALID_SC_ID, caller)); +} + +/** + * @tc.name: ReportSecurityComponentClickEvent001 + * @tc.desc: Test report security component click + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompManagerTest, ReportSecurityComponentClickEvent001, TestSize.Level1) +{ + SecCompCallerInfo caller = { + .tokenId = TEST_TOKEN_ID, + .pid = TEST_PID_1 + }; + SecCompClickEvent touchInfo; + nlohmann::json jsonVaild; + LocationButton buttonValid = BuildValidLocationComponent(); + buttonValid.ToJson(jsonVaild); + ASSERT_NE(SC_OK, + SecCompManager::GetInstance().ReportSecurityComponentClickEvent(1, jsonVaild, caller, touchInfo, nullptr)); +} diff --git a/services/security_component_service/sa/test/unittest/src/sec_comp_manager_test.h b/services/security_component_service/sa/test/unittest/src/sec_comp_manager_test.h new file mode 100644 index 0000000..eaf0968 --- /dev/null +++ b/services/security_component_service/sa/test/unittest/src/sec_comp_manager_test.h @@ -0,0 +1,39 @@ +/* + * 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 SEC_COMP_MANAGER_TEST_H +#define SEC_COMP_MANAGER_TEST_H + +#include +#define private public +#include "sec_comp_manager.h" +#undef private + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +class SecCompManagerTest : public testing::Test { +public: + static void SetUpTestCase(); + + static void TearDownTestCase(); + + void SetUp(); + + void TearDown(); +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // SEC_COMP_MANAGER_TEST_H diff --git a/services/security_component_service/sa/test/unittest/src/sec_comp_service_mock_test.cpp b/services/security_component_service/sa/test/unittest/src/sec_comp_service_mock_test.cpp new file mode 100644 index 0000000..554cceb --- /dev/null +++ b/services/security_component_service/sa/test/unittest/src/sec_comp_service_mock_test.cpp @@ -0,0 +1,323 @@ +/* + * 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 "sec_comp_service_mock_test.h" + +#include "ipc_skeleton.h" +#include "iservice_registry.h" +#include "location_button.h" +#include "mock_system_ability_proxy.h" +#include "mock_app_mgr_proxy.h" +#include "paste_button.h" +#include "save_button.h" +#include "sec_comp_err.h" +#include "sec_comp_log.h" +#include "sec_comp_tool.h" +#include "sec_comp_enhance_adapter.h" +#include "service_test_common.h" +#include "system_ability.h" +#include "token_setproc.h" + +using namespace testing::ext; +using namespace OHOS; +using namespace OHOS::Security::SecurityComponent; +using namespace OHOS::Security::AccessToken; + +namespace { +static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { + LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompServiceMockTest"}; +static AccessTokenID g_selfTokenId = 0; +} + +void SecCompServiceMockTest::SetUpTestCase() +{} + +void SecCompServiceMockTest::TearDownTestCase() +{} + +void SecCompServiceMockTest::SetUp() +{ + SC_LOG_INFO(LABEL, "setup"); + if (secCompService_ != nullptr) { + return; + } + SecCompService* ptr = new (std::nothrow) SecCompService(SA_ID, true); + secCompService_ = sptr(ptr); + ASSERT_NE(nullptr, secCompService_); + secCompService_->appStateObserver_ = new (std::nothrow) AppStateObserver(); + ASSERT_NE(nullptr, secCompService_->appStateObserver_); + g_selfTokenId = GetSelfTokenID(); +} + +void SecCompServiceMockTest::TearDown() +{ + if (secCompService_ != nullptr) { + secCompService_->appStateObserver_ = nullptr; + } + secCompService_ = nullptr; + EXPECT_EQ(0, SetSelfTokenID(g_selfTokenId)); +} + +/** + * @tc.name: RegisterSecurityComponent001 + * @tc.desc: Test register security component + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompServiceMockTest, RegisterSecurityComponent001, TestSize.Level1) +{ + // get caller fail + int32_t scId; + secCompService_->state_ = ServiceRunningState::STATE_RUNNING; + secCompService_->Initialize(); + EXPECT_EQ(SC_SERVICE_ERROR_VALUE_INVALID, secCompService_->RegisterSecurityComponent(SAVE_COMPONENT, "", scId)); + nlohmann::json jsonRes; + ServiceTestCommon::BuildSaveComponentJson(jsonRes); + std::string saveInfo = jsonRes.dump(); + + // parse component json fail + ASSERT_EQ(0, SetSelfTokenID(HAP_TOKEN_ID)); + AppExecFwk::AppStateData stateData = { + .uid = getuid() + }; + secCompService_->appStateObserver_->AddProcessToForegroundSet(stateData); + // wrong json + EXPECT_EQ(SC_SERVICE_ERROR_VALUE_INVALID, secCompService_->RegisterSecurityComponent(SAVE_COMPONENT, "{a=", scId)); + + // register security component ok + EXPECT_EQ(SC_OK, secCompService_->RegisterSecurityComponent(SAVE_COMPONENT, saveInfo, scId)); + EXPECT_EQ(SC_OK, secCompService_->UpdateSecurityComponent(scId, saveInfo)); + struct SecCompClickEvent touch = { + .touchX = 100, + .touchY = 100, + .timestamp = static_cast( + std::chrono::high_resolution_clock::now().time_since_epoch().count()) / TIME_CONVERSION_UNIT + }; + + EXPECT_EQ(SC_OK, secCompService_->ReportSecurityComponentClickEvent(scId, saveInfo, touch, nullptr)); + sleep(5); + EXPECT_EQ(SC_OK, secCompService_->UnregisterSecurityComponent(scId)); +} + +/** + * @tc.name: RegisterSecurityComponent002 + * @tc.desc: Test register security component check touch info failed + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompServiceMockTest, RegisterSecurityComponent002, TestSize.Level1) +{ + int32_t scId; + secCompService_->state_ = ServiceRunningState::STATE_RUNNING; + secCompService_->Initialize(); + nlohmann::json jsonRes; + ServiceTestCommon::BuildSaveComponentJson(jsonRes); + std::string saveInfo = jsonRes.dump(); + + ASSERT_EQ(0, SetSelfTokenID(HAP_TOKEN_ID)); + AppExecFwk::AppStateData stateData = { + .uid = getuid() + }; + secCompService_->appStateObserver_->AddProcessToForegroundSet(stateData); + // register security component ok + EXPECT_EQ(SC_OK, secCompService_->RegisterSecurityComponent(SAVE_COMPONENT, saveInfo, scId)); + struct SecCompClickEvent touch = { + .touchX = 100, + .touchY = 100, + .timestamp = static_cast( + std::chrono::high_resolution_clock::now().time_since_epoch().count()) + }; + EXPECT_EQ(SC_SERVICE_ERROR_CLICK_EVENT_INVALID, + secCompService_->ReportSecurityComponentClickEvent(scId, saveInfo, touch, nullptr)); + EXPECT_EQ(SC_OK, secCompService_->UnregisterSecurityComponent(scId)); +} + +/** + * @tc.name: RegisterSecurityComponent003 + * @tc.desc: Test register security component permission grant failed + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompServiceMockTest, RegisterSecurityComponent003, TestSize.Level1) +{ + int32_t scId; + secCompService_->state_ = ServiceRunningState::STATE_RUNNING; + secCompService_->Initialize(); + nlohmann::json jsonRes; + ServiceTestCommon::BuildSaveComponentJson(jsonRes); + std::string saveInfo = jsonRes.dump(); + + ASSERT_EQ(0, SetSelfTokenID(0)); + AppExecFwk::AppStateData stateData = { + .uid = getuid() + }; + secCompService_->appStateObserver_->AddProcessToForegroundSet(stateData); + // register security component ok + EXPECT_EQ(SC_OK, secCompService_->RegisterSecurityComponent(SAVE_COMPONENT, saveInfo, scId)); + struct SecCompClickEvent touch = { + .touchX = 100, + .touchY = 100, + .timestamp = static_cast( + std::chrono::high_resolution_clock::now().time_since_epoch().count()) / TIME_CONVERSION_UNIT + }; + EXPECT_EQ(SC_SERVICE_ERROR_PERMISSION_OPER_FAIL, + secCompService_->ReportSecurityComponentClickEvent(scId, saveInfo, touch, nullptr)); + EXPECT_EQ(SC_OK, secCompService_->UnregisterSecurityComponent(scId)); +} + +/** + * @tc.name: ReportSecurityComponentClickEvent001 + * @tc.desc: Test register security component + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompServiceMockTest, ReportSecurityComponentClickEvent001, TestSize.Level1) +{ + int32_t scId; + secCompService_->state_ = ServiceRunningState::STATE_RUNNING; + secCompService_->Initialize(); + nlohmann::json jsonRes; + ServiceTestCommon::BuildSaveComponentJson(jsonRes); + std::string saveInfo = jsonRes.dump(); + + ASSERT_EQ(0, SetSelfTokenID(HAP_TOKEN_ID)); + AppExecFwk::AppStateData stateData = { + .uid = getuid() + }; + secCompService_->appStateObserver_->AddProcessToForegroundSet(stateData); + // register security component ok + EXPECT_EQ(SC_OK, secCompService_->RegisterSecurityComponent(SAVE_COMPONENT, saveInfo, scId)); + struct SecCompClickEvent touchInfo = { + .touchX = 100, + .touchY = 100, + .timestamp = static_cast( + std::chrono::high_resolution_clock::now().time_since_epoch().count()) / TIME_CONVERSION_UNIT + }; + + ASSERT_EQ(SC_OK, secCompService_->ReportSecurityComponentClickEvent(scId, saveInfo, touchInfo, nullptr)); + + ASSERT_TRUE(secCompService_->ReduceAfterVerifySavePermission(HAP_TOKEN_ID)); + + ASSERT_FALSE(secCompService_->ReduceAfterVerifySavePermission(HAP_TOKEN_ID)); + + ASSERT_EQ(SC_OK, secCompService_->ReportSecurityComponentClickEvent(scId, saveInfo, touchInfo, nullptr)); + sleep(6); + ASSERT_FALSE(secCompService_->ReduceAfterVerifySavePermission(HAP_TOKEN_ID)); + EXPECT_EQ(SC_OK, secCompService_->UnregisterSecurityComponent(scId)); +} + +/** + * @tc.name: ReportSecurityComponentClickEvent002 + * @tc.desc: Test report security component click with save button + * @tc.type: FUNC + * @tc.require: AR000HO9IN + */ +HWTEST_F(SecCompServiceMockTest, ReportSecurityComponentClickEvent002, TestSize.Level1) +{ + int32_t scId; + secCompService_->state_ = ServiceRunningState::STATE_RUNNING; + secCompService_->Initialize(); + nlohmann::json jsonRes; + ServiceTestCommon::BuildSaveComponentJson(jsonRes); + std::string saveInfo = jsonRes.dump(); + + ASSERT_EQ(0, SetSelfTokenID(HAP_TOKEN_ID)); + AppExecFwk::AppStateData stateData = { + .uid = getuid() + }; + secCompService_->appStateObserver_->AddProcessToForegroundSet(stateData); + // register security component ok + EXPECT_EQ(SC_OK, secCompService_->RegisterSecurityComponent(SAVE_COMPONENT, saveInfo, scId)); + struct SecCompClickEvent touchInfo = { + .touchX = 100, + .touchY = 100, + .timestamp = static_cast( + std::chrono::high_resolution_clock::now().time_since_epoch().count()) / TIME_CONVERSION_UNIT + }; + + ASSERT_EQ(SC_OK, secCompService_->ReportSecurityComponentClickEvent(scId, saveInfo, touchInfo, nullptr)); + ASSERT_EQ(SC_OK, secCompService_->ReportSecurityComponentClickEvent(scId, saveInfo, touchInfo, nullptr)); + + ASSERT_TRUE(secCompService_->ReduceAfterVerifySavePermission(HAP_TOKEN_ID)); + ASSERT_TRUE(secCompService_->ReduceAfterVerifySavePermission(HAP_TOKEN_ID)); + ASSERT_FALSE(secCompService_->ReduceAfterVerifySavePermission(HAP_TOKEN_ID)); + + ASSERT_EQ(SC_OK, secCompService_->ReportSecurityComponentClickEvent(scId, saveInfo, touchInfo, nullptr)); + sleep(3); + touchInfo.timestamp = static_cast( + std::chrono::high_resolution_clock::now().time_since_epoch().count()) / TIME_CONVERSION_UNIT; + ASSERT_EQ(SC_OK, secCompService_->ReportSecurityComponentClickEvent(scId, saveInfo, touchInfo, nullptr)); + sleep(3); + ASSERT_TRUE(secCompService_->ReduceAfterVerifySavePermission(HAP_TOKEN_ID)); + ASSERT_FALSE(secCompService_->ReduceAfterVerifySavePermission(HAP_TOKEN_ID)); + + touchInfo.timestamp = static_cast( + std::chrono::high_resolution_clock::now().time_since_epoch().count()) / TIME_CONVERSION_UNIT; + ASSERT_EQ(SC_OK, secCompService_->ReportSecurityComponentClickEvent(scId, saveInfo, touchInfo, nullptr)); + sleep(3); + touchInfo.timestamp = static_cast( + std::chrono::high_resolution_clock::now().time_since_epoch().count()) / TIME_CONVERSION_UNIT;; + ASSERT_EQ(SC_OK, secCompService_->ReportSecurityComponentClickEvent(scId, saveInfo, touchInfo, nullptr)); + ASSERT_TRUE(secCompService_->ReduceAfterVerifySavePermission(HAP_TOKEN_ID)); + sleep(3); + ASSERT_TRUE(secCompService_->ReduceAfterVerifySavePermission(HAP_TOKEN_ID)); + ASSERT_FALSE(secCompService_->ReduceAfterVerifySavePermission(HAP_TOKEN_ID)); +} + +/** + * @tc.name: ReportSecurityComponentClickEvent003 + * @tc.desc: Test report security component click twice with save button + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompServiceMockTest, ReportSecurityComponentClickEvent003, TestSize.Level1) +{ + int32_t scId; + secCompService_->state_ = ServiceRunningState::STATE_RUNNING; + secCompService_->Initialize(); + nlohmann::json jsonRes; + ServiceTestCommon::BuildSaveComponentJson(jsonRes); + std::string saveInfo = jsonRes.dump(); + + ASSERT_EQ(0, SetSelfTokenID(HAP_TOKEN_ID)); + AppExecFwk::AppStateData stateData = { + .uid = getuid() + }; + secCompService_->appStateObserver_->AddProcessToForegroundSet(stateData); + // register security component ok + EXPECT_EQ(SC_OK, secCompService_->RegisterSecurityComponent(SAVE_COMPONENT, saveInfo, scId)); + struct SecCompClickEvent touchInfo = { + .touchX = 100, + .touchY = 100, + .timestamp = static_cast( + std::chrono::high_resolution_clock::now().time_since_epoch().count()) / TIME_CONVERSION_UNIT + }; + + ASSERT_EQ(SC_OK, secCompService_->ReportSecurityComponentClickEvent(scId, saveInfo, touchInfo, nullptr)); + sleep(3); + touchInfo.timestamp = static_cast( + std::chrono::high_resolution_clock::now().time_since_epoch().count()) / TIME_CONVERSION_UNIT; + ASSERT_EQ(SC_OK, secCompService_->ReportSecurityComponentClickEvent(scId, saveInfo, touchInfo, nullptr)); + sleep(6); + ASSERT_FALSE(secCompService_->ReduceAfterVerifySavePermission(HAP_TOKEN_ID)); + + touchInfo.timestamp = static_cast( + std::chrono::high_resolution_clock::now().time_since_epoch().count()) / TIME_CONVERSION_UNIT; + ASSERT_EQ(SC_OK, secCompService_->ReportSecurityComponentClickEvent(scId, saveInfo, touchInfo, nullptr)); + ASSERT_TRUE(secCompService_->ReduceAfterVerifySavePermission(HAP_TOKEN_ID)); + ASSERT_EQ(SC_OK, secCompService_->ReportSecurityComponentClickEvent(scId, saveInfo, touchInfo, nullptr)); + sleep(3); + ASSERT_TRUE(secCompService_->ReduceAfterVerifySavePermission(HAP_TOKEN_ID)); + ASSERT_FALSE(secCompService_->ReduceAfterVerifySavePermission(HAP_TOKEN_ID)); +} diff --git a/services/security_component_service/sa/test/unittest/src/sec_comp_service_mock_test.h b/services/security_component_service/sa/test/unittest/src/sec_comp_service_mock_test.h new file mode 100644 index 0000000..f2f7ae7 --- /dev/null +++ b/services/security_component_service/sa/test/unittest/src/sec_comp_service_mock_test.h @@ -0,0 +1,42 @@ +/* + * 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 SEC_COMP_SERVICE_TEST_H +#define SEC_COMP_SERVICE_TEST_H + +#include +#define private public +#include "sec_comp_service.h" +#undef private + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +class SecCompServiceMockTest : public testing::Test { +public: + static void SetUpTestCase(); + + static void TearDownTestCase(); + + void SetUp(); + + void TearDown(); + + sptr secCompService_ = nullptr; +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // SEC_COMP_SERVICE_TEST_H diff --git a/services/security_component_service/sa/test/unittest/src/sec_comp_service_test.cpp b/services/security_component_service/sa/test/unittest/src/sec_comp_service_test.cpp new file mode 100644 index 0000000..afd77a2 --- /dev/null +++ b/services/security_component_service/sa/test/unittest/src/sec_comp_service_test.cpp @@ -0,0 +1,271 @@ +/* + * 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 "sec_comp_service_test.h" + +#include "ipc_skeleton.h" +#include "iservice_registry.h" +#include "location_button.h" +#include "mock_system_ability_proxy.h" +#include "mock_app_mgr_proxy.h" +#include "paste_button.h" +#include "save_button.h" +#include "sec_comp_err.h" +#include "sec_comp_log.h" +#include "sec_comp_tool.h" +#include "service_test_common.h" +#include "system_ability.h" +#include "token_setproc.h" + +using namespace testing::ext; +using namespace OHOS; +using namespace OHOS::Security::SecurityComponent; +using namespace OHOS::Security::AccessToken; + +namespace { +static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { + LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompServiceTest"}; +static AccessTokenID g_selfTokenId = 0; +} + +void SecCompServiceTest::SetUpTestCase() +{} + +void SecCompServiceTest::TearDownTestCase() +{} + +void SecCompServiceTest::SetUp() +{ + SC_LOG_INFO(LABEL, "setup"); + if (secCompService_ != nullptr) { + return; + } + SecCompService* ptr = new (std::nothrow) SecCompService(SA_ID, true); + secCompService_ = sptr(ptr); + ASSERT_NE(nullptr, secCompService_); + secCompService_->appStateObserver_ = new (std::nothrow) AppStateObserver(); + ASSERT_NE(nullptr, secCompService_->appStateObserver_); + g_selfTokenId = GetSelfTokenID(); +} + +void SecCompServiceTest::TearDown() +{ + if (secCompService_ != nullptr) { + secCompService_->appStateObserver_ = nullptr; + } + secCompService_ = nullptr; + EXPECT_EQ(0, SetSelfTokenID(g_selfTokenId)); +} + +/** + * @tc.name: Onstart001 + * @tc.desc: Test OnStart + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompServiceTest, OnStart001, TestSize.Level1) +{ + secCompService_->state_ = ServiceRunningState::STATE_RUNNING; + secCompService_->appStateObserver_ = nullptr; + secCompService_->OnStart(); + ASSERT_EQ(nullptr, secCompService_->appStateObserver_); + EXPECT_CALL(*secCompService_, Publish(testing::_)).WillOnce(testing::Return(false)); + + secCompService_->state_ = ServiceRunningState::STATE_NOT_START; + secCompService_->appStateObserver_ = new (std::nothrow) AppStateObserver(); + secCompService_->OnStart(); + ASSERT_EQ(ServiceRunningState::STATE_RUNNING, secCompService_->state_); + + secCompService_->OnStop(); + ASSERT_EQ(nullptr, secCompService_->appStateObserver_); +} + +/** + * @tc.name: RegisterAppStateObserver001 + * @tc.desc: Test RegisterAppStateObserver + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompServiceTest, RegisterAppStateObserver001, TestSize.Level1) +{ + // GetSystemAbilityManager get failed + secCompService_->appStateObserver_ = nullptr; + std::shared_ptr saClient = std::make_shared(); + ASSERT_NE(nullptr, saClient); + SystemAbilityManagerClient::clientInstance = saClient.get(); + EXPECT_CALL(*saClient, GetSystemAbilityManager()).WillOnce(testing::Return(nullptr)); + EXPECT_FALSE(secCompService_->RegisterAppStateObserver()); + + // GetSystemAbility get app mgr failed + secCompService_->appStateObserver_ = nullptr; + SystemAbilityManagerProxy proxy(nullptr); + EXPECT_CALL(*saClient, GetSystemAbilityManager()).WillOnce(testing::Return(&proxy)); + EXPECT_FALSE(secCompService_->RegisterAppStateObserver()); + + // RegisterApplicationStateObserver failed + secCompService_->appStateObserver_ = nullptr; + EXPECT_CALL(*saClient, GetSystemAbilityManager()).WillOnce(testing::Return(&proxy)); + MockIRemoteObject object; + EXPECT_CALL(proxy, GetSystemAbility(testing::_)).WillOnce(testing::Return(&object)); + sptr appProxy = new (std::nothrow) MockAppMgrProxy(nullptr); + MockAppMgrProxy::g_MockAppMgrProxy = appProxy; + EXPECT_CALL(*MockAppMgrProxy::g_MockAppMgrProxy, + RegisterApplicationStateObserver(testing::_, testing::_)).WillOnce(testing::Return(-1)); + EXPECT_FALSE(secCompService_->RegisterAppStateObserver()); + + // GetForegroundApplications failed + secCompService_->appStateObserver_ = nullptr; + EXPECT_CALL(*saClient, GetSystemAbilityManager()).WillOnce(testing::Return(&proxy)); + EXPECT_CALL(proxy, GetSystemAbility(testing::_)).WillOnce(testing::Return(&object)); + EXPECT_CALL(*MockAppMgrProxy::g_MockAppMgrProxy, + RegisterApplicationStateObserver(testing::_, testing::_)).WillOnce(testing::Return(0)); + EXPECT_CALL(*MockAppMgrProxy::g_MockAppMgrProxy, + GetForegroundApplications(testing::_)).WillOnce(testing::Return(-1)); + EXPECT_TRUE(secCompService_->RegisterAppStateObserver()); + EXPECT_EQ(static_cast(0), secCompService_->appStateObserver_->foregrandProcList_.size()); + + // get one foreground app + secCompService_->appStateObserver_ = nullptr; + EXPECT_CALL(*saClient, GetSystemAbilityManager()).WillOnce(testing::Return(&proxy)); + EXPECT_CALL(proxy, GetSystemAbility(testing::_)).WillOnce(testing::Return(&object)); + EXPECT_CALL(*MockAppMgrProxy::g_MockAppMgrProxy, + RegisterApplicationStateObserver(testing::_, testing::_)).WillOnce(testing::Return(0)); + EXPECT_CALL(*MockAppMgrProxy::g_MockAppMgrProxy, GetForegroundApplications(testing::_)) + .WillOnce([](std::vector& list) { + AppExecFwk::AppStateData data; + data.uid = 1000; + list.emplace_back(data); + return 0; + }); + EXPECT_TRUE(secCompService_->RegisterAppStateObserver()); + EXPECT_EQ(static_cast(1), secCompService_->appStateObserver_->foregrandProcList_.size()); + secCompService_->UnregisterAppStateObserver(); + SystemAbilityManagerClient::clientInstance = nullptr; +} + +/** + * @tc.name: UnregisterAppStateObserver001 + * @tc.desc: Test RegisterAppStateObserver + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompServiceTest, UnregisterAppStateObserver001, TestSize.Level1) +{ + // GetSystemAbilityManager get failed + secCompService_->appStateObserver_ = nullptr; + sptr appProxy = new (std::nothrow) MockAppMgrProxy(nullptr); + secCompService_->iAppMgr_ = appProxy; + + EXPECT_CALL(*appProxy, UnregisterApplicationStateObserver(testing::_)).Times(testing::Exactly(0)); + secCompService_->UnregisterAppStateObserver(); +} + +/** + * @tc.name: GetCallerInfo001 + * @tc.desc: Test get caller info + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompServiceTest, GetCallerInfo001, TestSize.Level1) +{ + // not root uid + setuid(1); + SecCompCallerInfo caller; + EXPECT_FALSE(secCompService_->GetCallerInfo(caller)); + + // set token id to hap token, but uid is not in foreground + EXPECT_FALSE(secCompService_->GetCallerInfo(caller)); + setuid(0); + ASSERT_EQ(0, SetSelfTokenID(HAP_TOKEN_ID)); + // add local uid to foreground. + AppExecFwk::AppStateData stateData = { + .uid = getuid() + }; + secCompService_->appStateObserver_->AddProcessToForegroundSet(stateData); + EXPECT_TRUE(secCompService_->GetCallerInfo(caller)); +} + +/** + * @tc.name: UnregisterSecurityComponent001 + * @tc.desc: Test unregister security component + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompServiceTest, UnregisterSecurityComponent001, TestSize.Level1) +{ + // get caller fail + EXPECT_EQ(SC_SERVICE_ERROR_COMPONENT_NOT_EXIST, secCompService_->UnregisterSecurityComponent(TEST_SC_ID_1)); +} + +/** + * @tc.name: UpdateSecurityComponent001 + * @tc.desc: Test update security component + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompServiceTest, UpdateSecurityComponent001, TestSize.Level1) +{ + // get caller fail + EXPECT_EQ(SC_SERVICE_ERROR_VALUE_INVALID, secCompService_->UpdateSecurityComponent(TEST_SC_ID_1, "")); + + ASSERT_EQ(0, SetSelfTokenID(HAP_TOKEN_ID)); + AppExecFwk::AppStateData stateData = { + .uid = getuid() + }; + secCompService_->appStateObserver_->AddProcessToForegroundSet(stateData); + EXPECT_EQ(SC_SERVICE_ERROR_VALUE_INVALID, secCompService_->UpdateSecurityComponent(TEST_SC_ID_1, "{a")); +} + +/** + * @tc.name: ReportSecurityComponentClickEvent001 + * @tc.desc: Test report security component + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompServiceTest, ReportSecurityComponentClickEvent001, TestSize.Level1) +{ + auto uid = getuid(); + // get caller fail + int32_t scId; + EXPECT_EQ(SC_SERVICE_ERROR_VALUE_INVALID, + secCompService_->RegisterSecurityComponent(LOCATION_COMPONENT, "", scId)); + + nlohmann::json jsonRes; + ServiceTestCommon::BuildLocationComponentJson(jsonRes); + std::string locationInfo = jsonRes.dump(); + + // parse component json fail + ASSERT_EQ(0, SetSelfTokenID(HAP_TOKEN_ID)); + setuid(100); + AppExecFwk::AppStateData stateData = { + .uid = getuid() + }; + secCompService_->appStateObserver_->AddProcessToForegroundSet(stateData); + + EXPECT_EQ(SC_ENHANCE_ERROR_CALLBACK_NOT_EXIST, + secCompService_->RegisterSecurityComponent(LOCATION_COMPONENT, locationInfo, scId)); + uint8_t data[16] = { 0 }; + struct SecCompClickEvent touch = { + .touchX = 100, + .touchY = 100, + .timestamp = static_cast( + std::chrono::high_resolution_clock::now().time_since_epoch().count()) / TIME_CONVERSION_UNIT, + .extraInfo.data = data, + .extraInfo.dataSize = 16, + }; + EXPECT_EQ(SC_ENHANCE_ERROR_IN_MALICIOUS_LIST, + secCompService_->ReportSecurityComponentClickEvent(scId, locationInfo, touch, nullptr)); + EXPECT_EQ(SC_SERVICE_ERROR_COMPONENT_NOT_EXIST, secCompService_->UnregisterSecurityComponent(scId)); + setuid(uid); +} diff --git a/services/security_component_service/sa/test/unittest/src/sec_comp_service_test.h b/services/security_component_service/sa/test/unittest/src/sec_comp_service_test.h new file mode 100644 index 0000000..4786c06 --- /dev/null +++ b/services/security_component_service/sa/test/unittest/src/sec_comp_service_test.h @@ -0,0 +1,42 @@ +/* + * 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 SEC_COMP_SERVICE_TEST_H +#define SEC_COMP_SERVICE_TEST_H + +#include +#define private public +#include "sec_comp_service.h" +#undef private + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +class SecCompServiceTest : public testing::Test { +public: + static void SetUpTestCase(); + + static void TearDownTestCase(); + + void SetUp(); + + void TearDown(); + + sptr secCompService_ = nullptr; +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // SEC_COMP_SERVICE_TEST_H diff --git a/services/security_component_service/sa/test/unittest/src/sec_comp_stub_test.cpp b/services/security_component_service/sa/test/unittest/src/sec_comp_stub_test.cpp new file mode 100644 index 0000000..3693fb9 --- /dev/null +++ b/services/security_component_service/sa/test/unittest/src/sec_comp_stub_test.cpp @@ -0,0 +1,177 @@ +/* + * 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 "sec_comp_stub_test.h" + +#include "sec_comp_log.h" +#include "sec_comp_err.h" +#include "sec_comp_click_event_parcel.h" +#include "service_test_common.h" + +using namespace testing::ext; +using namespace OHOS; +using namespace OHOS::Security::SecurityComponent; + +namespace { +static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { + LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompStubTest"}; +} + +void SecCompStubTest::SetUpTestCase() +{} + +void SecCompStubTest::TearDownTestCase() +{} + +void SecCompStubTest::SetUp() +{ + SC_LOG_INFO(LABEL, "setup"); + if (stub_ != nullptr) { + return; + } + + stub_ = new (std::nothrow) SecCompStubMock(); + ASSERT_NE(nullptr, stub_); +} + +void SecCompStubTest::TearDown() +{ + stub_ = nullptr; +} + +/** + * @tc.name: OnRemoteRequest001 + * @tc.desc: Test on remote request + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompStubTest, OnRemoteRequest001, TestSize.Level1) +{ + MessageParcel data; + MessageParcel reply; + MessageOption option; + + data.WriteInterfaceToken(u"wrong"); + ASSERT_EQ(SC_SERVICE_ERROR_IPC_REQUEST_FAIL, stub_->OnRemoteRequest(static_cast( + SecurityComponentServiceInterfaceCode::REGISTER_SECURITY_COMPONENT), data, reply, option)); + + data.WriteInterfaceToken(u"ohos.security.ISecCompService"); + ASSERT_EQ(SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL, stub_->OnRemoteRequest(static_cast( + SecurityComponentServiceInterfaceCode::REGISTER_SECURITY_COMPONENT), data, reply, option)); + + data.WriteInterfaceToken(u"ohos.security.ISecCompService"); + ASSERT_EQ(305, stub_->OnRemoteRequest(1000, data, reply, option)); +} + +/** + * @tc.name: RegisterSecurityComponentInner001 + * @tc.desc: Test register security component + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompStubTest, RegisterSecurityComponentInner001, TestSize.Level1) +{ + MessageParcel data; + MessageParcel reply; + + ASSERT_EQ(SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL, stub_->RegisterSecurityComponentInner(data, reply)); + + data.WriteUint32(UNKNOWN_SC_TYPE); + ASSERT_EQ(SC_SERVICE_ERROR_VALUE_INVALID, stub_->RegisterSecurityComponentInner(data, reply)); + + data.WriteUint32(MAX_SC_TYPE); + ASSERT_EQ(SC_SERVICE_ERROR_VALUE_INVALID, stub_->RegisterSecurityComponentInner(data, reply)); + + data.WriteUint32(LOCATION_COMPONENT); + ASSERT_EQ(SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL, stub_->RegisterSecurityComponentInner(data, reply)); + + data.WriteUint32(LOCATION_COMPONENT); + data.WriteString(""); + ASSERT_EQ(SC_OK, stub_->RegisterSecurityComponentInner(data, reply)); +} + +/** + * @tc.name: UpdateSecurityComponentInner001 + * @tc.desc: Test update security component + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompStubTest, UpdateSecurityComponentInner001, TestSize.Level1) +{ + MessageParcel data; + MessageParcel reply; + + ASSERT_EQ(SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL, stub_->UpdateSecurityComponentInner(data, reply)); + + data.WriteInt32(-1); + ASSERT_EQ(SC_SERVICE_ERROR_VALUE_INVALID, stub_->UpdateSecurityComponentInner(data, reply)); + + data.WriteInt32(1); + ASSERT_EQ(SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL, stub_->UpdateSecurityComponentInner(data, reply)); + + data.WriteInt32(1); + data.WriteString(""); + ASSERT_EQ(SC_OK, stub_->UpdateSecurityComponentInner(data, reply)); +} + +/** + * @tc.name: UnregisterSecurityComponentInner001 + * @tc.desc: Test unregister security component + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompStubTest, UnregisterSecurityComponentInner001, TestSize.Level1) +{ + MessageParcel data; + MessageParcel reply; + ASSERT_EQ(SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL, stub_->UnregisterSecurityComponentInner(data, reply)); + + data.WriteInt32(-1); + ASSERT_EQ(SC_SERVICE_ERROR_VALUE_INVALID, stub_->UnregisterSecurityComponentInner(data, reply)); + + data.WriteInt32(1); + ASSERT_EQ(SC_OK, stub_->UnregisterSecurityComponentInner(data, reply)); +} + +/** + * @tc.name: ReportSecurityComponentClickEventInner001 + * @tc.desc: Test report click event + * @tc.type: FUNC + * @tc.require: AR000HO9J7 + */ +HWTEST_F(SecCompStubTest, ReportSecurityComponentClickEventInner001, TestSize.Level1) +{ + MessageParcel data; + MessageParcel reply; + ASSERT_EQ(SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL, stub_->ReportSecurityComponentClickEventInner(data, reply)); + + data.WriteInt32(-1); + ASSERT_EQ(SC_SERVICE_ERROR_VALUE_INVALID, stub_->ReportSecurityComponentClickEventInner(data, reply)); + + data.WriteInt32(1); + ASSERT_EQ(SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL, stub_->ReportSecurityComponentClickEventInner(data, reply)); + + data.WriteInt32(1); + data.WriteString(""); + ASSERT_EQ(SC_SERVICE_ERROR_PARCEL_OPERATE_FAIL, stub_->ReportSecurityComponentClickEventInner(data, reply)); + + data.WriteInt32(1); + data.WriteString(""); + SecCompClickEvent touchInfo; + sptr parcel = new (std::nothrow) SecCompClickEventParcel(); + parcel->touchInfoParams_ = touchInfo; + data.WriteParcelable(parcel); + ASSERT_EQ(SC_OK, stub_->ReportSecurityComponentClickEventInner(data, reply)); +} diff --git a/services/security_component_service/sa/test/unittest/src/sec_comp_stub_test.h b/services/security_component_service/sa/test/unittest/src/sec_comp_stub_test.h new file mode 100644 index 0000000..e56866c --- /dev/null +++ b/services/security_component_service/sa/test/unittest/src/sec_comp_stub_test.h @@ -0,0 +1,79 @@ +/* + * 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 SEC_COMP_STUB_TEST_H +#define SEC_COMP_STUB_TEST_H + +#include +#define private public +#include "sec_comp_stub.h" +#undef private + +namespace OHOS { +namespace Security { +namespace SecurityComponent { + +// stub is abstract class +struct SecCompStubMock : public SecCompStub { +public: + int32_t RegisterSecurityComponent(SecCompType type, + const std::string& componentInfo, int32_t& scId) override + { + return 0; + }; + + int32_t UpdateSecurityComponent(int32_t scId, const std::string& componentInfo) override + { + return 0; + }; + + int32_t UnregisterSecurityComponent(int32_t scId) override + { + return 0; + }; + + int32_t ReportSecurityComponentClickEvent(int32_t scId, const std::string& componentInfo, + const SecCompClickEvent& touchInfo, sptr callerToken) override + { + return 0; + }; + + bool ReduceAfterVerifySavePermission(AccessToken::AccessTokenID tokenId) override + { + return true; + } + + sptr GetEnhanceRemoteObject() override + { + return nullptr; + } +}; + +class SecCompStubTest : public testing::Test { +public: + static void SetUpTestCase(); + + static void TearDownTestCase(); + + void SetUp(); + + void TearDown(); + + sptr stub_ = nullptr; +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // SEC_COMP_STUB_TEST_H diff --git a/services/security_component_service/sa/test/unittest/src/service_test_common.cpp b/services/security_component_service/sa/test/unittest/src/service_test_common.cpp new file mode 100644 index 0000000..1b159a1 --- /dev/null +++ b/services/security_component_service/sa/test/unittest/src/service_test_common.cpp @@ -0,0 +1,168 @@ +/* + * 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 "service_test_common.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +void ServiceTestCommon::BuildLocationComponentJson(nlohmann::json& jsonComponent) +{ + jsonComponent[JsonTagConstants::JSON_SC_TYPE] = LOCATION_COMPONENT; + jsonComponent[JsonTagConstants::JSON_NODE_ID] = 0; + jsonComponent[JsonTagConstants::JSON_RECT] = nlohmann::json { + {JsonTagConstants::JSON_RECT_X, TEST_COORDINATE }, + {JsonTagConstants::JSON_RECT_Y, TEST_COORDINATE }, + {JsonTagConstants::JSON_RECT_WIDTH, TEST_COORDINATE }, + {JsonTagConstants::JSON_RECT_HEIGHT, TEST_COORDINATE } + }; + jsonComponent[JsonTagConstants::JSON_WINDOW_RECT] = nlohmann::json { + { JsonTagConstants::JSON_RECT_X, TEST_COORDINATE }, + { JsonTagConstants::JSON_RECT_Y, TEST_COORDINATE }, + { JsonTagConstants::JSON_RECT_WIDTH, TEST_COORDINATE }, + { JsonTagConstants::JSON_RECT_HEIGHT, TEST_COORDINATE } + }; + nlohmann::json jsonPadding = nlohmann::json { + { JsonTagConstants::JSON_PADDING_TOP_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_RIGHT_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_LEFT_TAG, TEST_DIMENSION }, + }; + + jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, + }; + + jsonComponent[JsonTagConstants::JSON_COLORS_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_COLOR_TAG, TEST_COLOR_RED }, + { JsonTagConstants::JSON_ICON_COLOR_TAG, TEST_COLOR_BLUE }, + { JsonTagConstants::JSON_BG_COLOR_TAG, TEST_COLOR_YELLOW } + }; + + jsonComponent[JsonTagConstants::JSON_BORDER_TAG] = nlohmann::json { + { JsonTagConstants::JSON_BORDER_WIDTH_TAG, TEST_SIZE }, + }; + jsonComponent[JsonTagConstants::JSON_PARENT_TAG] = nlohmann::json { + { JsonTagConstants::JSON_PARENT_EFFECT_TAG, false }, + }; + jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_TEXT_TAG, LocationDesc::SELECT_LOCATION }, + { JsonTagConstants::JSON_ICON_TAG, LocationIcon::LINE_ICON }, + { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, + }; +} + +void ServiceTestCommon::BuildSaveComponentJson(nlohmann::json& jsonComponent) +{ + jsonComponent[JsonTagConstants::JSON_SC_TYPE] = SAVE_COMPONENT; + jsonComponent[JsonTagConstants::JSON_NODE_ID] = 0; + jsonComponent[JsonTagConstants::JSON_RECT] = nlohmann::json { + {JsonTagConstants::JSON_RECT_X, TEST_COORDINATE }, + {JsonTagConstants::JSON_RECT_Y, TEST_COORDINATE }, + {JsonTagConstants::JSON_RECT_WIDTH, TEST_COORDINATE }, + {JsonTagConstants::JSON_RECT_HEIGHT, TEST_COORDINATE } + }; + jsonComponent[JsonTagConstants::JSON_WINDOW_RECT] = nlohmann::json { + {JsonTagConstants::JSON_RECT_X, TEST_COORDINATE }, + {JsonTagConstants::JSON_RECT_Y, TEST_COORDINATE }, + {JsonTagConstants::JSON_RECT_WIDTH, TEST_COORDINATE }, + {JsonTagConstants::JSON_RECT_HEIGHT, TEST_COORDINATE } + }; + nlohmann::json jsonPadding = nlohmann::json { + { JsonTagConstants::JSON_PADDING_TOP_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_RIGHT_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_LEFT_TAG, TEST_DIMENSION }, + }; + + jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, + }; + + jsonComponent[JsonTagConstants::JSON_COLORS_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_COLOR_TAG, TEST_COLOR_RED }, + { JsonTagConstants::JSON_ICON_COLOR_TAG, TEST_COLOR_BLUE }, + { JsonTagConstants::JSON_BG_COLOR_TAG, TEST_COLOR_YELLOW } + }; + + jsonComponent[JsonTagConstants::JSON_BORDER_TAG] = nlohmann::json { + { JsonTagConstants::JSON_BORDER_WIDTH_TAG, TEST_SIZE }, + }; + jsonComponent[JsonTagConstants::JSON_PARENT_TAG] = nlohmann::json { + { JsonTagConstants::JSON_PARENT_EFFECT_TAG, false }, + }; + jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_TEXT_TAG, SaveDesc::DOWNLOAD }, + { JsonTagConstants::JSON_ICON_TAG, SaveIcon::LINE_ICON }, + { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, + }; +} + +void ServiceTestCommon::BuildPasteComponentJson(nlohmann::json& jsonComponent) +{ + jsonComponent[JsonTagConstants::JSON_SC_TYPE] = PASTE_COMPONENT; + jsonComponent[JsonTagConstants::JSON_NODE_ID] = 0; + jsonComponent[JsonTagConstants::JSON_RECT] = nlohmann::json { + {JsonTagConstants::JSON_RECT_X, TEST_COORDINATE }, + {JsonTagConstants::JSON_RECT_Y, TEST_COORDINATE }, + {JsonTagConstants::JSON_RECT_WIDTH, TEST_COORDINATE }, + {JsonTagConstants::JSON_RECT_HEIGHT, TEST_COORDINATE } + }; + jsonComponent[JsonTagConstants::JSON_WINDOW_RECT] = nlohmann::json { + {JsonTagConstants::JSON_RECT_X, TEST_COORDINATE }, + {JsonTagConstants::JSON_RECT_Y, TEST_COORDINATE }, + {JsonTagConstants::JSON_RECT_WIDTH, TEST_COORDINATE }, + {JsonTagConstants::JSON_RECT_HEIGHT, TEST_COORDINATE } + }; + nlohmann::json jsonPadding = nlohmann::json { + { JsonTagConstants::JSON_PADDING_TOP_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_RIGHT_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_BOTTOM_TAG, TEST_DIMENSION }, + { JsonTagConstants::JSON_PADDING_LEFT_TAG, TEST_DIMENSION }, + }; + + jsonComponent[JsonTagConstants::JSON_SIZE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_ICON_SIZE_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_TEXT_ICON_PADDING_TAG, TEST_SIZE }, + { JsonTagConstants::JSON_PADDING_SIZE_TAG, jsonPadding }, + }; + + jsonComponent[JsonTagConstants::JSON_COLORS_TAG] = nlohmann::json { + { JsonTagConstants::JSON_FONT_COLOR_TAG, TEST_COLOR_RED }, + { JsonTagConstants::JSON_ICON_COLOR_TAG, TEST_COLOR_BLUE }, + { JsonTagConstants::JSON_BG_COLOR_TAG, TEST_COLOR_YELLOW } + }; + + jsonComponent[JsonTagConstants::JSON_BORDER_TAG] = nlohmann::json { + { JsonTagConstants::JSON_BORDER_WIDTH_TAG, TEST_SIZE }, + }; + jsonComponent[JsonTagConstants::JSON_PARENT_TAG] = nlohmann::json { + { JsonTagConstants::JSON_PARENT_EFFECT_TAG, false }, + }; + jsonComponent[JsonTagConstants::JSON_STYLE_TAG] = nlohmann::json { + { JsonTagConstants::JSON_TEXT_TAG, PasteDesc::PASTE }, + { JsonTagConstants::JSON_ICON_TAG, PasteIcon::LINE_ICON }, + { JsonTagConstants::JSON_BG_TAG, SecCompBackground::CIRCLE }, + }; +} +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS diff --git a/services/security_component_service/sa/test/unittest/src/service_test_common.h b/services/security_component_service/sa/test/unittest/src/service_test_common.h new file mode 100644 index 0000000..26368f4 --- /dev/null +++ b/services/security_component_service/sa/test/unittest/src/service_test_common.h @@ -0,0 +1,66 @@ +/* + * 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 SERVICE_TEST_COMMON_H +#define SERVICE_TEST_COMMON_H +#include "location_button.h" +#include "paste_button.h" +#include "save_button.h" + +namespace OHOS { +namespace Security { +namespace SecurityComponent { +constexpr int32_t TEST_UID_1 = 1; +constexpr int32_t TEST_UID_2 = 2; +constexpr int32_t TEST_PID_1 = 1; +constexpr int32_t TEST_PID_2 = 2; +constexpr int32_t TEST_PID_3 = 3; +constexpr int32_t TEST_SC_ID_1 = 1; +constexpr int32_t TEST_SC_ID_2 = 2; +constexpr int32_t TEST_INVALID_SC_ID = -1; +constexpr int32_t SC_ID_START = 1000; +constexpr int32_t SA_ID = 3506; + +constexpr float TEST_SIZE = 100.0; +constexpr double TEST_COORDINATE = 100.0; +constexpr double TEST_DIFF_COORDINATE = 200.0; +constexpr double TEST_DIMENSION = 100.0; +constexpr double TEST_INVALID_DIMENSION = -100.0; +constexpr double ZERO_OFFSET = 0.0F; +constexpr uint32_t TEST_INVALID_SIZE = 0; +constexpr uint32_t QUARTER = 4; + +constexpr uint32_t TEST_COLOR_INVALID = 0x66000000; +constexpr uint32_t TEST_COLOR_BLACK = 0x00000000; +constexpr uint32_t TEST_COLOR_WHITE = 0xffffffff; +constexpr uint32_t TEST_COLOR_YELLOW = 0xff7fff00; +constexpr uint32_t TEST_COLOR_RED = 0xffff0000; +constexpr uint32_t TEST_COLOR_BLUE = 0xff0000ff; + +constexpr uint64_t TIME_CONVERSION_UNIT = 1000; +constexpr uint32_t MAX_INT_NUM = 0x7fffffff; +constexpr uint32_t HAP_TOKEN_ID = 537715419; +constexpr uint32_t TEST_TOKEN_ID = 1; +constexpr uint32_t MAX_HMAC_SIZE = 64; + +class ServiceTestCommon { +public: + static void BuildLocationComponentJson(nlohmann::json& jsonComponent); + static void BuildSaveComponentJson(nlohmann::json& jsonComponent); + static void BuildPasteComponentJson(nlohmann::json& jsonComponent); +}; +} // namespace SecurityComponent +} // namespace Security +} // namespace OHOS +#endif // SERVICE_TEST_COMMON_H diff --git a/docs/Readme-CN.md b/test/dts/README_zh.md similarity index 55% rename from docs/Readme-CN.md rename to test/dts/README_zh.md index 4d76dca..bd54370 100644 --- a/docs/Readme-CN.md +++ b/test/dts/README_zh.md @@ -1,24 +1,18 @@ # 安全控件管理服务 - ## 简介 安全控件是OpenHarmony提供的一组系统实现的ArkUI基础组件。当用户点击了这类组件后,应用将被授予临时授权,应用开发者仅需要像使用Button等组件那样集成到应用自己的页面即可。 - 安全控件管理服务主要提供如下功能: -- 提供应用安全控件的注册、临时授权、取消注册等Native接口实现。 - -- 负责安全控件的合法性检查,只有合法的安全控件才能授权成功。 - -- 提供其他SA查询临时授权的Native接口实现。 - -- 提供安全增强相关接口及适配层,供厂商定制安全增强功能使用。 - +- 提供应用安全控件的注册、临时授权、取消注册等Native接口实现。 +- 负责安全控件的合法性检查,只有合法的安全控件才能授权成功。 +- 提供其他SA查询临时授权的Native接口实现。提供安全增强相关接口及适配层,供厂商定制安全增强功能使用。 ## 目录 ``` +/base/security/security_component ├── frameworks # 框架层,基础功能代码存放目录 │ ├── common # 框架公共代码存放目录 │ ├── enhance_adapter # 能力增强适配代码存放目录 @@ -30,27 +24,24 @@ └── services # 服务层 └── security_component_service/sa └── sa_main # 安全控件服务侧代码存放目录 -``` +``` ## 使用 - - ### 接口说明 -| 定义 | 说明 | -| -------- | -------- | -| int32_t RegisterSecurityComponent(SecCompType type, const std::string& componentInfo, int32_t& scId); | 注册安全控件 | -| int32_t UpdateSecurityComponent(int32_t scId, const std::string& componentInfo); | 更新安全控件信息 | -| int32_t UnregisterSecurityComponent(int32_t scId); | 取消注册安全控件 | -| int32_t ReportSecurityComponentClickEvent(int32_t scId, const std::string& componentInfo, const SecCompClickEvent& touchInfo); | 上报点击事件,申请临时授权 | -| int32_t SetEnhanceCfg(SecCompEnhanceCfgBase\* cfg); | 设置安全控件增强的配置,供多模服务使用 | -| int32_t GetPointerEventEnhanceData(void\* data, uint32_t dataLen, uint8_t\* enhanceData, uint32_t& enHancedataLen); | 获取点击事件的安全增强数据,供多模服务使用 | -| bool ReduceAfterVerifySavePermission(AccessToken::AccessTokenID tokenId); | 校验后取消保存控件权限 | - +| **接口申明** | **接口描述** | +| --- | --- | +| int32_t RegisterSecurityComponent(SecCompType type, const std::string& componentInfo, int32_t& scId); | 注册安全控件 | +| int32_t UpdateSecurityComponent(int32_t scId, const std::string& componentInfo); | 更新安全控件信息 | +| int32_t UnregisterSecurityComponent(int32_t scId); | 取消注册安全控件 | +| int32_t ReportSecurityComponentClickEvent(int32_t scId, const std::string& componentInfo, const SecCompClickEvent& touchInfo); | 上报点击事件,申请临时授权 | +| int32_t SetEnhanceCfg(SecCompEnhanceCfgBase* cfg); | 设置安全控件增强的配置,供多模服务使用 | +| int32_t GetPointerEventEnhanceData(void* data, uint32_t dataLen, uint8_t* enhanceData, uint32_t& enHancedataLen); | 获取点击事件的安全增强数据,供多模服务使用 | +| bool ReduceAfterVerifySavePermission(AccessToken::AccessTokenID tokenId); | 校验后取消保存控件权限 | ## 相关仓 -**[arkui_ace_engine]** +**[arkui\_ace\_engine](https://gitee.com/openharmony/arkui_ace_engine/blob/master/README_zh.md)** -**[multimodalinput_input]** +**[multimodalinput\_input](https://gitee.com/openharmony/multimodalinput_input/blob/master/README_zh.md)** diff --git a/test/dts/location_button.d.ts b/test/dts/location_button.d.ts new file mode 100644 index 0000000..1f0deaf --- /dev/null +++ b/test/dts/location_button.d.ts @@ -0,0 +1,263 @@ +/* + * 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. + */ + +/** + * Enumerates the icon styles. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +declare enum LocationIconStyle { + /** + * Icon filled with the specified color. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + FULL_FILLED = 0, + + /** + * Icon rendered as lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + LINES = 1 +} + +/** + * Enumerates the text that can be displayed on the location button. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +declare enum LocationDescription { + /** + * Current Location + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + CURRENT_LOCATION = 0, + + /** + * Add Location + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + ADD_LOCATION = 1, + + /** + * Select Location + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + SELECT_LOCATION = 2, + + /** + * Share Location + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + SHARE_LOCATION = 3, + + /** + * Send Location + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + SEND_LOCATION = 4, + + /** + * Locating + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + LOCATING = 5, + + /** + * Location + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + LOCATION = 6, + + /** + * Send Current Location + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + SEND_CURRENT_LOCATION = 7, + + /** + * Relocation + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + RELOCATION = 8, + + /** + * Punch In + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + PUNCH_IN = 9, + + /** + * Current Position + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + CURRENT_POSITION = 10 +} + +/** + * Declares the interface for setting the location button options. + * + * @interface LocationButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +declare interface LocationButtonOptions { + /** + * Style of the icon to be drawn. + * + * @type { ?LocationIconStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + icon?: LocationIconStyle; + + /** + * Text to be displayed on the button. + * + * @type { ?LocationDescription } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + text?: LocationDescription; + + /** + * Type of the button. + * + * @type { ?ButtonType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + buttonType?: ButtonType; +} + +/** + * Enumerates the click event results of the location button. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +declare enum LocationButtonOnClickResult { + /** + * Success. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + SUCCESS = 0, + + /** + * Failure because the application is not temporarily authorized for accessing location data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + TEMPORARY_AUTHORIZATION_FAILED = 1 +} + +/** + * Defines the interface for setting a location button. + * + * @interface LocationButtonInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +interface LocationButtonInterface { + /** + * Creates a location button. + * + * @returns { LocationButtonAttribute } TReturns the attribute of the location button. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + (): LocationButtonAttribute; + + /** + * Creates a location button with the specified composition. + * If an attribute is not set, the corresponding element will not be drawn. + * + * @param { LocationButtonOptions } options - Indicates the options of the location button. + * @returns { LocationButtonAttribute } Returns the attribute of the location button. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + (options: LocationButtonOptions): LocationButtonAttribute; +} + +/** + * Defines the attributes of the location button. + * + * @extends SecurityComponentMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +declare class LocationButtonAttribute extends SecurityComponentMethod { + /** + * Called when the location button is clicked. + * + * @param { (event: ClickEvent, result: LocationButtonOnClickResult) => void } event - Indicates the + * click event result. + * @returns { LocationButtonAttribute } Returns the attribute of the location button. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + onClick(event: (event: ClickEvent, result: LocationButtonOnClickResult) => void): LocationButtonAttribute; +} + +/** + * Defines a button that interacts with the security component service to + * request the authorization for accessing location data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +declare const LocationButton: LocationButtonInterface; + +/** + * Defines a location button instance for secure access. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +declare const LocationButtonInstance: LocationButtonAttribute; diff --git a/test/dts/paste_button.d.ts b/test/dts/paste_button.d.ts new file mode 100644 index 0000000..50c06eb --- /dev/null +++ b/test/dts/paste_button.d.ts @@ -0,0 +1,175 @@ +/* + * 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. + */ + +/** + * Enumerates the icon styles. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +declare enum PasteIconStyle { + /** + * Icon rendered as lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + LINES = 0 +} + +/** + * Enumerates the text that can be displayed on the paste button. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +declare enum PasteDescription { + /** + * Paste + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + PASTE = 0 +} + +/** + * Declares the interface for setting the paste button options. + * + * @interface PasteButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +declare interface PasteButtonOptions { + /** + * Style of the icon to be drawn. + * + * @type { ?PasteIconStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + icon?: PasteIconStyle; + + /** + * Text to be displayed on the button. + * + * @type { ?PasteDescription } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + text?: PasteDescription; + + /** + * Type of the button. + * + * @type { ?ButtonType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + buttonType?: ButtonType; +} + +/** + * Enumerates the click event results of the paste button. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +declare enum PasteButtonOnClickResult { + /** + * Success. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + SUCCESS = 0, + + /** + * Failure because the application is not temporarily authorized for accessing the current pasteboard data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + TEMPORARY_AUTHORIZATION_FAILED = 1 +} + +/** + * Defines the interface for setting a paste button. + * + * @interface PasteButtonInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +interface PasteButtonInterface { + /** + * Creates a paste button. + * + * @returns { PasteButtonAttribute } Returns the attribute of the paste button. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + (): PasteButtonAttribute; + + /** + * Creates a paste button with the specified composition. + * If an attribute is not set, the corresponding element will not be drawn. + * + * @param { PasteButtonOptions } options - Indicates the options of the paste button. + * @returns { PasteButtonAttribute } Returns the attribute of the paste button. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + (options: PasteButtonOptions): PasteButtonAttribute; +} + +/** + * Defines the attributes of the paste button. + * + * @extends SecurityComponentMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +declare class PasteButtonAttribute extends SecurityComponentMethod { + /** + * Called when the paste button is clicked. + * + * @param { (event: ClickEvent, result: PasteButtonOnClickResult) => void } event - Indicates the + * click event result. + * @returns { PasteButtonAttribute } Returns the attribute of the paste button. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + onClick(event: (event: ClickEvent, result: PasteButtonOnClickResult) => void): PasteButtonAttribute; +} + +/** + * Defines a button that interacts with the security component service to + * request the permission for accessing the current pasteboard data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +declare const PasteButton: PasteButtonInterface; + +/** + * Defines a paste button instance for secure access. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +declare const PasteButtonInstance: PasteButtonAttribute; diff --git a/test/dts/save_button.d.ts b/test/dts/save_button.d.ts new file mode 100644 index 0000000..61addc9 --- /dev/null +++ b/test/dts/save_button.d.ts @@ -0,0 +1,239 @@ +/* + * 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. + */ + +/** + * Enumerates the icon styles. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +declare enum SaveIconStyle { + /** + * Icon filled with the specified color. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + FULL_FILLED = 0, + + /** + * Icon rendered as lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + LINES = 1 +} + +/** + * Enumerates the text that can be displayed on the save button. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +declare enum SaveDescription { + /** + * Download + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + DOWNLOAD = 0, + + /** + * Download File + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + DOWNLOAD_FILE = 1, + + /** + * Save + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + SAVE = 2, + + /** + * Save Image + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + SAVE_IMAGE = 3, + + /** + * Save File + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + SAVE_FILE = 4, + + /** + * Download and Share + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + DOWNLOAD_AND_SHARE = 5, + + /** + * Receive + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + RECEIVE = 6, + + /** + * Continue to Receive + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + CONTINUE_TO_RECEIVE = 7 +} + +/** + * Declares the interface for setting the save button options. + * + * @interface SaveButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +declare interface SaveButtonOptions { + /** + * Style of the icon to be drawn. + * + * @type { ?SaveIconStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + icon?: SaveIconStyle; + + /** + * Text to be displayed on the button. + * + * @type { ?SaveDescription } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + text?: SaveDescription; + + /** + * Type of the button. + * + * @type { ?ButtonType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + buttonType?: ButtonType; +} + +/** + * Enumerates the click event results of the save button. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +declare enum SaveButtonOnClickResult { + /** + * Success. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + SUCCESS = 0, + + /** + * Failure because the application is not temporarily authorized for saving files. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + TEMPORARY_AUTHORIZATION_FAILED = 1 +} + +/** + * Defines the interface for setting a save button. + * + * @interface SaveButtonInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +interface SaveButtonInterface { + /** + * Creates a save button. + * + * @returns { SaveButtonAttribute } Returns the attribute of the save button. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + (): SaveButtonAttribute; + + /** + * Creates a save button with the specified composition. + * If an attribute is not set, the corresponding element will not be drawn. + * + * @param { SaveButtonOptions } options - Indicates the options of the save button. + * @returns { SaveButtonAttribute } Returns the attribute of the save button. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + (options: SaveButtonOptions): SaveButtonAttribute; +} + +/** + * Defines the attributes of the save button. + * + * @extends SecurityComponentMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +declare class SaveButtonAttribute extends SecurityComponentMethod { + /** + * Called when the save button is clicked. + * + * @param { (event: ClickEvent, result: SaveButtonOnClickResult) => void } event - Indicates the + * click event result. + * @returns { SaveButtonAttribute } Returns the attribute of the save button. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + onClick(event: (event: ClickEvent, result: SaveButtonOnClickResult) => void): SaveButtonAttribute; +} + +/** + * Defines a button that interacts with the security component service to + * request the permission for saving files in the media library. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +declare const SaveButton: SaveButtonInterface; + +/** + * Defines a save button instance for secure access. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +declare const SaveButtonInstance: SaveButtonAttribute; diff --git a/test/dts/security_component.d.ts b/test/dts/security_component.d.ts new file mode 100644 index 0000000..8cac844 --- /dev/null +++ b/test/dts/security_component.d.ts @@ -0,0 +1,242 @@ +/* + * 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. + */ + +/** + * Enumerates the layout direction of the icon and text. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +declare enum SecurityComponentLayoutDirection { + /** + * Horizontal layout. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + HORIZONTAL = 0, + + /** + * Vertical layout. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + VERTICAL = 1 +} + +/** + * Defines the method of a security component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +declare class SecurityComponentMethod { + /** + * Icon size. + * + * @param { Dimension } value - Indicates the size of the icon. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + iconSize(value: Dimension): T; + + /** + * Layout direction of the icon and text. + * + * @param { SecurityComponentLayoutDirection } value - Indicates the layout direction of the icon and text. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + layoutDirection(value: SecurityComponentLayoutDirection): T; + + /** + * Position of the security component. + * + * @param { Position } value - Indicates the position of the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + position(value: Position): T; + + /** + * Anchor of the security component for positioning. The top start edge of the component is used as + * the reference point for offset. + * + * @param { Position } value - Indicates the anchor of the component when it is positioned. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + markAnchor(value: Position): T; + + /** + * Coordinate offset relative to the layout position. + * Setting this attribute does not affect the layout of the parent container. + * The position is adjusted only during drawing. + * + * @param { Position } value - Indicates the offset value. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + offset(value: Position): T; + + /** + * Font size of the inner text. + * + * @param { Dimension } value - Indicates the font size of the text in the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + fontSize(value: Dimension): T; + + /** + * Font style of the inner text. + * + * @param { FontStyle } value - Indicates the font style of the text in the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + fontStyle(value: FontStyle): T; + + /** + * Font weight of the inner text. + * + * @param { number | FontWeight | string } value - Indicates the font weight of the text in the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + fontWeight(value: number | FontWeight | string): T; + + /** + * Font family of the inner text. + * + * @param { string | Resource } value - Indicates the font family of the text in the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + fontFamily(value: string | Resource): T; + + /** + * Font color of the inner text. + * + * @param { ResourceColor } value - Indicates the font color of the text in the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + fontColor(value: ResourceColor): T; + + /** + * Color of the icon. + * + * @param { ResourceColor } value - Indicates the icon color in the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + iconColor(value: ResourceColor): T; + + /** + * Background color. + * + * @param { ResourceColor } value - Indicates the background color of the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + backgroundColor(value: ResourceColor): T; + + /** + * Style of the border. + * + * @param { BorderStyle } value - Indicates the border style of the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + borderStyle(value: BorderStyle): T; + + /** + * Width of the border. + * + * @param { Dimension } value - Indicates the border width of the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + borderWidth(value: Dimension): T; + + /** + * Color of the border. + * + * @param { ResourceColor } value - Indicates the border color of the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + borderColor(value: ResourceColor): T; + + /** + * Radius of the border. + * + * @param { Dimension } value - Indicates the border radius of the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + borderRadius(value: Dimension): T; + + /** + * Padding between the background border and icon/inner text. + * + * @param { Padding | Dimension } value - Indicates the padding of the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + padding(value: Padding | Dimension): T; + + /** + * Space between the inner text and icon. + * + * @param { Dimension } value - Indicates the space between the inner text and icon. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + textIconSpace(value: Dimension): T; + + /** + * Key. User can set an key to the component to identify it. + * + * @param { string } value - identify the key of the component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + * @test + */ + key(value: string): T; +} diff --git a/test/fuzztest/security_component/BUILD.gn b/test/fuzztest/security_component/BUILD.gn new file mode 100644 index 0000000..8d2c433 --- /dev/null +++ b/test/fuzztest/security_component/BUILD.gn @@ -0,0 +1,34 @@ +# 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. + +group("fuzztest") { + testonly = true + deps = [] + + deps += [ + "getenhanceremoteobjectInner_fuzzer:GetEnhanceRemoteObjectInnerFuzzTest", + "getenhanceremoteobject_fuzzer:GetEnhanceRemoteObjectFuzzTest", + "getpointereventenhancedata_fuzzer:GetPointerEventEnhanceDataFuzzTest", + "reduceafterverifysavepermissionInner_fuzzer:ReduceAfterVerifySavePermissionInnerFuzzTest", + "reduceafterverifysavepermission_fuzzer:ReduceAfterVerifySavePermissionFuzzTest", + "registersecuritycomponentInner_fuzzer:RegisterSecurityComponentInnerFuzzTest", + "registersecuritycomponent_fuzzer:RegisterSecurityComponentFuzzTest", + "reportsecuritycomponentclickeventInner_fuzzer:ReportSecurityComponentClickEventInnerFuzzTest", + "reportsecuritycomponentclickevent_fuzzer:ReportSecurityComponentClickEventFuzzTest", + "setenhancecfg_fuzzer:SetEnhanceCfgFuzzTest", + "unregistersecuritycomponentInner_fuzzer:UnregisterSecurityComponentInnerFuzzTest", + "unregistersecuritycomponent_fuzzer:UnregisterSecurityComponentFuzzTest", + "updatesecuritycomponentInner_fuzzer:UpdateSecurityComponentInnerFuzzTest", + "updatesecuritycomponent_fuzzer:UpdateSecurityComponentFuzzTest", + ] +} diff --git a/test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/BUILD.gn b/test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/BUILD.gn new file mode 100644 index 0000000..68d43fe --- /dev/null +++ b/test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/BUILD.gn @@ -0,0 +1,49 @@ +# 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("//build/config/features.gni") +import("//build/test.gni") +import("../../../../security_component.gni") + +module_output_path = "security_component/security_component" + +ohos_fuzztest("GetEnhanceRemoteObjectInnerFuzzTest") { + module_out_path = module_output_path + fuzz_config_file = "${sec_comp_dir}/test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer" + + include_dirs = [ + "${sec_comp_dir}/frameworks/common/include", + "${sec_comp_dir}/services/security_component_service/sa/sa_main", + ] + cflags = [ + "-g", + "-O0", + "-Wno-unused-variable", + "-fno-omit-frame-pointer", + ] + configs = [ "${sec_comp_dir}/config:coverage_flags" ] + + cflags_cc = [ "-DHILOG_ENABLE" ] + sources = [ "getenhanceremoteobjectInner_fuzzer.cpp" ] + + deps = [ "${sec_comp_dir}/services/security_component_service/sa:security_component_service" ] + + external_deps = [ + "ability_runtime:app_manager", + "access_token:libaccesstoken_sdk", + "access_token:libtoken_setproc", + "c_utils:utils", + "hilog:libhilog", + "ipc:ipc_core", + ] +} diff --git a/test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/corpus/init b/test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/corpus/init new file mode 100644 index 0000000..bc977bd --- /dev/null +++ b/test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/corpus/init @@ -0,0 +1,14 @@ +# 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. + +FUZZ \ No newline at end of file diff --git a/test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/getenhanceremoteobjectInner_fuzzer.cpp b/test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/getenhanceremoteobjectInner_fuzzer.cpp new file mode 100644 index 0000000..48d375e --- /dev/null +++ b/test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/getenhanceremoteobjectInner_fuzzer.cpp @@ -0,0 +1,49 @@ +/* + * 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. + */ + + +#include +#include +#include +#include +#include "accesstoken_kit.h" +#include "securec.h" +#include "token_setproc.h" +#include "getenhanceremoteobjectInner_fuzzer.h" + +using namespace OHOS::Security::SecurityComponent; +using namespace OHOS::Security::AccessToken; +namespace OHOS { +static void GetEnhanceRemoteObjectInnerFuzzTest(const uint8_t *data, size_t size) +{ + uint32_t code = SecurityComponentServiceInterfaceCode::GET_SECURITY_COMPONENT_ENHANCE_OBJECT; + MessageParcel datas; + datas.WriteInterfaceToken(u"ohos.security.ISecCompService"); + datas.WriteBuffer(data, size); + datas.RewindRead(0); + MessageParcel reply; + MessageOption option; + auto service = std::make_shared(SA_ID_SECURITY_COMPONENT_SERVICE, true); + service->OnRemoteRequest(code, datas, reply, option); +} +} // namespace OHOS + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) +{ + /* Run your code on data */ + OHOS::GetEnhanceRemoteObjectInnerFuzzTest(data, size); + return 0; +} diff --git a/test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/getenhanceremoteobjectInner_fuzzer.h b/test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/getenhanceremoteobjectInner_fuzzer.h new file mode 100644 index 0000000..a3ec5aa --- /dev/null +++ b/test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/getenhanceremoteobjectInner_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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. + */ + +#ifndef GET_ENHANCE_REMOTE_OBJECT_INNER_FUZZER_H +#define GET_ENHANCE_REMOTE_OBJECT_INNER_FUZZER_H + +#define FUZZ_PROJECT_NAME "securitycomponent_fuzzer" + +#include "sec_comp_stub.h" +#include "sec_comp_service.h" + +#endif diff --git a/test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/project.xml b/test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/project.xml new file mode 100644 index 0000000..6e8ad2c --- /dev/null +++ b/test/fuzztest/security_component/getenhanceremoteobjectInner_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 1000 + + 300 + + 4096 + + diff --git a/test/fuzztest/security_component/getenhanceremoteobject_fuzzer/BUILD.gn b/test/fuzztest/security_component/getenhanceremoteobject_fuzzer/BUILD.gn new file mode 100644 index 0000000..d0a5c65 --- /dev/null +++ b/test/fuzztest/security_component/getenhanceremoteobject_fuzzer/BUILD.gn @@ -0,0 +1,48 @@ +# 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("//build/config/features.gni") +import("//build/test.gni") +import("../../../../security_component.gni") + +module_output_path = "security_component/security_component" + +ohos_fuzztest("GetEnhanceRemoteObjectFuzzTest") { + module_out_path = module_output_path + fuzz_config_file = "${sec_comp_dir}/test/fuzztest/security_component/getenhanceremoteobject_fuzzer" + + include_dirs = [ + "${sec_comp_dir}/frameworks/common/include", + "${sec_comp_dir}/interfaces/inner_api/security_component/include", + ] + cflags = [ + "-g", + "-O0", + "-Wno-unused-variable", + "-fno-omit-frame-pointer", + ] + configs = [ "${sec_comp_dir}/config:coverage_flags" ] + + cflags_cc = [ "-DHILOG_ENABLE" ] + sources = [ "getenhanceremoteobject_fuzzer.cpp" ] + + deps = [ "${sec_comp_dir}/interfaces/inner_api/security_component:libsecurity_component_sdk" ] + + external_deps = [ + "ability_base:want", + "access_token:libaccesstoken_sdk", + "access_token:libtoken_setproc", + "c_utils:utils", + "hilog:libhilog", + ] +} diff --git a/test/fuzztest/security_component/getenhanceremoteobject_fuzzer/corpus/init b/test/fuzztest/security_component/getenhanceremoteobject_fuzzer/corpus/init new file mode 100644 index 0000000..bc977bd --- /dev/null +++ b/test/fuzztest/security_component/getenhanceremoteobject_fuzzer/corpus/init @@ -0,0 +1,14 @@ +# 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. + +FUZZ \ No newline at end of file diff --git a/test/fuzztest/security_component/getenhanceremoteobject_fuzzer/getenhanceremoteobject_fuzzer.cpp b/test/fuzztest/security_component/getenhanceremoteobject_fuzzer/getenhanceremoteobject_fuzzer.cpp new file mode 100644 index 0000000..47d9293 --- /dev/null +++ b/test/fuzztest/security_component/getenhanceremoteobject_fuzzer/getenhanceremoteobject_fuzzer.cpp @@ -0,0 +1,41 @@ +/* + * 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. + */ + +#include +#include +#include +#include +#include "accesstoken_kit.h" +#include "securec.h" +#include "token_setproc.h" +#include "getenhanceremoteobject_fuzzer.h" + +using namespace OHOS::Security::SecurityComponent; +using namespace OHOS::Security::AccessToken; +namespace OHOS { +static void GetEnhanceRemoteObjectFuzzTest(const uint8_t *data, size_t size) +{ + bool isLoad = true; + SecCompKit::GetEnhanceRemoteObject(isLoad); +} +} // namespace OHOS + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) +{ + /* Run your code on data */ + OHOS::GetEnhanceRemoteObjectFuzzTest(data, size); + return 0; +} diff --git a/test/fuzztest/security_component/getenhanceremoteobject_fuzzer/getenhanceremoteobject_fuzzer.h b/test/fuzztest/security_component/getenhanceremoteobject_fuzzer/getenhanceremoteobject_fuzzer.h new file mode 100644 index 0000000..a907797 --- /dev/null +++ b/test/fuzztest/security_component/getenhanceremoteobject_fuzzer/getenhanceremoteobject_fuzzer.h @@ -0,0 +1,23 @@ +/* + * 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. + */ + +#ifndef GET_ENHANCE_REMOTE_OBJECT_FUZZER_H +#define GET_ENHANCE_REMOTE_OBJECT_FUZZER_H + +#define FUZZ_PROJECT_NAME "securitycomponent_fuzzer" + +#include "sec_comp_kit.h" + +#endif diff --git a/test/fuzztest/security_component/getenhanceremoteobject_fuzzer/project.xml b/test/fuzztest/security_component/getenhanceremoteobject_fuzzer/project.xml new file mode 100644 index 0000000..6e8ad2c --- /dev/null +++ b/test/fuzztest/security_component/getenhanceremoteobject_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 1000 + + 300 + + 4096 + + diff --git a/test/fuzztest/security_component/getpointereventenhancedata_fuzzer/BUILD.gn b/test/fuzztest/security_component/getpointereventenhancedata_fuzzer/BUILD.gn new file mode 100644 index 0000000..bca0c52 --- /dev/null +++ b/test/fuzztest/security_component/getpointereventenhancedata_fuzzer/BUILD.gn @@ -0,0 +1,48 @@ +# 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("//build/config/features.gni") +import("//build/test.gni") +import("../../../../security_component.gni") + +module_output_path = "security_component/security_component" + +ohos_fuzztest("GetPointerEventEnhanceDataFuzzTest") { + module_out_path = module_output_path + fuzz_config_file = "${sec_comp_dir}/test/fuzztest/security_component/getpointereventenhancedata_fuzzer" + + include_dirs = [ + "${sec_comp_dir}/frameworks/common/include", + "${sec_comp_dir}/interfaces/inner_api/enhance_kits/include", + ] + cflags = [ + "-g", + "-O0", + "-Wno-unused-variable", + "-fno-omit-frame-pointer", + ] + configs = [ "${sec_comp_dir}/config:coverage_flags" ] + + cflags_cc = [ "-DHILOG_ENABLE" ] + sources = [ "getpointereventenhancedata_fuzzer.cpp" ] + + deps = [ "${sec_comp_dir}/interfaces/inner_api/enhance_kits:libsecurity_component_enhance_sdk" ] + + external_deps = [ + "ability_base:want", + "access_token:libaccesstoken_sdk", + "access_token:libtoken_setproc", + "c_utils:utils", + "hilog:libhilog", + ] +} diff --git a/test/fuzztest/security_component/getpointereventenhancedata_fuzzer/corpus/init b/test/fuzztest/security_component/getpointereventenhancedata_fuzzer/corpus/init new file mode 100644 index 0000000..bc977bd --- /dev/null +++ b/test/fuzztest/security_component/getpointereventenhancedata_fuzzer/corpus/init @@ -0,0 +1,14 @@ +# 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. + +FUZZ \ No newline at end of file diff --git a/test/fuzztest/security_component/getpointereventenhancedata_fuzzer/getpointereventenhancedata_fuzzer.cpp b/test/fuzztest/security_component/getpointereventenhancedata_fuzzer/getpointereventenhancedata_fuzzer.cpp new file mode 100644 index 0000000..c894798 --- /dev/null +++ b/test/fuzztest/security_component/getpointereventenhancedata_fuzzer/getpointereventenhancedata_fuzzer.cpp @@ -0,0 +1,43 @@ +/* + * 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. + */ + +#include +#include +#include +#include +#include "accesstoken_kit.h" +#include "securec.h" +#include "token_setproc.h" +#include "getpointereventenhancedata_fuzzer.h" + +using namespace OHOS::Security::SecurityComponent; +using namespace OHOS::Security::AccessToken; +namespace OHOS { +static void GetPointerEventEnhanceDataFuzzTest(const uint8_t *data, size_t size) +{ + uint8_t *data1 = const_cast(data); + uint8_t enhanceData[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + uint32_t enhancedataLen = 10; + SecCompEnhanceKit::GetPointerEventEnhanceData(data1, size, enhanceData, enhancedataLen); +} +} // namespace OHOS + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) +{ + /* Run your code on data */ + OHOS::GetPointerEventEnhanceDataFuzzTest(data, size); + return 0; +} diff --git a/test/fuzztest/security_component/getpointereventenhancedata_fuzzer/getpointereventenhancedata_fuzzer.h b/test/fuzztest/security_component/getpointereventenhancedata_fuzzer/getpointereventenhancedata_fuzzer.h new file mode 100644 index 0000000..5d8ac75 --- /dev/null +++ b/test/fuzztest/security_component/getpointereventenhancedata_fuzzer/getpointereventenhancedata_fuzzer.h @@ -0,0 +1,23 @@ +/* + * 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. + */ + +#ifndef GET_POINTER_EVENT_ENHANCE_DATA_FUZZER_H +#define GET_POINTER_EVENT_ENHANCE_DATA_FUZZER_H + +#define FUZZ_PROJECT_NAME "getpointereventenhancedata_fuzzer" + +#include "sec_comp_enhance_kit.h" + +#endif diff --git a/test/fuzztest/security_component/getpointereventenhancedata_fuzzer/project.xml b/test/fuzztest/security_component/getpointereventenhancedata_fuzzer/project.xml new file mode 100644 index 0000000..6e8ad2c --- /dev/null +++ b/test/fuzztest/security_component/getpointereventenhancedata_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 1000 + + 300 + + 4096 + + diff --git a/test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/BUILD.gn b/test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/BUILD.gn new file mode 100644 index 0000000..ff5172e --- /dev/null +++ b/test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/BUILD.gn @@ -0,0 +1,49 @@ +# 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("//build/config/features.gni") +import("//build/test.gni") +import("../../../../security_component.gni") + +module_output_path = "security_component/security_component" + +ohos_fuzztest("ReduceAfterVerifySavePermissionInnerFuzzTest") { + module_out_path = module_output_path + fuzz_config_file = "${sec_comp_dir}/test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer" + + include_dirs = [ + "${sec_comp_dir}/frameworks/common/include", + "${sec_comp_dir}/services/security_component_service/sa/sa_main", + ] + cflags = [ + "-g", + "-O0", + "-Wno-unused-variable", + "-fno-omit-frame-pointer", + ] + configs = [ "${sec_comp_dir}/config:coverage_flags" ] + + cflags_cc = [ "-DHILOG_ENABLE" ] + sources = [ "reduceafterverifysavepermissionInner_fuzzer.cpp" ] + + deps = [ "${sec_comp_dir}/services/security_component_service/sa:security_component_service" ] + + external_deps = [ + "ability_runtime:app_manager", + "access_token:libaccesstoken_sdk", + "access_token:libtoken_setproc", + "c_utils:utils", + "hilog:libhilog", + "ipc:ipc_core", + ] +} diff --git a/test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/corpus/init b/test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/corpus/init new file mode 100644 index 0000000..bc977bd --- /dev/null +++ b/test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/corpus/init @@ -0,0 +1,14 @@ +# 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. + +FUZZ \ No newline at end of file diff --git a/test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/project.xml b/test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/project.xml new file mode 100644 index 0000000..6e8ad2c --- /dev/null +++ b/test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 1000 + + 300 + + 4096 + + diff --git a/test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/reduceafterverifysavepermissionInner_fuzzer.cpp b/test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/reduceafterverifysavepermissionInner_fuzzer.cpp new file mode 100644 index 0000000..5afd4e1 --- /dev/null +++ b/test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/reduceafterverifysavepermissionInner_fuzzer.cpp @@ -0,0 +1,48 @@ +/* + * 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. + */ + +#include +#include +#include +#include +#include "accesstoken_kit.h" +#include "securec.h" +#include "token_setproc.h" +#include "reduceafterverifysavepermissionInner_fuzzer.h" + +using namespace OHOS::Security::SecurityComponent; +using namespace OHOS::Security::AccessToken; +namespace OHOS { +static void ReduceAfterVerifySavePermissionInnerFuzzTest(const uint8_t *data, size_t size) +{ + uint32_t code = SecurityComponentServiceInterfaceCode::VERIFY_TEMP_SAVE_PERMISSION; + MessageParcel datas; + datas.WriteInterfaceToken(u"ohos.security.ISecCompService"); + datas.WriteBuffer(data, size); + datas.RewindRead(0); + MessageParcel reply; + MessageOption option; + auto service = std::make_shared(SA_ID_SECURITY_COMPONENT_SERVICE, true); + service->OnRemoteRequest(code, datas, reply, option); +} +} // namespace OHOS + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) +{ + /* Run your code on data */ + OHOS::ReduceAfterVerifySavePermissionInnerFuzzTest(data, size); + return 0; +} diff --git a/test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/reduceafterverifysavepermissionInner_fuzzer.h b/test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/reduceafterverifysavepermissionInner_fuzzer.h new file mode 100644 index 0000000..d17798d --- /dev/null +++ b/test/fuzztest/security_component/reduceafterverifysavepermissionInner_fuzzer/reduceafterverifysavepermissionInner_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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. + */ + +#ifndef REDUCE_AFTER_VERIFY_SAVEPERMISSION_INNER_FUZZER_H +#define REDUCE_AFTER_VERIFY_SAVEPERMISSION_INNER_FUZZER_H + +#define FUZZ_PROJECT_NAME "securitycomponent_fuzzer" + +#include "sec_comp_stub.h" +#include "sec_comp_service.h" + +#endif diff --git a/test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/BUILD.gn b/test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/BUILD.gn new file mode 100644 index 0000000..aec22dc --- /dev/null +++ b/test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/BUILD.gn @@ -0,0 +1,48 @@ +# 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("//build/config/features.gni") +import("//build/test.gni") +import("../../../../security_component.gni") + +module_output_path = "security_component/security_component" + +ohos_fuzztest("ReduceAfterVerifySavePermissionFuzzTest") { + module_out_path = module_output_path + fuzz_config_file = "${sec_comp_dir}/test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer" + + include_dirs = [ + "${sec_comp_dir}/frameworks/common/include", + "${sec_comp_dir}/interfaces/inner_api/security_component/include", + ] + cflags = [ + "-g", + "-O0", + "-Wno-unused-variable", + "-fno-omit-frame-pointer", + ] + configs = [ "${sec_comp_dir}/config:coverage_flags" ] + + cflags_cc = [ "-DHILOG_ENABLE" ] + sources = [ "reduceafterverifysavepermission_fuzzer.cpp" ] + + deps = [ "${sec_comp_dir}/interfaces/inner_api/security_component:libsecurity_component_sdk" ] + + external_deps = [ + "ability_base:want", + "access_token:libaccesstoken_sdk", + "access_token:libtoken_setproc", + "c_utils:utils", + "hilog:libhilog", + ] +} diff --git a/test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/corpus/init b/test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/corpus/init new file mode 100644 index 0000000..bc977bd --- /dev/null +++ b/test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/corpus/init @@ -0,0 +1,14 @@ +# 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. + +FUZZ \ No newline at end of file diff --git a/test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/project.xml b/test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/project.xml new file mode 100644 index 0000000..6e8ad2c --- /dev/null +++ b/test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 1000 + + 300 + + 4096 + + diff --git a/test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/reduceafterverifysavepermission_fuzzer.cpp b/test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/reduceafterverifysavepermission_fuzzer.cpp new file mode 100644 index 0000000..62a7c88 --- /dev/null +++ b/test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/reduceafterverifysavepermission_fuzzer.cpp @@ -0,0 +1,40 @@ +/* + * 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. + */ + +#include +#include +#include +#include +#include "accesstoken_kit.h" +#include "securec.h" +#include "token_setproc.h" +#include "reduceafterverifysavepermission_fuzzer.h" + +using namespace OHOS::Security::SecurityComponent; +using namespace OHOS::Security::AccessToken; +namespace OHOS { +static void ReduceAfterVerifySavePermissionFuzzTest(const uint8_t *data, size_t size) +{ + SecCompKit::ReduceAfterVerifySavePermission(size); +} +} // namespace OHOS + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) +{ + /* Run your code on data */ + OHOS::ReduceAfterVerifySavePermissionFuzzTest(data, size); + return 0; +} \ No newline at end of file diff --git a/test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/reduceafterverifysavepermission_fuzzer.h b/test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/reduceafterverifysavepermission_fuzzer.h new file mode 100644 index 0000000..6d024ef --- /dev/null +++ b/test/fuzztest/security_component/reduceafterverifysavepermission_fuzzer/reduceafterverifysavepermission_fuzzer.h @@ -0,0 +1,23 @@ +/* + * 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. + */ + +#ifndef REDUCE_AFTER_VERIFY_SAVEPERMISSION_FUZZER_H +#define REDUCE_AFTER_VERIFY_SAVEPERMISSION_FUZZER_H + +#define FUZZ_PROJECT_NAME "securitycomponent_fuzzer" + +#include "sec_comp_kit.h" + +#endif // TEST_FUZZTEST_SECURITY_COMPONENT_FUZZER_H diff --git a/test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/BUILD.gn b/test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/BUILD.gn new file mode 100644 index 0000000..3e81ae7 --- /dev/null +++ b/test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/BUILD.gn @@ -0,0 +1,49 @@ +# 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("//build/config/features.gni") +import("//build/test.gni") +import("../../../../security_component.gni") + +module_output_path = "security_component/security_component" + +ohos_fuzztest("RegisterSecurityComponentInnerFuzzTest") { + module_out_path = module_output_path + fuzz_config_file = "${sec_comp_dir}/test/fuzztest/security_component/registersecuritycomponentInner_fuzzer" + + include_dirs = [ + "${sec_comp_dir}/frameworks/common/include", + "${sec_comp_dir}/services/security_component_service/sa/sa_main", + ] + cflags = [ + "-g", + "-O0", + "-Wno-unused-variable", + "-fno-omit-frame-pointer", + ] + configs = [ "${sec_comp_dir}/config:coverage_flags" ] + + cflags_cc = [ "-DHILOG_ENABLE" ] + sources = [ "registersecuritycomponentInner_fuzzer.cpp" ] + + deps = [ "${sec_comp_dir}/services/security_component_service/sa:security_component_service" ] + + external_deps = [ + "ability_runtime:app_manager", + "access_token:libaccesstoken_sdk", + "access_token:libtoken_setproc", + "c_utils:utils", + "hilog:libhilog", + "ipc:ipc_core", + ] +} diff --git a/test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/corpus/init b/test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/corpus/init new file mode 100644 index 0000000..bc977bd --- /dev/null +++ b/test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/corpus/init @@ -0,0 +1,14 @@ +# 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. + +FUZZ \ No newline at end of file diff --git a/test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/project.xml b/test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/project.xml new file mode 100644 index 0000000..6e8ad2c --- /dev/null +++ b/test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 1000 + + 300 + + 4096 + + diff --git a/test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/registersecuritycomponentInner_fuzzer.cpp b/test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/registersecuritycomponentInner_fuzzer.cpp new file mode 100644 index 0000000..24385f9 --- /dev/null +++ b/test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/registersecuritycomponentInner_fuzzer.cpp @@ -0,0 +1,51 @@ +/* + * 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. + */ + +#include +#include +#include +#include +#include "registersecuritycomponentInner_fuzzer.h" +#include "accesstoken_kit.h" +#include "sec_comp_service.h" +#include "securec.h" +#include "token_setproc.h" + +using namespace OHOS::Security::SecurityComponent; +using namespace OHOS::Security::AccessToken; +namespace OHOS { +static void RegisterSecurityComponentInnerFuzzTest(const uint8_t *data, size_t size) +{ + uint32_t code = + SecurityComponentServiceInterfaceCode::REGISTER_SECURITY_COMPONENT; + MessageParcel datas; + datas.WriteInterfaceToken(u"ohos.security.ISecCompService"); + datas.WriteBuffer(data, size); + datas.RewindRead(0); + MessageParcel reply; + MessageOption option; + auto service = + std::make_shared(SA_ID_SECURITY_COMPONENT_SERVICE, true); + service->OnRemoteRequest(code, datas, reply, option); +} +} // namespace OHOS + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) +{ + /* Run your code on data */ + OHOS::RegisterSecurityComponentInnerFuzzTest(data, size); + return 0; +} \ No newline at end of file diff --git a/test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/registersecuritycomponentInner_fuzzer.h b/test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/registersecuritycomponentInner_fuzzer.h new file mode 100644 index 0000000..a8ada33 --- /dev/null +++ b/test/fuzztest/security_component/registersecuritycomponentInner_fuzzer/registersecuritycomponentInner_fuzzer.h @@ -0,0 +1,21 @@ +/* + * 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. + */ + +#ifndef REGISTER_SECURITY_COMPONENT_INNER_FUZZER_H +#define REGISTER_SECURITY_COMPONENT_INNER_FUZZER_H + +#define FUZZ_PROJECT_NAME "securitycomponent_fuzzer" +#include "sec_comp_stub.h" +#endif diff --git a/test/fuzztest/security_component/registersecuritycomponent_fuzzer/BUILD.gn b/test/fuzztest/security_component/registersecuritycomponent_fuzzer/BUILD.gn new file mode 100644 index 0000000..68f586d --- /dev/null +++ b/test/fuzztest/security_component/registersecuritycomponent_fuzzer/BUILD.gn @@ -0,0 +1,50 @@ +# 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("//build/config/features.gni") +import("//build/test.gni") +import("../../../../security_component.gni") + +module_output_path = "security_component/security_component" + +ohos_fuzztest("RegisterSecurityComponentFuzzTest") { + module_out_path = module_output_path + fuzz_config_file = "${sec_comp_dir}/test/fuzztest/security_component/registersecuritycomponent_fuzzer" + + include_dirs = [ + "${sec_comp_dir}/frameworks/common/include", + "${sec_comp_dir}/interfaces/inner_api/security_component/include", + "//third_party/json/include", + "//third_party/json/test/thirdparty/fifo_map", + ] + cflags = [ + "-g", + "-O0", + "-Wno-unused-variable", + "-fno-omit-frame-pointer", + ] + configs = [ "${sec_comp_dir}/config:coverage_flags" ] + + cflags_cc = [ "-DHILOG_ENABLE" ] + sources = [ "registersecuritycomponent_fuzzer.cpp" ] + + deps = [ "${sec_comp_dir}/interfaces/inner_api/security_component:libsecurity_component_sdk" ] + + external_deps = [ + "ability_base:want", + "access_token:libaccesstoken_sdk", + "access_token:libtoken_setproc", + "c_utils:utils", + "hilog:libhilog", + ] +} diff --git a/test/fuzztest/security_component/registersecuritycomponent_fuzzer/corpus/init b/test/fuzztest/security_component/registersecuritycomponent_fuzzer/corpus/init new file mode 100644 index 0000000..bc977bd --- /dev/null +++ b/test/fuzztest/security_component/registersecuritycomponent_fuzzer/corpus/init @@ -0,0 +1,14 @@ +# 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. + +FUZZ \ No newline at end of file diff --git a/test/fuzztest/security_component/registersecuritycomponent_fuzzer/project.xml b/test/fuzztest/security_component/registersecuritycomponent_fuzzer/project.xml new file mode 100644 index 0000000..6e8ad2c --- /dev/null +++ b/test/fuzztest/security_component/registersecuritycomponent_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 1000 + + 300 + + 4096 + + diff --git a/test/fuzztest/security_component/registersecuritycomponent_fuzzer/registersecuritycomponent_fuzzer.cpp b/test/fuzztest/security_component/registersecuritycomponent_fuzzer/registersecuritycomponent_fuzzer.cpp new file mode 100644 index 0000000..ea9d275 --- /dev/null +++ b/test/fuzztest/security_component/registersecuritycomponent_fuzzer/registersecuritycomponent_fuzzer.cpp @@ -0,0 +1,43 @@ +/* + * 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. + */ + +#include +#include +#include +#include +#include "accesstoken_kit.h" +#include "securec.h" +#include "token_setproc.h" +#include "registersecuritycomponent_fuzzer.h" + +using namespace OHOS::Security::SecurityComponent; +using namespace OHOS::Security::AccessToken; +namespace OHOS { +static void RegisterSecurityComponentFuzzTest(const uint8_t *data, size_t size) +{ + std::string componentInfo(reinterpret_cast(data), size); + int32_t scId = size; + enum SecCompType type = UNKNOWN_SC_TYPE; + SecCompKit::RegisterSecurityComponent(type, componentInfo, scId); +} +} // namespace OHOS + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) +{ + /* Run your code on data */ + OHOS::RegisterSecurityComponentFuzzTest(data, size); + return 0; +} diff --git a/test/fuzztest/security_component/registersecuritycomponent_fuzzer/registersecuritycomponent_fuzzer.h b/test/fuzztest/security_component/registersecuritycomponent_fuzzer/registersecuritycomponent_fuzzer.h new file mode 100644 index 0000000..667b592 --- /dev/null +++ b/test/fuzztest/security_component/registersecuritycomponent_fuzzer/registersecuritycomponent_fuzzer.h @@ -0,0 +1,21 @@ +/* + * 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. + */ + +#ifndef REGISTER_SECURITY_COMPONENT_FUZZER_H +#define REGISTER_SECURITY_COMPONENT_FUZZER_H + +#define FUZZ_PROJECT_NAME "securitycomponent_fuzzer" +#include "sec_comp_kit.h" +#endif diff --git a/test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/BUILD.gn b/test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/BUILD.gn new file mode 100644 index 0000000..fa374fa --- /dev/null +++ b/test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/BUILD.gn @@ -0,0 +1,49 @@ +# 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("//build/config/features.gni") +import("//build/test.gni") +import("../../../../security_component.gni") + +module_output_path = "security_component/security_component" + +ohos_fuzztest("ReportSecurityComponentClickEventInnerFuzzTest") { + module_out_path = module_output_path + fuzz_config_file = "${sec_comp_dir}/test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer" + + include_dirs = [ + "${sec_comp_dir}/frameworks/common/include", + "${sec_comp_dir}/services/security_component_service/sa/sa_main", + ] + cflags = [ + "-g", + "-O0", + "-Wno-unused-variable", + "-fno-omit-frame-pointer", + ] + configs = [ "${sec_comp_dir}/config:coverage_flags" ] + + cflags_cc = [ "-DHILOG_ENABLE" ] + sources = [ "reportsecuritycomponentclickeventInner_fuzzer.cpp" ] + + deps = [ "${sec_comp_dir}/services/security_component_service/sa:security_component_service" ] + + external_deps = [ + "ability_runtime:app_manager", + "access_token:libaccesstoken_sdk", + "access_token:libtoken_setproc", + "c_utils:utils", + "hilog:libhilog", + "ipc:ipc_core", + ] +} diff --git a/test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/corpus/init b/test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/corpus/init new file mode 100644 index 0000000..bc977bd --- /dev/null +++ b/test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/corpus/init @@ -0,0 +1,14 @@ +# 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. + +FUZZ \ No newline at end of file diff --git a/test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/project.xml b/test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/project.xml new file mode 100644 index 0000000..6e8ad2c --- /dev/null +++ b/test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 1000 + + 300 + + 4096 + + diff --git a/test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/reportsecuritycomponentclickeventInner_fuzzer.cpp b/test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/reportsecuritycomponentclickeventInner_fuzzer.cpp new file mode 100644 index 0000000..5cea508 --- /dev/null +++ b/test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/reportsecuritycomponentclickeventInner_fuzzer.cpp @@ -0,0 +1,49 @@ +/* + * 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. + */ + +#include +#include +#include +#include +#include "accesstoken_kit.h" +#include "securec.h" +#include "token_setproc.h" +#include "sec_comp_service.h" +#include "reportsecuritycomponentclickeventInner_fuzzer.h" + +using namespace OHOS::Security::SecurityComponent; +using namespace OHOS::Security::AccessToken; +namespace OHOS { +static void ReportSecurityComponentClickEventInnerFuzzTest(const uint8_t *data, size_t size) +{ + uint32_t code = SecurityComponentServiceInterfaceCode::REPORT_SECURITY_COMPONENT_CLICK_EVENT; + MessageParcel datas; + datas.WriteInterfaceToken(u"ohos.security.ISecCompService"); + datas.WriteBuffer(data, size); + datas.RewindRead(0); + MessageParcel reply; + MessageOption option; + auto service = std::make_shared(SA_ID_SECURITY_COMPONENT_SERVICE, true); + service->OnRemoteRequest(code, datas, reply, option); +} +} // namespace OHOS + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) +{ + /* Run your code on data */ + OHOS::ReportSecurityComponentClickEventInnerFuzzTest(data, size); + return 0; +} diff --git a/test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/reportsecuritycomponentclickeventInner_fuzzer.h b/test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/reportsecuritycomponentclickeventInner_fuzzer.h new file mode 100644 index 0000000..8af2a89 --- /dev/null +++ b/test/fuzztest/security_component/reportsecuritycomponentclickeventInner_fuzzer/reportsecuritycomponentclickeventInner_fuzzer.h @@ -0,0 +1,21 @@ +/* + * 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. + */ + +#ifndef REPORT_SECURITY_COMPONENT_CLICK_EVENT_INNER_FUZZER_H +#define REPORT_SECURITY_COMPONENT_CLICK_EVENT_INNER_FUZZER_H + +#define FUZZ_PROJECT_NAME "securitycomponent_fuzzer" +#include "sec_comp_stub.h" +#endif diff --git a/test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/BUILD.gn b/test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/BUILD.gn new file mode 100644 index 0000000..1ac949d --- /dev/null +++ b/test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/BUILD.gn @@ -0,0 +1,50 @@ +# 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("//build/config/features.gni") +import("//build/test.gni") +import("../../../../security_component.gni") + +module_output_path = "security_component/security_component" + +ohos_fuzztest("ReportSecurityComponentClickEventFuzzTest") { + module_out_path = module_output_path + fuzz_config_file = "${sec_comp_dir}/test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer" + + include_dirs = [ + "${sec_comp_dir}/frameworks/common/include", + "${sec_comp_dir}/interfaces/inner_api/security_component/include", + "//third_party/json/include", + "//third_party/json/test/thirdparty/fifo_map", + ] + cflags = [ + "-g", + "-O0", + "-Wno-unused-variable", + "-fno-omit-frame-pointer", + ] + configs = [ "${sec_comp_dir}/config:coverage_flags" ] + + cflags_cc = [ "-DHILOG_ENABLE" ] + sources = [ "reportsecuritycomponentclickevent_fuzzer.cpp" ] + + deps = [ "${sec_comp_dir}/interfaces/inner_api/security_component:libsecurity_component_sdk" ] + + external_deps = [ + "ability_base:want", + "access_token:libaccesstoken_sdk", + "access_token:libtoken_setproc", + "c_utils:utils", + "hilog:libhilog", + ] +} diff --git a/test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/corpus/init b/test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/corpus/init new file mode 100644 index 0000000..bc977bd --- /dev/null +++ b/test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/corpus/init @@ -0,0 +1,14 @@ +# 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. + +FUZZ \ No newline at end of file diff --git a/test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/project.xml b/test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/project.xml new file mode 100644 index 0000000..6e8ad2c --- /dev/null +++ b/test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 1000 + + 300 + + 4096 + + diff --git a/test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/reportsecuritycomponentclickevent_fuzzer.cpp b/test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/reportsecuritycomponentclickevent_fuzzer.cpp new file mode 100644 index 0000000..89477c3 --- /dev/null +++ b/test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/reportsecuritycomponentclickevent_fuzzer.cpp @@ -0,0 +1,51 @@ +/* + * 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. + */ + +#include +#include +#include +#include +#include "accesstoken_kit.h" +#include "securec.h" +#include "token_setproc.h" +#include "reportsecuritycomponentclickevent_fuzzer.h" + +using namespace OHOS::Security::SecurityComponent; +using namespace OHOS::Security::AccessToken; +namespace OHOS { +static void ReportSecurityComponentClickEventFuzzTest(const uint8_t *data, size_t size) +{ + std::string componentInfo(reinterpret_cast(data), size); + uint8_t *data1 = const_cast(data); + const double touchX = size; + const double touchY = size; + const uint64_t timesStamp = size; + struct SecCompClickEvent touchInfo; + touchInfo.touchX = touchX; + touchInfo.touchY = touchY; + touchInfo.timestamp = timesStamp; + touchInfo.extraInfo.data = data1; + touchInfo.extraInfo.dataSize = size; + SecCompKit::ReportSecurityComponentClickEvent(size, componentInfo, touchInfo); +} +} // namespace OHOS + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) +{ + /* Run your code on data */ + OHOS::ReportSecurityComponentClickEventFuzzTest(data, size); + return 0; +} diff --git a/test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/reportsecuritycomponentclickevent_fuzzer.h b/test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/reportsecuritycomponentclickevent_fuzzer.h new file mode 100644 index 0000000..989ec28 --- /dev/null +++ b/test/fuzztest/security_component/reportsecuritycomponentclickevent_fuzzer/reportsecuritycomponentclickevent_fuzzer.h @@ -0,0 +1,23 @@ +/* + * 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. + */ + +#ifndef REPORT_SECURITY_COMPONENT_CLICK_EVENT_FUZZER_H +#define REPORT_SECURITY_COMPONENT_CLICK_EVENT_FUZZER_H + +#define FUZZ_PROJECT_NAME "securitycomponent_fuzzer" + +#include "sec_comp_kit.h" + +#endif diff --git a/test/fuzztest/security_component/setenhancecfg_fuzzer/BUILD.gn b/test/fuzztest/security_component/setenhancecfg_fuzzer/BUILD.gn new file mode 100644 index 0000000..c7a950f --- /dev/null +++ b/test/fuzztest/security_component/setenhancecfg_fuzzer/BUILD.gn @@ -0,0 +1,49 @@ +# 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("//build/config/features.gni") +import("//build/test.gni") +import("../../../../security_component.gni") + +module_output_path = "security_component/security_component" + +ohos_fuzztest("SetEnhanceCfgFuzzTest") { + module_out_path = module_output_path + fuzz_config_file = + "${sec_comp_dir}/test/fuzztest/security_component/setenhancecfg_fuzzer" + + include_dirs = [ + "${sec_comp_dir}/frameworks/common/include", + "${sec_comp_dir}/interfaces/inner_api/enhance_kits/include", + ] + cflags = [ + "-g", + "-O0", + "-Wno-unused-variable", + "-fno-omit-frame-pointer", + ] + configs = [ "${sec_comp_dir}/config:coverage_flags" ] + + cflags_cc = [ "-DHILOG_ENABLE" ] + sources = [ "setenhancecfg_fuzzer.cpp" ] + + deps = [ "${sec_comp_dir}/interfaces/inner_api/enhance_kits:libsecurity_component_enhance_sdk" ] + + external_deps = [ + "ability_base:want", + "access_token:libaccesstoken_sdk", + "access_token:libtoken_setproc", + "c_utils:utils", + "hilog:libhilog", + ] +} diff --git a/test/fuzztest/security_component/setenhancecfg_fuzzer/corpus/init b/test/fuzztest/security_component/setenhancecfg_fuzzer/corpus/init new file mode 100644 index 0000000..bc977bd --- /dev/null +++ b/test/fuzztest/security_component/setenhancecfg_fuzzer/corpus/init @@ -0,0 +1,14 @@ +# 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. + +FUZZ \ No newline at end of file diff --git a/test/fuzztest/security_component/setenhancecfg_fuzzer/project.xml b/test/fuzztest/security_component/setenhancecfg_fuzzer/project.xml new file mode 100644 index 0000000..6e8ad2c --- /dev/null +++ b/test/fuzztest/security_component/setenhancecfg_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 1000 + + 300 + + 4096 + + diff --git a/test/fuzztest/security_component/setenhancecfg_fuzzer/setenhancecfg_fuzzer.cpp b/test/fuzztest/security_component/setenhancecfg_fuzzer/setenhancecfg_fuzzer.cpp new file mode 100644 index 0000000..be86e48 --- /dev/null +++ b/test/fuzztest/security_component/setenhancecfg_fuzzer/setenhancecfg_fuzzer.cpp @@ -0,0 +1,41 @@ +/* + * 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. + */ + +#include +#include +#include +#include +#include "accesstoken_kit.h" +#include "securec.h" +#include "token_setproc.h" +#include "setenhancecfg_fuzzer.h" + +using namespace OHOS::Security::SecurityComponent; +using namespace OHOS::Security::AccessToken; +namespace OHOS { +static void SetEnhanceCfgFuzzTest(const uint8_t *data, size_t size) +{ + uint8_t *cfg = const_cast(data); + SecCompEnhanceKit::SetEnhanceCfg(cfg, size); +} +} // namespace OHOS + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) +{ + /* Run your code on data */ + OHOS::SetEnhanceCfgFuzzTest(data, size); + return 0; +} diff --git a/test/fuzztest/security_component/setenhancecfg_fuzzer/setenhancecfg_fuzzer.h b/test/fuzztest/security_component/setenhancecfg_fuzzer/setenhancecfg_fuzzer.h new file mode 100644 index 0000000..47d46f1 --- /dev/null +++ b/test/fuzztest/security_component/setenhancecfg_fuzzer/setenhancecfg_fuzzer.h @@ -0,0 +1,21 @@ +/* + * 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. + */ + +#ifndef SETENHANCE_CFG_FUZZER_H +#define SETENHANCE_CFG_FUZZER_H + +#define FUZZ_PROJECT_NAME "setenhancecfg_fuzzer" +#include "sec_comp_enhance_kit.h" +#endif diff --git a/test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/BUILD.gn b/test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/BUILD.gn new file mode 100644 index 0000000..02f554e --- /dev/null +++ b/test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/BUILD.gn @@ -0,0 +1,49 @@ +# 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("//build/config/features.gni") +import("//build/test.gni") +import("../../../../security_component.gni") + +module_output_path = "security_component/security_component" + +ohos_fuzztest("UnregisterSecurityComponentInnerFuzzTest") { + module_out_path = module_output_path + fuzz_config_file = "${sec_comp_dir}/test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer" + + include_dirs = [ + "${sec_comp_dir}/frameworks/common/include", + "${sec_comp_dir}/services/security_component_service/sa/sa_main", + ] + cflags = [ + "-g", + "-O0", + "-Wno-unused-variable", + "-fno-omit-frame-pointer", + ] + configs = [ "${sec_comp_dir}/config:coverage_flags" ] + + cflags_cc = [ "-DHILOG_ENABLE" ] + sources = [ "unregistersecuritycomponentInner_fuzzer.cpp" ] + + deps = [ "${sec_comp_dir}/services/security_component_service/sa:security_component_service" ] + + external_deps = [ + "ability_runtime:app_manager", + "access_token:libaccesstoken_sdk", + "access_token:libtoken_setproc", + "c_utils:utils", + "hilog:libhilog", + "ipc:ipc_core", + ] +} diff --git a/test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/corpus/init b/test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/corpus/init new file mode 100644 index 0000000..bc977bd --- /dev/null +++ b/test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/corpus/init @@ -0,0 +1,14 @@ +# 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. + +FUZZ \ No newline at end of file diff --git a/test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/project.xml b/test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/project.xml new file mode 100644 index 0000000..6e8ad2c --- /dev/null +++ b/test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 1000 + + 300 + + 4096 + + diff --git a/test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/unregistersecuritycomponentInner_fuzzer.cpp b/test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/unregistersecuritycomponentInner_fuzzer.cpp new file mode 100644 index 0000000..8eddb37 --- /dev/null +++ b/test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/unregistersecuritycomponentInner_fuzzer.cpp @@ -0,0 +1,49 @@ +/* + * 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. + */ + +#include +#include +#include +#include +#include "accesstoken_kit.h" +#include "securec.h" +#include "token_setproc.h" +#include "sec_comp_service.h" +#include "unregistersecuritycomponentInner_fuzzer.h" + +using namespace OHOS::Security::SecurityComponent; +using namespace OHOS::Security::AccessToken; +namespace OHOS { +static void UnregisterSecurityComponentInnerFuzzTest(const uint8_t *data, size_t size) +{ + uint32_t code = SecurityComponentServiceInterfaceCode::UNREGISTER_SECURITY_COMPONENT; + MessageParcel datas; + datas.WriteInterfaceToken(u"ohos.security.ISecCompService"); + datas.WriteBuffer(data, size); + datas.RewindRead(0); + MessageParcel reply; + MessageOption option; + auto service = std::make_shared(SA_ID_SECURITY_COMPONENT_SERVICE, true); + service->OnRemoteRequest(code, datas, reply, option); +} +} // namespace OHOS + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) +{ + /* Run your code on data */ + OHOS::UnregisterSecurityComponentInnerFuzzTest(data, size); + return 0; +} diff --git a/test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/unregistersecuritycomponentInner_fuzzer.h b/test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/unregistersecuritycomponentInner_fuzzer.h new file mode 100644 index 0000000..02a5307 --- /dev/null +++ b/test/fuzztest/security_component/unregistersecuritycomponentInner_fuzzer/unregistersecuritycomponentInner_fuzzer.h @@ -0,0 +1,21 @@ +/* + * 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. + */ + +#ifndef UNREGISTER_SECURITY_COMPONENT_INNER_FUZZER_H +#define UNREGISTER_SECURITY_COMPONENT_INNER_FUZZER_H + +#define FUZZ_PROJECT_NAME "securitycomponent_fuzzer" +#include "sec_comp_stub.h" +#endif diff --git a/test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/BUILD.gn b/test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/BUILD.gn new file mode 100644 index 0000000..2afbc27 --- /dev/null +++ b/test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/BUILD.gn @@ -0,0 +1,48 @@ +# 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("//build/config/features.gni") +import("//build/test.gni") +import("../../../../security_component.gni") + +module_output_path = "security_component/security_component" + +ohos_fuzztest("UnregisterSecurityComponentFuzzTest") { + module_out_path = module_output_path + fuzz_config_file = "${sec_comp_dir}/test/fuzztest/security_component/unregistersecuritycomponent_fuzzer" + + include_dirs = [ + "${sec_comp_dir}/frameworks/common/include", + "${sec_comp_dir}/interfaces/inner_api/security_component/include", + ] + cflags = [ + "-g", + "-O0", + "-Wno-unused-variable", + "-fno-omit-frame-pointer", + ] + configs = [ "${sec_comp_dir}/config:coverage_flags" ] + + cflags_cc = [ "-DHILOG_ENABLE" ] + sources = [ "unregistersecuritycomponent_fuzzer.cpp" ] + + deps = [ "${sec_comp_dir}/interfaces/inner_api/security_component:libsecurity_component_sdk" ] + + external_deps = [ + "ability_base:want", + "access_token:libaccesstoken_sdk", + "access_token:libtoken_setproc", + "c_utils:utils", + "hilog:libhilog", + ] +} diff --git a/test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/corpus/init b/test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/corpus/init new file mode 100644 index 0000000..bc977bd --- /dev/null +++ b/test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/corpus/init @@ -0,0 +1,14 @@ +# 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. + +FUZZ \ No newline at end of file diff --git a/test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/project.xml b/test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/project.xml new file mode 100644 index 0000000..6e8ad2c --- /dev/null +++ b/test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 1000 + + 300 + + 4096 + + diff --git a/test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/unregistersecuritycomponent_fuzzer.cpp b/test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/unregistersecuritycomponent_fuzzer.cpp new file mode 100644 index 0000000..3219fb3 --- /dev/null +++ b/test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/unregistersecuritycomponent_fuzzer.cpp @@ -0,0 +1,40 @@ +/* + * 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. + */ + +#include +#include +#include +#include +#include "accesstoken_kit.h" +#include "securec.h" +#include "token_setproc.h" +#include "unregistersecuritycomponent_fuzzer.h" + +using namespace OHOS::Security::SecurityComponent; +using namespace OHOS::Security::AccessToken; +namespace OHOS { +static void UnregisterSecurityComponentFuzzTest(const uint8_t *data, size_t size) +{ + SecCompKit::UnregisterSecurityComponent(size); +} +} // namespace OHOS + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) +{ + /* Run your code on data */ + OHOS::UnregisterSecurityComponentFuzzTest(data, size); + return 0; +} diff --git a/test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/unregistersecuritycomponent_fuzzer.h b/test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/unregistersecuritycomponent_fuzzer.h new file mode 100644 index 0000000..794af54 --- /dev/null +++ b/test/fuzztest/security_component/unregistersecuritycomponent_fuzzer/unregistersecuritycomponent_fuzzer.h @@ -0,0 +1,21 @@ +/* + * 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. + */ + +#ifndef UNREGISTER_SECURITY_COMPONENT_FUZZER_H +#define UNREGISTER_SECURITY_COMPONENT_FUZZER_H + +#define FUZZ_PROJECT_NAME "securitycomponent_fuzzer" +#include "sec_comp_kit.h" +#endif diff --git a/test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/BUILD.gn b/test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/BUILD.gn new file mode 100644 index 0000000..061dcc7 --- /dev/null +++ b/test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/BUILD.gn @@ -0,0 +1,49 @@ +# 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("//build/config/features.gni") +import("//build/test.gni") +import("../../../../security_component.gni") + +module_output_path = "security_component/security_component" + +ohos_fuzztest("UpdateSecurityComponentInnerFuzzTest") { + module_out_path = module_output_path + fuzz_config_file = "${sec_comp_dir}/test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer" + + include_dirs = [ + "${sec_comp_dir}/frameworks/common/include", + "${sec_comp_dir}/services/security_component_service/sa/sa_main", + ] + cflags = [ + "-g", + "-O0", + "-Wno-unused-variable", + "-fno-omit-frame-pointer", + ] + configs = [ "${sec_comp_dir}/config:coverage_flags" ] + + cflags_cc = [ "-DHILOG_ENABLE" ] + sources = [ "updatesecuritycomponentInner_fuzzer.cpp" ] + + deps = [ "${sec_comp_dir}/services/security_component_service/sa:security_component_service" ] + + external_deps = [ + "ability_runtime:app_manager", + "access_token:libaccesstoken_sdk", + "access_token:libtoken_setproc", + "c_utils:utils", + "hilog:libhilog", + "ipc:ipc_core", + ] +} diff --git a/test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/corpus/init b/test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/corpus/init new file mode 100644 index 0000000..bc977bd --- /dev/null +++ b/test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/corpus/init @@ -0,0 +1,14 @@ +# 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. + +FUZZ \ No newline at end of file diff --git a/test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/project.xml b/test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/project.xml new file mode 100644 index 0000000..6e8ad2c --- /dev/null +++ b/test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 1000 + + 300 + + 4096 + + diff --git a/test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/updatesecuritycomponentInner_fuzzer.cpp b/test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/updatesecuritycomponentInner_fuzzer.cpp new file mode 100644 index 0000000..7f1ab9f --- /dev/null +++ b/test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/updatesecuritycomponentInner_fuzzer.cpp @@ -0,0 +1,49 @@ +/* + * 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. + */ + +#include +#include +#include +#include +#include "accesstoken_kit.h" +#include "securec.h" +#include "token_setproc.h" +#include "sec_comp_service.h" +#include "updatesecuritycomponentInner_fuzzer.h" + +using namespace OHOS::Security::SecurityComponent; +using namespace OHOS::Security::AccessToken; +namespace OHOS { +static void UpdateSecurityComponentInnerFuzzTest(const uint8_t *data, size_t size) +{ + uint32_t code = SecurityComponentServiceInterfaceCode::UPDATE_SECURITY_COMPONENT; + MessageParcel datas; + datas.WriteInterfaceToken(u"ohos.security.ISecCompService"); + datas.WriteBuffer(data, size); + datas.RewindRead(0); + MessageParcel reply; + MessageOption option; + auto service = std::make_shared(SA_ID_SECURITY_COMPONENT_SERVICE, true); + service->OnRemoteRequest(code, datas, reply, option); +} +} // namespace OHOS + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) +{ + /* Run your code on data */ + OHOS::UpdateSecurityComponentInnerFuzzTest(data, size); + return 0; +} diff --git a/test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/updatesecuritycomponentInner_fuzzer.h b/test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/updatesecuritycomponentInner_fuzzer.h new file mode 100644 index 0000000..2d25590 --- /dev/null +++ b/test/fuzztest/security_component/updatesecuritycomponentInner_fuzzer/updatesecuritycomponentInner_fuzzer.h @@ -0,0 +1,21 @@ +/* + * 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. + */ + +#ifndef UPDATE_SECURITY_COMPONENT_INNER_FUZZER_H +#define UPDATE_SECURITY_COMPONENT_INNER_FUZZER_H + +#define FUZZ_PROJECT_NAME "securitycomponent_fuzzer" +#include "sec_comp_stub.h" +#endif diff --git a/test/fuzztest/security_component/updatesecuritycomponent_fuzzer/BUILD.gn b/test/fuzztest/security_component/updatesecuritycomponent_fuzzer/BUILD.gn new file mode 100644 index 0000000..0e675b2 --- /dev/null +++ b/test/fuzztest/security_component/updatesecuritycomponent_fuzzer/BUILD.gn @@ -0,0 +1,52 @@ +# 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("//build/config/features.gni") +import("//build/test.gni") +import("../../../../security_component.gni") + +module_output_path = "security_component/security_component" + +ohos_fuzztest("UpdateSecurityComponentFuzzTest") { + module_out_path = module_output_path + fuzz_config_file = "${sec_comp_dir}/test/fuzztest/security_component/updatesecuritycomponent_fuzzer" + + include_dirs = [ + "${sec_comp_dir}/frameworks/common/include", + "${sec_comp_dir}/services/security_component_service/sa/sa_main", + ] + cflags = [ + "-g", + "-O0", + "-Wno-unused-variable", + "-fno-omit-frame-pointer", + ] + configs = [ "${sec_comp_dir}/config:coverage_flags" ] + + cflags_cc = [ "-DHILOG_ENABLE" ] + sources = [ "updatesecuritycomponent_fuzzer.cpp" ] + + deps = [ + "${sec_comp_dir}/interfaces/inner_api/security_component:libsecurity_component_sdk", + "${sec_comp_dir}/services/security_component_service/sa:security_component_service", + ] + + external_deps = [ + "ability_runtime:app_manager", + "access_token:libaccesstoken_sdk", + "access_token:libtoken_setproc", + "c_utils:utils", + "hilog:libhilog", + "ipc:ipc_core", + ] +} diff --git a/test/fuzztest/security_component/updatesecuritycomponent_fuzzer/corpus/init b/test/fuzztest/security_component/updatesecuritycomponent_fuzzer/corpus/init new file mode 100644 index 0000000..bc977bd --- /dev/null +++ b/test/fuzztest/security_component/updatesecuritycomponent_fuzzer/corpus/init @@ -0,0 +1,14 @@ +# 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. + +FUZZ \ No newline at end of file diff --git a/test/fuzztest/security_component/updatesecuritycomponent_fuzzer/project.xml b/test/fuzztest/security_component/updatesecuritycomponent_fuzzer/project.xml new file mode 100644 index 0000000..6e8ad2c --- /dev/null +++ b/test/fuzztest/security_component/updatesecuritycomponent_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 1000 + + 300 + + 4096 + + diff --git a/test/fuzztest/security_component/updatesecuritycomponent_fuzzer/updatesecuritycomponent_fuzzer.cpp b/test/fuzztest/security_component/updatesecuritycomponent_fuzzer/updatesecuritycomponent_fuzzer.cpp new file mode 100644 index 0000000..0a15493 --- /dev/null +++ b/test/fuzztest/security_component/updatesecuritycomponent_fuzzer/updatesecuritycomponent_fuzzer.cpp @@ -0,0 +1,41 @@ +/* + * 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. + */ + +#include +#include +#include +#include +#include "accesstoken_kit.h" +#include "securec.h" +#include "token_setproc.h" +#include "updatesecuritycomponent_fuzzer.h" + +using namespace OHOS::Security::SecurityComponent; +using namespace OHOS::Security::AccessToken; +namespace OHOS { +static void UpdateSecurityComponentFuzzTest(const uint8_t *data, size_t size) +{ + std::string str(reinterpret_cast(data), size); + SecCompKit::UpdateSecurityComponent(size, str); +} +} // namespace OHOS + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) +{ + /* Run your code on data */ + OHOS::UpdateSecurityComponentFuzzTest(data, size); + return 0; +} diff --git a/test/fuzztest/security_component/updatesecuritycomponent_fuzzer/updatesecuritycomponent_fuzzer.h b/test/fuzztest/security_component/updatesecuritycomponent_fuzzer/updatesecuritycomponent_fuzzer.h new file mode 100644 index 0000000..85f7f16 --- /dev/null +++ b/test/fuzztest/security_component/updatesecuritycomponent_fuzzer/updatesecuritycomponent_fuzzer.h @@ -0,0 +1,21 @@ +/* + * 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. + */ + +#ifndef UPDATE_SECURITY_COMPONENT_FUZZER_H +#define UPDATE_SECURITY_COMPONENT_FUZZER_H + +#define FUZZ_PROJECT_NAME "securitycomponent_fuzzer" +#include "sec_comp_kit.h" +#endif diff --git a/test/security_component/AppScope/app.json b/test/security_component/AppScope/app.json new file mode 100644 index 0000000..bbf7ecc --- /dev/null +++ b/test/security_component/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.example.securitycomponent", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon": "$media:icon", + "label": "$string:app_name", + "description": "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive": true, + "singleUser": true, + "minAPIVersion": 10, + "targetAPIVersion": 10, + "car": { + "apiCompatibleVersion": 10, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/test/security_component/AppScope/resources/base/element/string.json b/test/security_component/AppScope/resources/base/element/string.json new file mode 100644 index 0000000..633100a --- /dev/null +++ b/test/security_component/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string":[ + { + "name":"app_name", + "value":"ohosProject" + } + ] +} \ No newline at end of file diff --git a/test/security_component/AppScope/resources/base/media/app_icon.png b/test/security_component/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c GIT binary patch literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM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0E+ zfyJbSjPb+j;J52U)<|cIcntQBI2T#>2;tOxu{%D?kML476AErF(qN9hPva5Nkc@BF zC-tLF@3ZFb%Kpj)M<{)x*l|*Ia@ECeXo2E4h2f!aV=cHAhi_E_mfUth(sM4^hJq7B zQsGWqdZUm9S%F`$nQ*_#NcuD`&)Ek%_s{&^78{9Hm ztri&rYLOxgFdG>O@+XHy z9#;|&vBCPXH5Mon^I`jSuR$&~ZWtyB67ujzFSj!51>#C}C17~TffQ{c-!QFQkTQ%! zIR^b1`zHx|*1GU?tbBx23weFLz5H?y_Q%N&t$}k?w+``2A=aotj0;2v$~AL z{scF-cL{wsdrmPvf#a9OHyYLcwQD4Kcm)`LLwMh4WT~p29f7M!iafJSU`IV}QY5Wa z(n44-9oA}?J{a+ah*@31WTs#&J#o1`H98#6IQf;Wv0N_!);f&9g7o-k(lW5rWnDUR zQBFIRG+X=6NnsI@mxnwm;tf5;_Uxg?jZ8m-m0}&6+DA!qam(p$mN5R})yA_7m$q@| zFEd|dpS595rxQr-n#GjI5i-AhnUE>Cr;jpCqSrD~EwK_DqI^7%3#p5)%T_od!t3SOmH9MyXeeGO2(UQL;ax|x?Ncixmeo1=$ z{-);Au{*tfzOG?KQ~K|ak8-HQ?`Pekhe2WM(8s{xv-p>Zmu_6{G!-oE$7$mY`MOJorI=+mMx?H;`pr!;fVYz?5~yXBACruWB`Ph zZM}90_<^OBxIhyZ9BW$`>6JvO;%VFpqVr8|7t3~AmxYak6?`Pp#c;**_SYmi`&z23 z`p6_~ePvH)C6x-G9$hgL=eVALq`-AiamN>!3~Lxw&{H(b{B(7xSRm6<3<{%{yXiH# zos5Rv1L+8fUKJLo%P>4I&$}y { + + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/test/security_component/entry/src/main/ets/MainAbility/pages/locationButton.ets b/test/security_component/entry/src/main/ets/MainAbility/pages/locationButton.ets new file mode 100644 index 0000000..ef207ff --- /dev/null +++ b/test/security_component/entry/src/main/ets/MainAbility/pages/locationButton.ets @@ -0,0 +1,241 @@ +/** + * 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 events_emitter from '@ohos.events.emitter' + +@Entry +@Component +struct locationButton { + @State bgType: ButtonType = ButtonType.Normal + @State iconSize: number = 16 + @State direct: SecurityComponentLayoutDirection = 0 + @State positionX: number = 0 + @State positionY: number = 0 + @State anchorX: number = 0 + @State anchorY: number = 0 + @State offsetX: number = 0 + @State offsetY: number = 0 + @State fontSize: number = 16 + @State fontStyle: FontStyle = FontStyle.Normal + @State fontWeight: FontWeight = FontWeight.Medium + @State fontFamily: string = 'HarmonyOS Sans' + @State fontColor: number = 0xffffffff + @State iconColor: number = 0xffffffff + @State bgColor: number = 0xff007dff + @State borderSty: BorderStyle = BorderStyle.Dashed + @State borderWid: number = 0 + @State borderCol: number = 0xffffffff + @State borderRad: number = 0 + @State left: number = 24 + @State right: number = 24 + @State top: number = 8 + @State bottom: number = 8 + @State middle: number = 4 + @State clipSet: boolean = false + @State columnWidth: string = '100%' + @State columnHeight: string = '100%' + private stateChangeCallBack = (eventData) => { + if (eventData != null) { + console.debug("====>page_locationButton page state change called:" + JSON.stringify(eventData)); + if (eventData.data.bgType != null) { + this.bgType = eventData.data.bgType; + } + if (eventData.data.iconSize != null) { + this.iconSize = eventData.data.iconSize; + } + if (eventData.data.direct != null) { + this.direct = eventData.data.direct; + } + if (eventData.data.positionX != null) { + this.positionX = eventData.data.positionX; + } + if (eventData.data.positionY != null) { + this.positionY = eventData.data.positionY; + } + if (eventData.data.anchorX != null) { + this.anchorX = eventData.data.anchorX; + } + if (eventData.data.anchorY != null) { + this.anchorY = eventData.data.anchorY; + } + if (eventData.data.offsetX != null) { + this.offsetX = eventData.data.offsetX; + } + if (eventData.data.offsetY != null) { + this.offsetY = eventData.data.offsetY; + } + if (eventData.data.fontSize != null) { + this.fontSize = eventData.data.fontSize; + } + if (eventData.data.fontStyle != null) { + this.fontStyle = eventData.data.fontStyle; + } + if (eventData.data.fontWeight != null) { + this.fontWeight = eventData.data.fontWeight; + } + if (eventData.data.fontFamily != null) { + this.fontFamily = eventData.data.fontFamily; + } + if (eventData.data.fontColor != null) { + this.fontColor = eventData.data.fontColor; + } + if (eventData.data.iconColor != null) { + this.iconColor = eventData.data.iconColor; + } + if (eventData.data.bgColor != null) { + this.bgColor = eventData.data.bgColor; + } + if (eventData.data.borderSty != null) { + this.borderSty = eventData.data.borderSty; + } + if (eventData.data.borderWid != null) { + this.borderWid = eventData.data.borderWid; + } + if (eventData.data.borderCol != null) { + this.borderCol = eventData.data.borderCol; + } + if (eventData.data.borderRad != null) { + this.borderRad = eventData.data.borderRad; + } + if (eventData.data.left != null) { + this.left = eventData.data.left; + } + if (eventData.data.right != null) { + this.right = eventData.data.right; + } + if (eventData.data.top != null) { + this.top = eventData.data.top; + } + if (eventData.data.bottom != null) { + this.bottom = eventData.data.bottom; + } + if (eventData.data.middle != null) { + this.middle = eventData.data.middle; + } + if (eventData.data.clipSet != null) { + this.clipSet = eventData.data.clipSet; + } + if (eventData.data.columnWidth != null) { + this.columnWidth = eventData.data.columnWidth; + } + if (eventData.data.columnHeight != null) { + this.columnHeight = eventData.data.columnHeight; + } + } + } + + onPageShow() { + console.debug('====>page_locationButton page show called'); + var stateChangeEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + events_emitter.on(stateChangeEvent, this.stateChangeCallBack); + } + + onPageHide() { + console.debug('====>page_locationButton page hide called'); + events_emitter.off(1); + } + + build() { + Row() { + Column() { + LocationButton({ icon: LocationIconStyle.FULL_FILLED, text: LocationDescription.CURRENT_LOCATION, buttonType: this.bgType }) + .onClick((event: ClickEvent, result: LocationButtonOnClickResult) => { + try { + var clickData = { + data: { + "clickResult": result, + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>page_locationButton onclick result:" + JSON.stringify(result)) + events_emitter.emit(clickEvent, clickData) + } catch (err) { + console.debug("====>page_locationButton emit action state err: " + JSON.stringify(err.message)) + } + }) + .iconSize(this.iconSize) + .layoutDirection(this.direct) + .position({ x: this.positionX, y: this.positionY }) + .markAnchor({ x: this.anchorX, y: this.anchorY }) + .offset({ x: this.offsetX, y: this.offsetY }) + .fontSize(this.fontSize) + .fontStyle(this.fontStyle) + .fontWeight(this.fontWeight) + .fontFamily(this.fontFamily) + .fontColor(this.fontColor) + .iconColor(this.iconColor) + .backgroundColor(this.bgColor) + .borderStyle(this.borderSty) + .borderWidth(this.borderWid) + .borderColor(this.borderCol) + .borderRadius(this.borderRad) + .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) + .textIconSpace(this.middle) + .key("keyLocation") + Button() { + Text('--------------------') + .fontSize(25) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ + top: 200, + bottom:60 + }).backgroundColor('#00000000') + LocationButton({ icon: LocationIconStyle.FULL_FILLED, text: LocationDescription.CURRENT_LOCATION, buttonType: this.bgType }) + .onClick((event: ClickEvent, result: LocationButtonOnClickResult) => { + try { + var clickData = { + data: { + "clickResult": result + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>page_LocationButton onclick result:" + JSON.stringify(result)) + events_emitter.emit(clickEvent, clickData) + } catch (err) { + console.debug("====>page_LocationButton emit action state err: " + JSON.stringify(err.message)) + } + }) + .iconSize(this.iconSize) + .layoutDirection(this.direct) + .markAnchor({ x: this.anchorX, y: this.anchorY }) + .offset({ x: this.offsetX, y: this.offsetY }) + .fontSize(this.fontSize) + .fontStyle(this.fontStyle) + .fontWeight(this.fontWeight) + .fontFamily(this.fontFamily) + .fontColor(this.fontColor) + .iconColor(this.iconColor) + .backgroundColor(this.bgColor) + .borderStyle(this.borderSty) + .borderWidth(this.borderWid) + .borderColor(this.borderCol) + .borderRadius(this.borderRad) + .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) + .textIconSpace(this.middle) + .key("keyLocation1") + }.width(this.columnWidth).height(this.columnHeight).clip(this.clipSet) + }.height('100%') + } +} diff --git a/test/security_component/entry/src/main/ets/MainAbility/pages/locationButton_1.ets b/test/security_component/entry/src/main/ets/MainAbility/pages/locationButton_1.ets new file mode 100644 index 0000000..9fe207c --- /dev/null +++ b/test/security_component/entry/src/main/ets/MainAbility/pages/locationButton_1.ets @@ -0,0 +1,432 @@ +/** + * 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 events_emitter from '@ohos.events.emitter' + +@Entry +@Component +struct locationButton_1 { + @State bgType: ButtonType = ButtonType.Normal + @State iconSize: number = 16 + @State positionX: number = 0 + @State positionY: number = 0 + @State anchorX: number = 0 + @State anchorY: number = 0 + @State offsetX: number = 0 + @State offsetY: number = 0 + @State fontSize: number = 16 + @State fontStyle: FontStyle = FontStyle.Normal + @State fontWeight: FontWeight = FontWeight.Medium + @State fontFamily: string = 'HarmonyOS Sans' + @State fontColor: number = 0xffffffff + @State iconColor: number = 0xffffffff + @State bgColor: number = 0x7dff + @State borderSty: BorderStyle = BorderStyle.Dashed + @State borderWid: number = 0 + @State borderCol: number = 0xffffffff + @State borderRad: number = 0 + @State left: number = 24 + @State right: number = 24 + @State top: number = 8 + @State bottom: number = 8 + @State middle: number = 4 + @State heightValue: number = 4 + marginValue = {top:30, bottom:30, left:10, right:10} + + build() { + Column() { + Row() { + LocationButton({ icon: LocationIconStyle.LINES, text: LocationDescription.ADD_LOCATION, buttonType: this.bgType }) + .onClick((event: ClickEvent, result: LocationButtonOnClickResult) => { + try { + var clickData = { + data: { + "clickResult": result, + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>page_LocationButton onclick result:" + JSON.stringify(result)) + events_emitter.emit(clickEvent, clickData) + } catch (err) { + console.debug("====>page_LocationButton emit action state err: " + JSON.stringify(err.message)) + } + }) + .iconSize(this.iconSize) + .layoutDirection(SecurityComponentLayoutDirection.HORIZONTAL) + .markAnchor({ x: this.anchorX, y: this.anchorY }) + .offset({ x: this.offsetX, y: 0 }) + .fontSize(this.fontSize) + .fontStyle(this.fontStyle) + .fontWeight(this.fontWeight) + .fontFamily(this.fontFamily) + .fontColor('0xFFFFF000') + .iconColor(this.iconColor) + .backgroundColor(this.bgColor) + .borderStyle(this.borderSty) + .borderWidth(this.borderWid) + .borderColor(this.borderCol) + .borderRadius(this.borderRad) + .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) + .textIconSpace(this.middle) + .key("keyLocation2") + }.width('100%').height(this.heightValue).margin(this.marginValue) + Row() { + LocationButton({ icon: LocationIconStyle.FULL_FILLED, text: LocationDescription.SELECT_LOCATION, buttonType: this.bgType }) + .onClick((event: ClickEvent, result: LocationButtonOnClickResult) => { + try { + var clickData = { + data: { + "clickResult": result, + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>page_LocationButton onclick result:" + JSON.stringify(result)) + events_emitter.emit(clickEvent, clickData) + } catch (err) { + console.debug("====>page_LocationButton emit action state err: " + JSON.stringify(err.message)) + } + }) + .iconSize(this.iconSize) + .layoutDirection(SecurityComponentLayoutDirection.VERTICAL) + .markAnchor({ x: this.anchorX, y: this.anchorY }) + .offset({ x: this.offsetX, y: 0 }) + .fontSize(this.fontSize) + .fontStyle(this.fontStyle) + .fontWeight(this.fontWeight) + .fontFamily(this.fontFamily) + .fontColor('0xFFFFF000') + .iconColor(this.iconColor) + .backgroundColor(this.bgColor) + .borderStyle(this.borderSty) + .borderWidth(this.borderWid) + .borderColor(this.borderCol) + .borderRadius(this.borderRad) + .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) + .textIconSpace(this.middle) + .key("keyLocation3") + }.width('100%').height(this.heightValue).margin(this.marginValue) + Row() { + LocationButton({ icon: LocationIconStyle.FULL_FILLED, text: LocationDescription.SHARE_LOCATION, buttonType: this.bgType }) + .onClick((event: ClickEvent, result: LocationButtonOnClickResult) => { + try { + var clickData = { + data: { + "clickResult": result, + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>page_LocationButton onclick result:" + JSON.stringify(result)) + events_emitter.emit(clickEvent, clickData) + } catch (err) { + console.debug("====>page_LocationButton emit action state err: " + JSON.stringify(err.message)) + } + }) + .iconSize(this.iconSize) + .layoutDirection(SecurityComponentLayoutDirection.HORIZONTAL) + .markAnchor({ x: this.anchorX, y: this.anchorY }) + .offset({ x: this.offsetX, y: 0 }) + .fontSize(this.fontSize) + .fontStyle(this.fontStyle) + .fontWeight(this.fontWeight) + .fontFamily(this.fontFamily) + .fontColor('0xFFFFF000') + .iconColor(this.iconColor) + .backgroundColor(this.bgColor) + .borderStyle(this.borderSty) + .borderWidth(this.borderWid) + .borderColor(this.borderCol) + .borderRadius(this.borderRad) + .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) + .textIconSpace(this.middle) + .key("keyLocation4") + }.width('100%').height(this.heightValue).margin(this.marginValue) + Row() { + LocationButton({ icon: LocationIconStyle.FULL_FILLED, text: LocationDescription.SEND_LOCATION, buttonType: this.bgType }) + .onClick((event: ClickEvent, result: LocationButtonOnClickResult) => { + try { + var clickData = { + data: { + "clickResult": result, + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>page_LocationButton onclick result:" + JSON.stringify(result)) + events_emitter.emit(clickEvent, clickData) + } catch (err) { + console.debug("====>page_LocationButton emit action state err: " + JSON.stringify(err.message)) + } + }) + .iconSize(this.iconSize) + .layoutDirection(SecurityComponentLayoutDirection.HORIZONTAL) + .markAnchor({ x: this.anchorX, y: this.anchorY }) + .offset({ x: this.offsetX, y: 0 }) + .fontSize(this.fontSize) + .fontStyle(this.fontStyle) + .fontWeight(this.fontWeight) + .fontFamily(this.fontFamily) + .fontColor('0xFFFFF000') + .iconColor(this.iconColor) + .backgroundColor(this.bgColor) + .borderStyle(this.borderSty) + .borderWidth(this.borderWid) + .borderColor(this.borderCol) + .borderRadius(this.borderRad) + .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) + .textIconSpace(this.middle) + .key("keyLocation5") + }.width('100%').height(this.heightValue).margin(this.marginValue) + Row() { + LocationButton({ icon: LocationIconStyle.FULL_FILLED, text: LocationDescription.LOCATING, buttonType: this.bgType }) + .onClick((event: ClickEvent, result: LocationButtonOnClickResult) => { + try { + var clickData = { + data: { + "clickResult": result, + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>page_LocationButton onclick result:" + JSON.stringify(result)) + events_emitter.emit(clickEvent, clickData) + } catch (err) { + console.debug("====>page_LocationButton emit action state err: " + JSON.stringify(err.message)) + } + }) + .iconSize(this.iconSize) + .layoutDirection(SecurityComponentLayoutDirection.HORIZONTAL) + .markAnchor({ x: this.anchorX, y: this.anchorY }) + .offset({ x: this.offsetX, y: 0 }) + .fontSize(this.fontSize) + .fontStyle(this.fontStyle) + .fontWeight(this.fontWeight) + .fontFamily(this.fontFamily) + .fontColor('0xFFFFF000') + .iconColor(this.iconColor) + .backgroundColor(this.bgColor) + .borderStyle(this.borderSty) + .borderWidth(this.borderWid) + .borderColor(this.borderCol) + .borderRadius(this.borderRad) + .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) + .textIconSpace(this.middle) + .key("keyLocation6") + }.width('100%').height(this.heightValue).margin(this.marginValue) + Row() { + LocationButton({ icon: LocationIconStyle.FULL_FILLED, text: LocationDescription.LOCATION, buttonType: this.bgType }) + .onClick((event: ClickEvent, result: LocationButtonOnClickResult) => { + try { + var clickData = { + data: { + "clickResult": result, + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>page_LocationButton onclick result:" + JSON.stringify(result)) + events_emitter.emit(clickEvent, clickData) + } catch (err) { + console.debug("====>page_LocationButton emit action state err: " + JSON.stringify(err.message)) + } + }) + .iconSize(this.iconSize) + .layoutDirection(SecurityComponentLayoutDirection.HORIZONTAL) + .markAnchor({ x: this.anchorX, y: this.anchorY }) + .offset({ x: this.offsetX, y: 0 }) + .fontSize(this.fontSize) + .fontStyle(this.fontStyle) + .fontWeight(this.fontWeight) + .fontFamily(this.fontFamily) + .fontColor('0xFFFFF000') + .iconColor(this.iconColor) + .backgroundColor(this.bgColor) + .borderStyle(this.borderSty) + .borderWidth(this.borderWid) + .borderColor(this.borderCol) + .borderRadius(this.borderRad) + .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) + .textIconSpace(this.middle) + .key("keyLocation7") + }.width('100%').height(this.heightValue).margin(this.marginValue) + Row() { + LocationButton({ icon: LocationIconStyle.FULL_FILLED, text: LocationDescription.SEND_CURRENT_LOCATION, buttonType: this.bgType }) + .onClick((event: ClickEvent, result: LocationButtonOnClickResult) => { + try { + var clickData = { + data: { + "clickResult": result, + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>page_LocationButton onclick result:" + JSON.stringify(result)) + events_emitter.emit(clickEvent, clickData) + } catch (err) { + console.debug("====>page_LocationButton emit action state err: " + JSON.stringify(err.message)) + } + }) + .iconSize(this.iconSize) + .layoutDirection(SecurityComponentLayoutDirection.HORIZONTAL) + .markAnchor({ x: this.anchorX, y: this.anchorY }) + .offset({ x: this.offsetX, y: 0 }) + .fontSize(this.fontSize) + .fontStyle(this.fontStyle) + .fontWeight(this.fontWeight) + .fontFamily(this.fontFamily) + .fontColor('0xFFFFF000') + .iconColor(this.iconColor) + .backgroundColor(this.bgColor) + .borderStyle(this.borderSty) + .borderWidth(this.borderWid) + .borderColor(this.borderCol) + .borderRadius(this.borderRad) + .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) + .textIconSpace(this.middle) + .key("keyLocation8") + }.width('100%').height(this.heightValue).margin(this.marginValue) + Row() { + LocationButton({ icon: LocationIconStyle.FULL_FILLED, text: LocationDescription.RELOCATION, buttonType: this.bgType }) + .onClick((event: ClickEvent, result: LocationButtonOnClickResult) => { + try { + var clickData = { + data: { + "clickResult": result, + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>page_LocationButton onclick result:" + JSON.stringify(result)) + events_emitter.emit(clickEvent, clickData) + } catch (err) { + console.debug("====>page_LocationButton emit action state err: " + JSON.stringify(err.message)) + } + }) + .iconSize(this.iconSize) + .layoutDirection(SecurityComponentLayoutDirection.HORIZONTAL) + .markAnchor({ x: this.anchorX, y: this.anchorY }) + .offset({ x: this.offsetX, y: 0 }) + .fontSize(this.fontSize) + .fontStyle(this.fontStyle) + .fontWeight(this.fontWeight) + .fontFamily(this.fontFamily) + .fontColor('0xFFFFF000') + .iconColor(this.iconColor) + .backgroundColor(this.bgColor) + .borderStyle(this.borderSty) + .borderWidth(this.borderWid) + .borderColor(this.borderCol) + .borderRadius(this.borderRad) + .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) + .textIconSpace(this.middle) + .key("keyLocation9") + }.width('100%').height(this.heightValue).margin(this.marginValue) + Row() { + LocationButton({ icon: LocationIconStyle.FULL_FILLED, text: LocationDescription.PUNCH_IN, buttonType: this.bgType }) + .onClick((event: ClickEvent, result: LocationButtonOnClickResult) => { + try { + var clickData = { + data: { + "clickResult": result, + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>page_LocationButton onclick result:" + JSON.stringify(result)) + events_emitter.emit(clickEvent, clickData) + } catch (err) { + console.debug("====>page_LocationButton emit action state err: " + JSON.stringify(err.message)) + } + }) + .iconSize(this.iconSize) + .layoutDirection(SecurityComponentLayoutDirection.HORIZONTAL) + .markAnchor({ x: this.anchorX, y: this.anchorY }) + .offset({ x: this.offsetX, y: 0 }) + .fontSize(this.fontSize) + .fontStyle(this.fontStyle) + .fontWeight(this.fontWeight) + .fontFamily(this.fontFamily) + .fontColor('0xFFFFF000') + .iconColor(this.iconColor) + .backgroundColor(this.bgColor) + .borderStyle(this.borderSty) + .borderWidth(this.borderWid) + .borderColor(this.borderCol) + .borderRadius(this.borderRad) + .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) + .textIconSpace(this.middle) + .key("keyLocation10") + }.width('100%').height(this.heightValue).margin(this.marginValue) + Row() { + LocationButton({ icon: LocationIconStyle.FULL_FILLED, text: LocationDescription.CURRENT_POSITION, buttonType: this.bgType }) + .onClick((event: ClickEvent, result: LocationButtonOnClickResult) => { + try { + var clickData = { + data: { + "clickResult": result, + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>page_LocationButton onclick result:" + JSON.stringify(result)) + events_emitter.emit(clickEvent, clickData) + } catch (err) { + console.debug("====>page_LocationButton emit action state err: " + JSON.stringify(err.message)) + } + }) + .iconSize(this.iconSize) + .layoutDirection(SecurityComponentLayoutDirection.HORIZONTAL) + .markAnchor({ x: this.anchorX, y: this.anchorY }) + .offset({ x: this.offsetX, y: 0 }) + .fontSize(this.fontSize) + .fontStyle(this.fontStyle) + .fontWeight(this.fontWeight) + .fontFamily(this.fontFamily) + .fontColor('0xFFFFF000') + .iconColor(this.iconColor) + .backgroundColor(this.bgColor) + .borderStyle(this.borderSty) + .borderWidth(this.borderWid) + .borderColor(this.borderCol) + .borderRadius(this.borderRad) + .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) + .textIconSpace(this.middle) + .key("keyLocation11") + }.width('100%').height(this.heightValue).margin(this.marginValue) + } + } +} diff --git a/test/security_component/entry/src/main/ets/MainAbility/pages/pasteButton.ets b/test/security_component/entry/src/main/ets/MainAbility/pages/pasteButton.ets new file mode 100644 index 0000000..dc8e319 --- /dev/null +++ b/test/security_component/entry/src/main/ets/MainAbility/pages/pasteButton.ets @@ -0,0 +1,241 @@ +/** + * 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 events_emitter from '@ohos.events.emitter' + +@Entry +@Component +struct pasteButton { + @State bgType: ButtonType = ButtonType.Normal + @State iconSize: number = 16 + @State direct: SecurityComponentLayoutDirection = 0 + @State positionX: number = 0 + @State positionY: number = 0 + @State anchorX: number = 0 + @State anchorY: number = 0 + @State offsetX: number = 0 + @State offsetY: number = 0 + @State fontSize: number = 16 + @State fontStyle: FontStyle = FontStyle.Normal + @State fontWeight: FontWeight = FontWeight.Medium + @State fontFamily: string = 'HarmonyOS Sans' + @State fontColor: number = 0xffffffff + @State iconColor: number = 0xffffffff + @State bgColor: number = 0xff007dff + @State borderSty: BorderStyle = BorderStyle.Dashed + @State borderWid: number = 0 + @State borderCol: number = 0xffffffff + @State borderRad: number = 0 + @State left: number = 24 + @State right: number = 24 + @State top: number = 8 + @State bottom: number = 8 + @State middle: number = 4 + @State clipSet: boolean = false + @State columnWidth: string = '100%' + @State columnHeight: string = '100%' + private stateChangeCallBack = (eventData) => { + if (eventData != null) { + console.debug("====>page_pasteButton page state change called:" + JSON.stringify(eventData)); + if (eventData.data.bgType != null) { + this.bgType = eventData.data.bgType; + } + if (eventData.data.iconSize != null) { + this.iconSize = eventData.data.iconSize; + } + if (eventData.data.direct != null) { + this.direct = eventData.data.direct; + } + if (eventData.data.positionX != null) { + this.positionX = eventData.data.positionX; + } + if (eventData.data.positionY != null) { + this.positionY = eventData.data.positionY; + } + if (eventData.data.anchorX != null) { + this.anchorX = eventData.data.anchorX; + } + if (eventData.data.anchorY != null) { + this.anchorY = eventData.data.anchorY; + } + if (eventData.data.offsetX != null) { + this.offsetX = eventData.data.offsetX; + } + if (eventData.data.offsetY != null) { + this.offsetY = eventData.data.offsetY; + } + if (eventData.data.fontSize != null) { + this.fontSize = eventData.data.fontSize; + } + if (eventData.data.fontStyle != null) { + this.fontStyle = eventData.data.fontStyle; + } + if (eventData.data.fontWeight != null) { + this.fontWeight = eventData.data.fontWeight; + } + if (eventData.data.fontFamily != null) { + this.fontFamily = eventData.data.fontFamily; + } + if (eventData.data.fontColor != null) { + this.fontColor = eventData.data.fontColor; + } + if (eventData.data.iconColor != null) { + this.iconColor = eventData.data.iconColor; + } + if (eventData.data.bgColor != null) { + this.bgColor = eventData.data.bgColor; + } + if (eventData.data.borderSty != null) { + this.borderSty = eventData.data.borderSty; + } + if (eventData.data.borderWid != null) { + this.borderWid = eventData.data.borderWid; + } + if (eventData.data.borderCol != null) { + this.borderCol = eventData.data.borderCol; + } + if (eventData.data.borderRad != null) { + this.borderRad = eventData.data.borderRad; + } + if (eventData.data.left != null) { + this.left = eventData.data.left; + } + if (eventData.data.right != null) { + this.right = eventData.data.right; + } + if (eventData.data.top != null) { + this.top = eventData.data.top; + } + if (eventData.data.bottom != null) { + this.bottom = eventData.data.bottom; + } + if (eventData.data.middle != null) { + this.middle = eventData.data.middle; + } + if (eventData.data.clipSet != null) { + this.clipSet = eventData.data.clipSet; + } + if (eventData.data.columnWidth != null) { + this.columnWidth = eventData.data.columnWidth; + } + if (eventData.data.columnHeight != null) { + this.columnHeight = eventData.data.columnHeight; + } + } + } + + onPageShow() { + console.debug('====>page_pasteButton page show called'); + var stateChangeEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + events_emitter.on(stateChangeEvent, this.stateChangeCallBack); + } + + onPageHide() { + console.debug('====>page_pasteButton page hide called'); + events_emitter.off(1); + } + + build() { + Row() { + Column() { + PasteButton({ icon: PasteIconStyle.LINES, text: PasteDescription.PASTE, buttonType: this.bgType }) + .onClick((event: ClickEvent, result: PasteButtonOnClickResult) => { + try { + var clickData = { + data: { + "clickResult": result, + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>page_pasteButton onclick result:" + JSON.stringify(result)) + events_emitter.emit(clickEvent, clickData) + } catch (err) { + console.debug("====>page_pasteButton emit action state err: " + JSON.stringify(err.message)) + } + }) + .iconSize(this.iconSize) + .layoutDirection(this.direct) + .position({ x: this.positionX, y: this.positionY }) + .markAnchor({ x: this.anchorX, y: this.anchorY }) + .offset({ x: this.offsetX, y: this.offsetY }) + .fontSize(this.fontSize) + .fontStyle(this.fontStyle) + .fontWeight(this.fontWeight) + .fontFamily(this.fontFamily) + .fontColor(this.fontColor) + .iconColor(this.iconColor) + .backgroundColor(this.bgColor) + .borderStyle(this.borderSty) + .borderWidth(this.borderWid) + .borderColor(this.borderCol) + .borderRadius(this.borderRad) + .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) + .textIconSpace(this.middle) + .key("keyPaste") + Button() { + Text('--------------------') + .fontSize(25) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ + top: 200, + bottom:60 + }).backgroundColor('#00000000') + PasteButton({ icon: PasteIconStyle.LINES, text: PasteDescription.PASTE, buttonType: this.bgType }) + .onClick((event: ClickEvent, result: PasteButtonOnClickResult) => { + try { + var clickData = { + data: { + "clickResult": result + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>page_pasteButton onclick result:" + JSON.stringify(result)) + events_emitter.emit(clickEvent, clickData) + } catch (err) { + console.debug("====>page_pasteButton emit action state err: " + JSON.stringify(err.message)) + } + }) + .iconSize(this.iconSize) + .layoutDirection(this.direct) + .markAnchor({ x: this.anchorX, y: this.anchorY }) + .offset({ x: this.offsetX, y: this.offsetY }) + .fontSize(this.fontSize) + .fontStyle(this.fontStyle) + .fontWeight(this.fontWeight) + .fontFamily(this.fontFamily) + .fontColor(this.fontColor) + .iconColor(this.iconColor) + .backgroundColor(this.bgColor) + .borderStyle(this.borderSty) + .borderWidth(this.borderWid) + .borderColor(this.borderCol) + .borderRadius(this.borderRad) + .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) + .textIconSpace(this.middle) + .key("keyPaste1") + }.width(this.columnWidth).height(this.columnHeight).clip(this.clipSet) + }.height('100%') + } +} diff --git a/test/security_component/entry/src/main/ets/MainAbility/pages/saveButton.ets b/test/security_component/entry/src/main/ets/MainAbility/pages/saveButton.ets new file mode 100644 index 0000000..4660b67 --- /dev/null +++ b/test/security_component/entry/src/main/ets/MainAbility/pages/saveButton.ets @@ -0,0 +1,241 @@ +/** + * 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 events_emitter from '@ohos.events.emitter' + +@Entry +@Component +struct saveButton { + @State bgType: ButtonType = ButtonType.Normal + @State iconSize: number = 16 + @State direct: SecurityComponentLayoutDirection = 0 + @State positionX: number = 0 + @State positionY: number = 0 + @State anchorX: number = 0 + @State anchorY: number = 0 + @State offsetX: number = 0 + @State offsetY: number = 0 + @State fontSize: number = 16 + @State fontStyle: FontStyle = FontStyle.Normal + @State fontWeight: FontWeight = FontWeight.Medium + @State fontFamily: string = 'HarmonyOS Sans' + @State fontColor: number = 0xffffffff + @State iconColor: number = 0xffffffff + @State bgColor: number = 0xff007dff + @State borderSty: BorderStyle = BorderStyle.Dashed + @State borderWid: number = 0 + @State borderCol: number = 0xffffffff + @State borderRad: number = 0 + @State left: number = 24 + @State right: number = 24 + @State top: number = 8 + @State bottom: number = 8 + @State middle: number = 4 + @State clipSet: boolean = false + @State columnWidth: string = '100%' + @State columnHeight: string = '100%' + private stateChangeCallBack = (eventData) => { + if (eventData != null) { + console.debug("====>page_saveButton page state change called:" + JSON.stringify(eventData)); + if (eventData.data.bgType != null) { + this.bgType = eventData.data.bgType; + } + if (eventData.data.iconSize != null) { + this.iconSize = eventData.data.iconSize; + } + if (eventData.data.direct != null) { + this.direct = eventData.data.direct; + } + if (eventData.data.positionX != null) { + this.positionX = eventData.data.positionX; + } + if (eventData.data.positionY != null) { + this.positionY = eventData.data.positionY; + } + if (eventData.data.anchorX != null) { + this.anchorX = eventData.data.anchorX; + } + if (eventData.data.anchorY != null) { + this.anchorY = eventData.data.anchorY; + } + if (eventData.data.offsetX != null) { + this.offsetX = eventData.data.offsetX; + } + if (eventData.data.offsetY != null) { + this.offsetY = eventData.data.offsetY; + } + if (eventData.data.fontSize != null) { + this.fontSize = eventData.data.fontSize; + } + if (eventData.data.fontStyle != null) { + this.fontStyle = eventData.data.fontStyle; + } + if (eventData.data.fontWeight != null) { + this.fontWeight = eventData.data.fontWeight; + } + if (eventData.data.fontFamily != null) { + this.fontFamily = eventData.data.fontFamily; + } + if (eventData.data.fontColor != null) { + this.fontColor = eventData.data.fontColor; + } + if (eventData.data.iconColor != null) { + this.iconColor = eventData.data.iconColor; + } + if (eventData.data.bgColor != null) { + this.bgColor = eventData.data.bgColor; + } + if (eventData.data.borderSty != null) { + this.borderSty = eventData.data.borderSty; + } + if (eventData.data.borderWid != null) { + this.borderWid = eventData.data.borderWid; + } + if (eventData.data.borderCol != null) { + this.borderCol = eventData.data.borderCol; + } + if (eventData.data.borderRad != null) { + this.borderRad = eventData.data.borderRad; + } + if (eventData.data.left != null) { + this.left = eventData.data.left; + } + if (eventData.data.right != null) { + this.right = eventData.data.right; + } + if (eventData.data.top != null) { + this.top = eventData.data.top; + } + if (eventData.data.bottom != null) { + this.bottom = eventData.data.bottom; + } + if (eventData.data.middle != null) { + this.middle = eventData.data.middle; + } + if (eventData.data.clipSet != null) { + this.clipSet = eventData.data.clipSet; + } + if (eventData.data.columnWidth != null) { + this.columnWidth = eventData.data.columnWidth; + } + if (eventData.data.columnHeight != null) { + this.columnHeight = eventData.data.columnHeight; + } + } + } + + onPageShow() { + console.debug('====>page_saveButton page show called'); + var stateChangeEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + events_emitter.on(stateChangeEvent, this.stateChangeCallBack); + } + + onPageHide() { + console.debug('====>page_saveButton page hide called'); + events_emitter.off(1); + } + + build() { + Row() { + Column() { + SaveButton({ icon: SaveIconStyle.FULL_FILLED, text: SaveDescription.DOWNLOAD, buttonType: this.bgType }) + .onClick((event: ClickEvent, result: SaveButtonOnClickResult) => { + try { + var clickData = { + data: { + "clickResult": result, + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>page_saveButton onclick result:" + JSON.stringify(result)) + events_emitter.emit(clickEvent, clickData) + } catch (err) { + console.debug("====>page_saveButton emit action state err: " + JSON.stringify(err.message)) + } + }) + .iconSize(this.iconSize) + .layoutDirection(this.direct) + .position({ x: this.positionX, y: this.positionY }) + .markAnchor({ x: this.anchorX, y: this.anchorY }) + .offset({ x: this.offsetX, y: this.offsetY }) + .fontSize(this.fontSize) + .fontStyle(this.fontStyle) + .fontWeight(this.fontWeight) + .fontFamily(this.fontFamily) + .fontColor(this.fontColor) + .iconColor(this.iconColor) + .backgroundColor(this.bgColor) + .borderStyle(this.borderSty) + .borderWidth(this.borderWid) + .borderColor(this.borderCol) + .borderRadius(this.borderRad) + .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) + .textIconSpace(this.middle) + .key("keySave") + Button() { + Text('--------------------') + .fontSize(25) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ + top: 200, + bottom:60 + }).backgroundColor('#00000000') + SaveButton({ icon: SaveIconStyle.FULL_FILLED, text: SaveDescription.DOWNLOAD, buttonType: this.bgType }) + .onClick((event: ClickEvent, result: SaveButtonOnClickResult) => { + try { + var clickData = { + data: { + "clickResult": result, + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>page_saveButton onclick result:" + JSON.stringify(result)) + events_emitter.emit(clickEvent, clickData) + } catch (err) { + console.debug("====>page_saveButton emit action state err: " + JSON.stringify(err.message)) + } + }) + .iconSize(this.iconSize) + .layoutDirection(this.direct) + .markAnchor({ x: this.anchorX, y: this.anchorY }) + .offset({ x: this.offsetX, y: this.offsetY }) + .fontSize(this.fontSize) + .fontStyle(this.fontStyle) + .fontWeight(this.fontWeight) + .fontFamily(this.fontFamily) + .fontColor(this.fontColor) + .iconColor(this.iconColor) + .backgroundColor(this.bgColor) + .borderStyle(this.borderSty) + .borderWidth(this.borderWid) + .borderColor(this.borderCol) + .borderRadius(this.borderRad) + .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) + .textIconSpace(this.middle) + .key("keySave1") + }.width(this.columnWidth).height(this.columnHeight).clip(this.clipSet) + }.height('100%') + } +} diff --git a/test/security_component/entry/src/main/ets/MainAbility/pages/saveButton_1.ets b/test/security_component/entry/src/main/ets/MainAbility/pages/saveButton_1.ets new file mode 100644 index 0000000..7414dbd --- /dev/null +++ b/test/security_component/entry/src/main/ets/MainAbility/pages/saveButton_1.ets @@ -0,0 +1,320 @@ +/** + * 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 events_emitter from '@ohos.events.emitter' + +@Entry +@Component +struct saveButton_1 { + @State icon: SaveIconStyle = 0 + @State textType: SaveDescription = 0 + @State bgType: ButtonType = ButtonType.Normal + @State iconSize: number = 16 + @State positionX: number = 0 + @State positionY: number = 0 + @State anchorX: number = 0 + @State anchorY: number = 0 + @State offsetX: number = 0 + @State offsetY: number = 0 + @State fontSize: number = 16 + @State fontStyle: FontStyle = FontStyle.Normal + @State fontWeight: FontWeight = FontWeight.Medium + @State fontFamily: string = 'HarmonyOS Sans' + @State fontColor: number = 0xffffffff + @State iconColor: number = 0xffffffff + @State bgColor: number = 0x7dff + @State borderSty: BorderStyle = BorderStyle.Dashed + @State borderWid: number = 0 + @State borderCol: number = 0xffffffff + @State borderRad: number = 0 + @State left: number = 24 + @State right: number = 24 + @State top: number = 8 + @State bottom: number = 8 + @State middle: number = 4 + @State heightValue: number = 4 + marginValue = {top:30, bottom:30, left:10, right:10} + + build() { + Column() { + Row() { + SaveButton({ icon: SaveIconStyle.LINES, text: SaveDescription.DOWNLOAD_FILE, buttonType: this.bgType }) + .onClick((event: ClickEvent, result: SaveButtonOnClickResult) => { + try { + var clickData = { + data: { + "clickResult": result, + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>page_SaveButton onclick result:" + JSON.stringify(result)) + events_emitter.emit(clickEvent, clickData) + } catch (err) { + console.debug("====>page_SaveButton emit action state err: " + JSON.stringify(err.message)) + } + }) + .iconSize(this.iconSize) + .layoutDirection(SecurityComponentLayoutDirection.HORIZONTAL) + .markAnchor({ x: this.anchorX, y: this.anchorY }) + .offset({ x: this.offsetX, y: 0 }) + .fontSize(this.fontSize) + .fontStyle(this.fontStyle) + .fontWeight(this.fontWeight) + .fontFamily(this.fontFamily) + .fontColor('0xFFFFF000') + .iconColor(this.iconColor) + .backgroundColor(this.bgColor) + .borderStyle(this.borderSty) + .borderWidth(this.borderWid) + .borderColor(this.borderCol) + .borderRadius(this.borderRad) + .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) + .textIconSpace(this.middle) + .key("keySave2") + }.width('100%').height(this.heightValue).margin(this.marginValue) + Row() { + SaveButton({ icon: SaveIconStyle.FULL_FILLED, text: SaveDescription.SAVE, buttonType: this.bgType }) + .onClick((event: ClickEvent, result: SaveButtonOnClickResult) => { + try { + var clickData = { + data: { + "clickResult": result, + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>page_SaveButton onclick result:" + JSON.stringify(result)) + events_emitter.emit(clickEvent, clickData) + } catch (err) { + console.debug("====>page_SaveButton emit action state err: " + JSON.stringify(err.message)) + } + }) + .iconSize(this.iconSize) + .layoutDirection(SecurityComponentLayoutDirection.VERTICAL) + .markAnchor({ x: this.anchorX, y: this.anchorY }) + .offset({ x: this.offsetX, y: 0 }) + .fontSize(this.fontSize) + .fontStyle(this.fontStyle) + .fontWeight(this.fontWeight) + .fontFamily(this.fontFamily) + .fontColor('0xFFFFF000') + .iconColor(this.iconColor) + .backgroundColor(this.bgColor) + .borderStyle(this.borderSty) + .borderWidth(this.borderWid) + .borderColor(this.borderCol) + .borderRadius(this.borderRad) + .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) + .textIconSpace(this.middle) + .key("keySave3") + }.width('100%').height(this.heightValue).margin(this.marginValue) + Row() { + SaveButton({ icon: SaveIconStyle.FULL_FILLED, text: SaveDescription.SAVE_IMAGE, buttonType: this.bgType }) + .onClick((event: ClickEvent, result: SaveButtonOnClickResult) => { + try { + var clickData = { + data: { + "clickResult": result, + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>page_SaveButton onclick result:" + JSON.stringify(result)) + events_emitter.emit(clickEvent, clickData) + } catch (err) { + console.debug("====>page_SaveButton emit action state err: " + JSON.stringify(err.message)) + } + }) + .iconSize(this.iconSize) + .layoutDirection(SecurityComponentLayoutDirection.HORIZONTAL) + .markAnchor({ x: this.anchorX, y: this.anchorY }) + .offset({ x: this.offsetX, y: 0 }) + .fontSize(this.fontSize) + .fontStyle(this.fontStyle) + .fontWeight(this.fontWeight) + .fontFamily(this.fontFamily) + .fontColor('0xFFFFF000') + .iconColor(this.iconColor) + .backgroundColor(this.bgColor) + .borderStyle(this.borderSty) + .borderWidth(this.borderWid) + .borderColor(this.borderCol) + .borderRadius(this.borderRad) + .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) + .textIconSpace(this.middle) + .key("keySave4") + }.width('100%').height(this.heightValue).margin(this.marginValue) + Row() { + SaveButton({ icon: SaveIconStyle.FULL_FILLED, text: SaveDescription.SAVE_FILE, buttonType: this.bgType }) + .onClick((event: ClickEvent, result: SaveButtonOnClickResult) => { + try { + var clickData = { + data: { + "clickResult": result, + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>page_SaveButton onclick result:" + JSON.stringify(result)) + events_emitter.emit(clickEvent, clickData) + } catch (err) { + console.debug("====>page_SaveButton emit action state err: " + JSON.stringify(err.message)) + } + }) + .iconSize(this.iconSize) + .layoutDirection(SecurityComponentLayoutDirection.HORIZONTAL) + .markAnchor({ x: this.anchorX, y: this.anchorY }) + .offset({ x: this.offsetX, y: 0 }) + .fontSize(this.fontSize) + .fontStyle(this.fontStyle) + .fontWeight(this.fontWeight) + .fontFamily(this.fontFamily) + .fontColor('0xFFFFF000') + .iconColor(this.iconColor) + .backgroundColor(this.bgColor) + .borderStyle(this.borderSty) + .borderWidth(this.borderWid) + .borderColor(this.borderCol) + .borderRadius(this.borderRad) + .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) + .textIconSpace(this.middle) + .key("keySave5") + }.width('100%').height(this.heightValue).margin(this.marginValue) + Row() { + SaveButton({ icon: SaveIconStyle.FULL_FILLED, text: SaveDescription.DOWNLOAD_AND_SHARE, buttonType: this.bgType }) + .onClick((event: ClickEvent, result: SaveButtonOnClickResult) => { + try { + var clickData = { + data: { + "clickResult": result, + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>page_SaveButton onclick result:" + JSON.stringify(result)) + events_emitter.emit(clickEvent, clickData) + } catch (err) { + console.debug("====>page_SaveButton emit action state err: " + JSON.stringify(err.message)) + } + }) + .iconSize(this.iconSize) + .layoutDirection(SecurityComponentLayoutDirection.HORIZONTAL) + .markAnchor({ x: this.anchorX, y: this.anchorY }) + .offset({ x: this.offsetX, y: 0 }) + .fontSize(this.fontSize) + .fontStyle(this.fontStyle) + .fontWeight(this.fontWeight) + .fontFamily(this.fontFamily) + .fontColor('0xFFFFF000') + .iconColor(this.iconColor) + .backgroundColor(this.bgColor) + .borderStyle(this.borderSty) + .borderWidth(this.borderWid) + .borderColor(this.borderCol) + .borderRadius(this.borderRad) + .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) + .textIconSpace(this.middle) + .key("keySave6") + }.width('100%').height(this.heightValue).margin(this.marginValue) + Row() { + SaveButton({ icon: SaveIconStyle.FULL_FILLED, text: SaveDescription.RECEIVE, buttonType: this.bgType }) + .onClick((event: ClickEvent, result: SaveButtonOnClickResult) => { + try { + var clickData = { + data: { + "clickResult": result, + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>page_SaveButton onclick result:" + JSON.stringify(result)) + events_emitter.emit(clickEvent, clickData) + } catch (err) { + console.debug("====>page_SaveButton emit action state err: " + JSON.stringify(err.message)) + } + }) + .iconSize(this.iconSize) + .layoutDirection(SecurityComponentLayoutDirection.HORIZONTAL) + .markAnchor({ x: this.anchorX, y: this.anchorY }) + .offset({ x: this.offsetX, y: 0 }) + .fontSize(this.fontSize) + .fontStyle(this.fontStyle) + .fontWeight(this.fontWeight) + .fontFamily(this.fontFamily) + .fontColor('0xFFFFF000') + .iconColor(this.iconColor) + .backgroundColor(this.bgColor) + .borderStyle(this.borderSty) + .borderWidth(this.borderWid) + .borderColor(this.borderCol) + .borderRadius(this.borderRad) + .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) + .textIconSpace(this.middle) + .key("keySave7") + }.width('100%').height(this.heightValue).margin(this.marginValue) + Row() { + SaveButton({ icon: SaveIconStyle.FULL_FILLED, text: SaveDescription.CONTINUE_TO_RECEIVE, buttonType: this.bgType }) + .onClick((event: ClickEvent, result: SaveButtonOnClickResult) => { + try { + var clickData = { + data: { + "clickResult": result, + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>page_SaveButton onclick result:" + JSON.stringify(result)) + events_emitter.emit(clickEvent, clickData) + } catch (err) { + console.debug("====>page_SaveButton emit action state err: " + JSON.stringify(err.message)) + } + }) + .iconSize(this.iconSize) + .layoutDirection(SecurityComponentLayoutDirection.HORIZONTAL) + .markAnchor({ x: this.anchorX, y: this.anchorY }) + .offset({ x: this.offsetX, y: 0 }) + .fontSize(this.fontSize) + .fontStyle(this.fontStyle) + .fontWeight(this.fontWeight) + .fontFamily(this.fontFamily) + .fontColor('0xFFFFF000') + .iconColor(this.iconColor) + .backgroundColor(this.bgColor) + .borderStyle(this.borderSty) + .borderWidth(this.borderWid) + .borderColor(this.borderCol) + .borderRadius(this.borderRad) + .padding({ left: this.left, right: this.right, top: this.top, bottom: this.bottom }) + .textIconSpace(this.middle) + .key("keySave8") + }.width('100%').height(this.heightValue).margin(this.marginValue) + } + } +} diff --git a/test/security_component/entry/src/main/ets/TestAbility/TestAbility.ts b/test/security_component/entry/src/main/ets/TestAbility/TestAbility.ts new file mode 100644 index 0000000..368bbfc --- /dev/null +++ b/test/security_component/entry/src/main/ets/TestAbility/TestAbility.ts @@ -0,0 +1,50 @@ +/* + * 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 Ability from '@ohos.app.ability.UIAbility' + +export default class TestAbility extends Ability { + onCreate(want, launchParam) { + console.log('TestAbility onCreate') + } + + onDestroy() { + console.log('TestAbility onDestroy') + } + + onWindowStageCreate(windowStage) { + console.log('TestAbility onWindowStageCreate') + windowStage.loadContent("TestAbility/pages/index", (err, data) => { + if (err.code) { + console.error('Failed to load the content. Cause:' + JSON.stringify(err)); + return; + } + console.info('Succeeded in loading the content. Data: ' + JSON.stringify(data)) + }); + + globalThis.abilityContext = this.context; + } + + onWindowStageDestroy() { + console.log('TestAbility onWindowStageDestroy') + } + + onForeground() { + console.log('TestAbility onForeground') + } + + onBackground() { + console.log('TestAbility onBackground') + } +}; \ No newline at end of file diff --git a/test/security_component/entry/src/main/ets/TestAbility/pages/index.ets b/test/security_component/entry/src/main/ets/TestAbility/pages/index.ets new file mode 100644 index 0000000..441f240 --- /dev/null +++ b/test/security_component/entry/src/main/ets/TestAbility/pages/index.ets @@ -0,0 +1,48 @@ +/* + * 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 router from '@ohos.router'; + +@Entry +@Component +struct Index { + aboutToAppear() { + console.info('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/test/security_component/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/test/security_component/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts new file mode 100644 index 0000000..bf0d2c2 --- /dev/null +++ b/test/security_component/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -0,0 +1,79 @@ +// @ts-nocheck +/** + * 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 TestRunner from '@ohos.application.testRunner' +import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry' + +var abilityDelegator = undefined +var 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() { + console.log("onAbilityCreateCallback"); +} + +async function addAbilityMonitorCallback(err: any) { + console.info("addAbilityMonitorCallback : " + JSON.stringify(err)) +} + +export default class OpenHarmonyTestRunner implements TestRunner { + constructor() { + } + + onPrepare() { + console.info("OpenHarmonyTestRunner OnPrepare ") + } + + async onRun() { + console.log('OpenHarmonyTestRunner onRun run') + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var testAbilityName = abilityDelegatorArguments.bundleName + '.MainAbility' + let lMonitor = { + abilityName: testAbilityName, + onAbilityCreate: onAbilityCreateCallback, + }; + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) + var cmd = 'aa start -d 0 -a com.example.securitycomponent.MainAbility' + ' -b ' + abilityDelegatorArguments.bundleName + cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) + var debug = abilityDelegatorArguments.parameters["-D"] + if (debug == 'true') + { + cmd += ' -D' + } + console.info('cmd : '+cmd) + abilityDelegator.executeShellCommand(cmd, + (err: any, d: any) => { + console.info('executeShellCommand : err : ' + JSON.stringify(err)); + console.info('executeShellCommand : data : ' + d.stdResult); + console.info('executeShellCommand : data : ' + d.exitCode); + }) + console.info('OpenHarmonyTestRunner onRun end') + } +}; \ No newline at end of file diff --git a/test/security_component/entry/src/main/ets/test/List.test.ets b/test/security_component/entry/src/main/ets/test/List.test.ets new file mode 100644 index 0000000..9043208 --- /dev/null +++ b/test/security_component/entry/src/main/ets/test/List.test.ets @@ -0,0 +1,28 @@ +/** + * 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 pasteComponentTest from './PasteComponentTest.test.ets'; +import locationComponentTest from './LocationComponentTest.test.ets'; +import locationComponentTest_1 from './LocationComponentTest_1.test.ets'; +import saveComponentTest from './SaveComponentTest.test.ets'; +import saveComponentTest_1 from './SaveComponentTest_1.test.ets'; + +export default function testsuite() { + pasteComponentTest(); + locationComponentTest(); + locationComponentTest_1(); + saveComponentTest(); + saveComponentTest_1(); +} \ No newline at end of file diff --git a/test/security_component/entry/src/main/ets/test/LocationComponentTest.test.ets b/test/security_component/entry/src/main/ets/test/LocationComponentTest.test.ets new file mode 100644 index 0000000..b1b39ba --- /dev/null +++ b/test/security_component/entry/src/main/ets/test/LocationComponentTest.test.ets @@ -0,0 +1,1927 @@ +/** + * 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" +import router from '@ohos.router'; +import events_emitter from '@ohos.events.emitter'; +import { Driver, ON } from '@ohos.UiTest' +import Utils from './Utils'; + +export default function locationComponentTest() { + describe('locationComponentTest', function () { + beforeAll(async function (done) { + let options = { + url: 'MainAbility/pages/locationButton', + } + try { + router.clear(); + let pages = router.getState(); + console.debug("====>locationComponentTest get state success " + JSON.stringify(pages)); + if (!("locationButton" == pages.name)) { + console.debug("====>locationComponentTest get state success " + JSON.stringify(pages.name)); + let result = await router.pushUrl(options); + await Utils.sleep(2000); + console.debug("====>locationComponentTest push page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("====>locationComponentTest push page error: " + err); + } + done() + }); + + afterEach(async function () { + await Utils.sleep(1000); + console.debug("====>locationComponentTest after each called"); + }); + + it('Test_Security_Button_Location_0100', 0, async function (done) { + console.debug('====>[Test_Security_Button_Location_0100] START===='); + let strJson = getInspectorByKey('keyLocation'); + let obj = JSON.parse(strJson); + expect(obj.$attrs.icon).assertEqual(0); + expect(obj.$attrs.text).assertEqual(0); + expect(obj.$attrs.buttonType).assertEqual(0); + expect(obj.$attrs.iconSize).assertEqual('16.00vp'); + expect(obj.$attrs.layoutDirection).assertEqual(0); + expect(obj.$attrs.position.x).assertEqual('0.00vp'); + expect(obj.$attrs.position.y).assertEqual('0.00vp'); + expect(obj.$attrs.markAnchor.x).assertEqual('0.00vp'); + expect(obj.$attrs.markAnchor.y).assertEqual('0.00vp'); + expect(obj.$attrs.offset.x).assertEqual('0.00vp'); + expect(obj.$attrs.offset.y).assertEqual('0.00vp'); + expect(obj.$attrs.fontSize).assertEqual('16.00fp'); + expect(obj.$attrs.fontStyle).assertEqual(0); + expect(obj.$attrs.fontWeight).assertEqual('FontWeight.Medium'); + expect(obj.$attrs.fontFamily).assertEqual('HarmonyOS Sans'); + expect(obj.$attrs.fontColor).assertEqual('#FFFFFFFF'); + expect(obj.$attrs.iconColor).assertEqual('#FFFFFFFF'); + expect(obj.$attrs.backgroundColor).assertEqual('#FF007DFF'); + expect(obj.$attrs.borderStyle).assertEqual(1); + expect(obj.$attrs.borderWidth).assertEqual('0.00vp'); + expect(obj.$attrs.borderColor).assertEqual('#FFFFFFFF'); + expect(obj.$attrs.borderRadius).assertEqual('0.00vp'); + expect(obj.$attrs.padding.left).assertEqual('24.00vp'); + expect(obj.$attrs.padding.right).assertEqual('24.00vp'); + expect(obj.$attrs.padding.top).assertEqual('8.00vp'); + expect(obj.$attrs.padding.bottom).assertEqual('8.00vp'); + expect(obj.$attrs.textIconSpace).assertEqual('4.00vp'); + await Utils.sleep(1000); + try { + let clickCallback = async (clickData) => { + console.debug("====>[Test_Security_Button_Location_0100] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Location_0100] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Location_0100] 设置权限成功"); + expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); + await Utils.sleep(500); + let driver = Driver.create(); + let textComponent = await driver.findComponent(ON.type('Button')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Location_0100] textComponent is:" + JSON.stringify(textComponent)); + await textComponent.click(); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Location_0100] END===="); + done() + } else { + console.debug("====>[Test_Security_Button_Location_0100] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Location_0100] END===="); + done() + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_0100] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('LocationButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Location_0100] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_0100] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Location_0200', 0, async function (done) { + console.debug('====>[Test_Security_Button_Location_0200] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": SecurityComponentLayoutDirection.VERTICAL, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Location_0200] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_0200] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyLocation'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.layoutDirection).assertEqual(SecurityComponentLayoutDirection.VERTICAL); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Location_0200] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Location_0200] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Location_0200] 设置权限成功"); + expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Location_0200] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Location_0200] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Location_0200] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_0200] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('LocationButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Location_0200] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_0200] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Location_0300', 0, async function (done) { + console.debug('====>[Test_Security_Button_Location_0300] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 150, + "positionY": 20, + "anchorX": 20, + "anchorY": 20, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Location_0300] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_0300] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyLocation'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.position.x).assertEqual('150.00vp'); + expect(obj.$attrs.position.y).assertEqual('20.00vp'); + expect(obj.$attrs.markAnchor.x).assertEqual('20.00vp'); + expect(obj.$attrs.markAnchor.y).assertEqual('20.00vp'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Location_0300] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Location_0300] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Location_0300] 设置权限成功"); + expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Location_0300] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Location_0300] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Location_0300] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_0300] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('LocationButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Location_0300] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_0300] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Location_0400', 0, async function (done) { + console.debug('====>[Test_Security_Button_Location_0400] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 1, + "positionX": 0, + "positionY": 0, + "anchorX": 20, + "anchorY": 20, + "offsetX": 100, + "offsetY": 100, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Location_0400] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_0400] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyLocation1'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.offset.x).assertEqual('100.00vp'); + expect(obj.$attrs.offset.y).assertEqual('100.00vp'); + expect(obj.$attrs.markAnchor.x).assertEqual('20.00vp'); + expect(obj.$attrs.markAnchor.y).assertEqual('20.00vp'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Location_0400] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Location_0400] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Location_0400] 设置权限成功"); + expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Location_0400] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Location_0400] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Location_0400] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_0400] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponents(ON.type('LocationButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Location_0400] button is:" + JSON.stringify(button)); + await button[1].click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_0400] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Location_0500', 0, async function (done) { + console.debug('====>[Test_Security_Button_Location_0500] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Italic, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Location_0500] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_0500] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyLocation'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.fontStyle).assertEqual(1); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Location_0500] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Location_0500] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Location_0500] 设置权限成功"); + expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Location_0500] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Location_0500] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Location_0500] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_0500] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('LocationButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Location_0500] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_0500] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Location_0600', 0, async function (done) { + console.debug('====>[Test_Security_Button_Location_0600] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Lighter, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Location_0600] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_0600] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyLocation'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.fontWeight).assertEqual('FontWeight.Lighter'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Location_0600] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Location_0600] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Location_0600] 设置权限成功"); + expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Location_0600] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Location_0600] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Location_0600] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_0600] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('LocationButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Location_0600] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_0600] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Location_0700', 0, async function (done) { + console.debug('====>[Test_Security_Button_Location_0700] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Normal, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Location_0700] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_0700] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyLocation'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.fontWeight).assertEqual('FontWeight.Normal'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Location_0700] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Location_0700] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Location_0700] 设置权限成功"); + expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Location_0700] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Location_0700] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Location_0700] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_0700] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('LocationButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Location_0700] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_0700] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Location_0800', 0, async function (done) { + console.debug('====>[Test_Security_Button_Location_0800] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Regular, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Location_0800] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_0800] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyLocation'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.fontWeight).assertEqual('FontWeight.Regular'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Location_0800] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Location_0800] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Location_0800] 设置权限成功"); + expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Location_0800] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Location_0800] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Location_0800] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_0800] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('LocationButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Location_0800] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_0800] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Location_0900', 0, async function (done) { + console.debug('====>[Test_Security_Button_Location_0900] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Bold, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Location_0900] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_0900] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyLocation'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.fontWeight).assertEqual('FontWeight.Bold'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Location_0900] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Location_0900] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Location_0900] 设置权限成功"); + expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Location_0900] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Location_0900] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Location_0900] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_0900] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('LocationButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Location_0900] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_0900] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Location_1000', 0, async function (done) { + console.debug('====>[Test_Security_Button_Location_1000] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Bolder, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Location_1000] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_1000] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyLocation'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.fontWeight).assertEqual('FontWeight.Bolder'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Location_1000] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Location_1000] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Location_1000] 设置权限成功"); + expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Location_1000] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Location_1000] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Location_1000] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_1000] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('LocationButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Location_1000] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_1000] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Location_1100', 0, async function (done) { + console.debug('====>[Test_Security_Button_Location_1100] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dotted, + "borderWid": 5, + "borderCol": 0xffffffff, + "borderRad": 5, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Location_1100] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_1100] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyLocation'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.borderStyle).assertEqual(2); + expect(obj.$attrs.borderWidth).assertEqual('5.00vp'); + expect(obj.$attrs.borderColor).assertEqual('#FFFFFFFF'); + expect(obj.$attrs.borderRadius).assertEqual('5.00vp'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Location_1100] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Location_1100] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Location_1100] 设置权限成功"); + expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Location_1100] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Location_1100] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Location_1100] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_1100] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('LocationButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Location_1100] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_1100] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Location_1200', 0, async function (done) { + console.debug('====>[Test_Security_Button_Location_1200] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 5, + "borderCol": 0xffffffff, + "borderRad": 5, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Location_1200] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_1200] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyLocation'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.borderStyle).assertEqual(1); + expect(obj.$attrs.borderWidth).assertEqual('5.00vp'); + expect(obj.$attrs.borderColor).assertEqual('#FFFFFFFF'); + expect(obj.$attrs.borderRadius).assertEqual('5.00vp'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Location_1200] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Location_1200] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Location_1200] 设置权限成功"); + expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Location_1200] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Location_1200] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Location_1200] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_1200] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('LocationButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Location_1200] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_1200] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Location_1300', 0, async function (done) { + console.debug('====>[Test_Security_Button_Location_1300] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Solid, + "borderWid": 5, + "borderCol": 0xffffffff, + "borderRad": 5, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Location_1300] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_1300] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyLocation'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.borderStyle).assertEqual(0); + expect(obj.$attrs.borderWidth).assertEqual('5.00vp'); + expect(obj.$attrs.borderColor).assertEqual('#FFFFFFFF'); + expect(obj.$attrs.borderRadius).assertEqual('5.00vp'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Location_1300] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Location_1300] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Location_1300] 设置权限成功"); + expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Location_1300] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Location_1300] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Location_1300] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_1300] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('LocationButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Location_1300] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_1300] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Location_1400', 0, async function (done) { + console.debug('====>[Test_Security_Button_Location_1400] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 200, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Location_1400] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_1400] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyLocation1'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.offset.x).assertEqual('200.00vp'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Location_1400] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Location_1400] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == LocationButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { + console.debug("====>[Test_Security_Button_Location_1400] ERR CASE 成功"); + expect(clickData.data.clickResult == LocationButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); + console.debug("====>[Test_Security_Button_Location_1400] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Location_1400] ERR CASE 失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Location_1400] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_1400] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponents(ON.type('LocationButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Location_1400] button is:" + JSON.stringify(button)); + await button[1].click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_1400] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Location_1500', 0, async function (done) { + console.debug('====>[Test_Security_Button_Location_1500] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": -200, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Location_1500] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_1500] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyLocation1'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.offset.x).assertEqual('-200.00vp'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Location_1500] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Location_1500] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == LocationButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { + console.debug("====>[Test_Security_Button_Location_1500] ERR CASE 成功"); + expect(clickData.data.clickResult == LocationButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); + console.debug("====>[Test_Security_Button_Location_1500] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Location_1500] ERR CASE 失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Location_1500] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_1500] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponents(ON.type('LocationButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Location_1500] button is:" + JSON.stringify(button)); + await button[1].click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_1500] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Location_1600', 0, async function (done) { + console.debug('====>[Test_Security_Button_Location_1600] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 150, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Location_1600] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_1600] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyLocation'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.iconSize).assertEqual('150.00vp'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Location_1600] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Location_1600] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == LocationButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { + console.debug("====>[Test_Security_Button_Location_1600] ERR CASE 成功"); + expect(clickData.data.clickResult == LocationButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); + console.debug("====>[Test_Security_Button_Location_1600] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Location_1600] ERR CASE 失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Location_1600] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_1600] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('LocationButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Location_1600] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_1600] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Location_1700', 0, async function (done) { + console.debug('====>[Test_Security_Button_Location_1700] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0x10ff0000, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Location_1700] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_1700] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyLocation'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.iconColor).assertEqual('#10FF0000'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Location_1700] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Location_1700] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == LocationButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { + console.debug("====>[Test_Security_Button_Location_1700] ERR CASE 成功"); + expect(clickData.data.clickResult == LocationButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); + console.debug("====>[Test_Security_Button_Location_1700] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Location_1700] ERR CASE 失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Location_1700] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_1700] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('LocationButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Location_1700] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_1700] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Location_1800', 0, async function (done) { + console.debug('====>[Test_Security_Button_Location_1800] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 20, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xfffa0050, + "bgColor": 0xffff0000, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Location_1800] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_1800] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyLocation'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.buttonType).assertEqual(0); + expect(obj.$attrs.iconSize).assertEqual('20.00vp'); + expect(obj.$attrs.iconColor).assertEqual('#FFFA0050'); + expect(obj.$attrs.backgroundColor).assertEqual('#FFFF0000'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Location_1800] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Location_1800] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == LocationButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { + console.debug("====>[Test_Security_Button_Location_1800] ERR CASE 成功"); + expect(clickData.data.clickResult == LocationButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); + console.debug("====>[Test_Security_Button_Location_1800] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Location_1800] ERR CASE 失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Location_1800] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_1800] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('LocationButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Location_1800] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_1800] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Location_1900', 0, async function (done) { + console.debug('====>[Test_Security_Button_Location_1900] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 1, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 20, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Location_1900] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_1900] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyLocation'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.iconSize).assertEqual('1.00vp'); + expect(obj.$attrs.fontSize).assertEqual('20.00fp'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Location_1900] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Location_1900] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == LocationButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { + console.debug("====>[Test_Security_Button_Location_1900] ERR CASE 成功"); + expect(clickData.data.clickResult == LocationButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); + console.debug("====>[Test_Security_Button_Location_1900] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Location_1900] ERR CASE 失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Location_1900] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_1900] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('LocationButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Location_1900] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_1900] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Location_2000', 0, async function (done) { + console.debug('====>[Test_Security_Button_Location_2000] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": Color.Transparent, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Location_2000] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_2000] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyLocation'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.iconColor).assertEqual('#00000000'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Location_2000] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Location_2000] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == LocationButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { + console.debug("====>[Test_Security_Button_Location_2000] ERR CASE 成功"); + expect(clickData.data.clickResult == LocationButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); + console.debug("====>[Test_Security_Button_Location_2000] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Location_2000] ERR CASE 失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Location_2000] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_2000] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('LocationButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Location_2000] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_2000] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Location_2100', 0, async function (done) { + console.debug('====>[Test_Security_Button_Location_2100] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": Color.Transparent, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Location_2100] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_2100] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyLocation'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.fontColor).assertEqual('#00000000'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Location_2100] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Location_2100] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == LocationButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { + console.debug("====>[Test_Security_Button_Location_2100] ERR CASE 成功"); + expect(clickData.data.clickResult == LocationButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); + console.debug("====>[Test_Security_Button_Location_2100] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Location_2100] ERR CASE 失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Location_2100] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_2100] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('LocationButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Location_2100] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_2100] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Location_2200', 0, async function (done) { + console.debug('====>[Test_Security_Button_Location_2200] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 20, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": Color.Transparent, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Location_2200] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_2200] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyLocation'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.backgroundColor).assertEqual('#00000000'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Location_2200] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Location_2200] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == LocationButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { + console.debug("====>[Test_Security_Button_Location_2200] ERR CASE 成功"); + expect(clickData.data.clickResult == LocationButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); + console.debug("====>[Test_Security_Button_Location_2200] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Location_2200] ERR CASE 失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Location_2200] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_2200] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('LocationButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Location_2200] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_2200] clickSecComponent err : " + JSON.stringify(err)); + } + }); + }) +} \ No newline at end of file diff --git a/test/security_component/entry/src/main/ets/test/LocationComponentTest_1.test.ets b/test/security_component/entry/src/main/ets/test/LocationComponentTest_1.test.ets new file mode 100644 index 0000000..dad8ed8 --- /dev/null +++ b/test/security_component/entry/src/main/ets/test/LocationComponentTest_1.test.ets @@ -0,0 +1,490 @@ +/** + * 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" +import router from '@ohos.router'; +import events_emitter from '@ohos.events.emitter'; +import { Driver, ON } from '@ohos.UiTest' +import Utils from './Utils'; + +export default function locationComponentTest_1() { + describe('locationComponentTest_1', function () { + beforeAll(async function (done) { + let options = { + url: 'MainAbility/pages/locationButton_1', + } + try { + router.clear(); + let pages = router.getState(); + console.debug("====>locationComponentTest_1 get state success " + JSON.stringify(pages)); + if (!("locationButton_1" == pages.name)) { + console.debug("====>locationComponentTest_1 get state success " + JSON.stringify(pages.name)); + let result = await router.pushUrl(options); + await Utils.sleep(2000); + console.debug("====>locationComponentTest_1 push page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("====>locationComponentTest_1 push page error: " + err); + } + done() + }); + + afterEach(async function () { + await Utils.sleep(1000); + console.debug("====>locationComponentTest_1 after each called"); + }); + + it('Test_Security_Button_Location_2300', 0, async function (done) { + console.debug('====>[Test_Security_Button_Location_2300] START===='); + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyLocation2'); + let obj = JSON.parse(strJsonNew); + console.debug("====>component obj.$attrs.icon:" + obj.$attrs.icon); + console.debug("====>component obj.$attrs.text:" + obj.$attrs.text); + expect(obj.$attrs.icon).assertEqual(1); + expect(obj.$attrs.text).assertEqual(1); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Location_2300] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Location_2300] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Location_2300] 设置权限成功"); + expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Location_2300] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Location_2300] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Location_2300] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_2300] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponents(ON.type('LocationButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Location_2300] button is:" + JSON.stringify(button)); + await button[0].click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_2300] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Location_2400', 0, async function (done) { + console.debug('====>[Test_Security_Button_Location_2400] START===='); + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyLocation3'); + let obj = JSON.parse(strJsonNew); + console.debug("====>component obj.$attrs.text:" + obj.$attrs.text); + expect(obj.$attrs.text).assertEqual(2); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Location_2400] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Location_2400] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Location_2400] 设置权限成功"); + expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Location_2400] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Location_2400] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Location_2400] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_2400] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponents(ON.type('LocationButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Location_2400] button is:" + JSON.stringify(button)); + await button[1].click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_2400] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Location_2500', 0, async function (done) { + console.debug('====>[Test_Security_Button_Location_2500] START===='); + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyLocation4'); + let obj = JSON.parse(strJsonNew); + console.debug("====>component obj.$attrs.text:" + obj.$attrs.text); + expect(obj.$attrs.text).assertEqual(3); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Location_2500] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Location_2500] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Location_2500] 设置权限成功"); + expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Location_2500] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Location_2500] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Location_2500] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_2500] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponents(ON.type('LocationButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Location_2500] button is:" + JSON.stringify(button)); + await button[2].click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_2500] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Location_2600', 0, async function (done) { + console.debug('====>[Test_Security_Button_Location_2600] START===='); + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyLocation5'); + let obj = JSON.parse(strJsonNew); + console.debug("====>component obj.$attrs.text:" + obj.$attrs.text); + expect(obj.$attrs.text).assertEqual(4); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Location_2600] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Location_2600] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Location_2600] 设置权限成功"); + expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Location_2600] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Location_2600] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Location_2600] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_2600] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponents(ON.type('LocationButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Location_2600] button is:" + JSON.stringify(button)); + await button[3].click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_2600] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Location_2700', 0, async function (done) { + console.debug('====>[Test_Security_Button_Location_2700] START===='); + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyLocation6'); + let obj = JSON.parse(strJsonNew); + console.debug("====>component obj.$attrs.text:" + obj.$attrs.text); + expect(obj.$attrs.text).assertEqual(5); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Location_2700] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Location_2700] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Location_2700] 设置权限成功"); + expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Location_2700] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Location_2700] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Location_2700] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_2700] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponents(ON.type('LocationButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Location_2700] button is:" + JSON.stringify(button)); + await button[4].click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_2700] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Location_2800', 0, async function (done) { + console.debug('====>[Test_Security_Button_Location_2800] START===='); + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyLocation7'); + let obj = JSON.parse(strJsonNew); + console.debug("====>component obj.$attrs.text:" + obj.$attrs.text); + expect(obj.$attrs.text).assertEqual(6); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Location_2800] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Location_2800] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Location_2800] 设置权限成功"); + expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Location_2800] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Location_2800] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Location_2800] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_2800] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponents(ON.type('LocationButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Location_2800] button is:" + JSON.stringify(button)); + await button[5].click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_2800] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Location_2900', 0, async function (done) { + console.debug('====>[Test_Security_Button_Location_2900] START===='); + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyLocation8'); + let obj = JSON.parse(strJsonNew); + console.debug("====>component obj.$attrs.text:" + obj.$attrs.text); + expect(obj.$attrs.text).assertEqual(7); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Location_2900] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Location_2900] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Location_2900] 设置权限成功"); + expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Location_2900] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Location_2900] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Location_2900] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_2900] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponents(ON.type('LocationButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Location_2900] button is:" + JSON.stringify(button)); + await button[6].click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_2900] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Location_3000', 0, async function (done) { + console.debug('====>[Test_Security_Button_Location_3000] START===='); + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyLocation9'); + let obj = JSON.parse(strJsonNew); + console.debug("====>component obj.$attrs.text:" + obj.$attrs.text); + expect(obj.$attrs.text).assertEqual(8); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Location_3000] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Location_3000] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Location_3000] 设置权限成功"); + expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Location_3000] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Location_3000] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Location_3000] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_3000] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponents(ON.type('LocationButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Location_3000] button is:" + JSON.stringify(button)); + await button[7].click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_3000] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Location_3100', 0, async function (done) { + console.debug('====>[Test_Security_Button_Location_3100] START===='); + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyLocation10'); + let obj = JSON.parse(strJsonNew); + console.debug("====>component obj.$attrs.text:" + obj.$attrs.text); + expect(obj.$attrs.text).assertEqual(9); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Location_3100] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Location_3100] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Location_3100] 设置权限成功"); + expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Location_3100] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Location_3100] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Location_3100] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_3100] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponents(ON.type('LocationButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Location_3100] button is:" + JSON.stringify(button)); + await button[8].click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_3100] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Location_3200', 0, async function (done) { + console.debug('====>[Test_Security_Button_Location_3200] START===='); + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyLocation11'); + let obj = JSON.parse(strJsonNew); + console.debug("====>component obj.$attrs.text:" + obj.$attrs.text); + expect(obj.$attrs.text).assertEqual(10); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Location_3200] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Location_3200] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Location_3200] 设置权限成功"); + expect(clickData.data.clickResult == LocationButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Location_3200] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Location_3200] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Location_3200] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_3200] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponents(ON.type('LocationButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Location_3200] button is:" + JSON.stringify(button)); + await button[9].click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Location_3200] clickSecComponent err : " + JSON.stringify(err)); + } + }); + }) +} \ No newline at end of file diff --git a/test/security_component/entry/src/main/ets/test/PasteComponentTest.test.ets b/test/security_component/entry/src/main/ets/test/PasteComponentTest.test.ets new file mode 100644 index 0000000..fbf134d --- /dev/null +++ b/test/security_component/entry/src/main/ets/test/PasteComponentTest.test.ets @@ -0,0 +1,1923 @@ +/** + * 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" +import router from '@ohos.router'; +import events_emitter from '@ohos.events.emitter'; +import { Driver, ON } from '@ohos.UiTest' +import Utils from './Utils'; + +export default function pasteComponentTest() { + describe('pasteComponentTest', function () { + beforeAll(async function (done) { + let options = { + url: 'MainAbility/pages/pasteButton', + } + try { + router.clear(); + let pages = router.getState(); + console.debug("====>pasteComponentTest get state success " + JSON.stringify(pages)); + if (!("pasteButton" == pages.name)) { + console.debug("====>pasteComponentTest get state success " + JSON.stringify(pages.name)); + let result = await router.pushUrl(options); + await Utils.sleep(2000); + console.debug("====>pasteComponentTest push page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("====>pasteComponentTest push page error: " + err); + } + done() + }); + + afterEach(async function () { + await Utils.sleep(1000); + console.debug("====>pasteComponentTest after each called"); + }); + + it('Test_Security_Button_Paste_0100', 0, async function (done) { + console.debug('====>[Test_Security_Button_Paste_0100] START'); + let strJson = getInspectorByKey('keyPaste'); + let obj = JSON.parse(strJson); + expect(obj.$attrs.icon).assertEqual(0); + expect(obj.$attrs.text).assertEqual(0); + expect(obj.$attrs.buttonType).assertEqual(0); + expect(obj.$attrs.iconSize).assertEqual('16.00vp'); + expect(obj.$attrs.layoutDirection).assertEqual(0); + expect(obj.$attrs.position.x).assertEqual('0.00vp'); + expect(obj.$attrs.position.y).assertEqual('0.00vp'); + expect(obj.$attrs.markAnchor.x).assertEqual('0.00vp'); + expect(obj.$attrs.markAnchor.y).assertEqual('0.00vp'); + expect(obj.$attrs.offset.x).assertEqual('0.00vp'); + expect(obj.$attrs.offset.y).assertEqual('0.00vp'); + expect(obj.$attrs.fontSize).assertEqual('16.00fp'); + expect(obj.$attrs.fontStyle).assertEqual(0); + expect(obj.$attrs.fontWeight).assertEqual('FontWeight.Medium'); + expect(obj.$attrs.fontFamily).assertEqual('HarmonyOS Sans'); + expect(obj.$attrs.fontColor).assertEqual('#FFFFFFFF'); + expect(obj.$attrs.iconColor).assertEqual('#FFFFFFFF'); + expect(obj.$attrs.backgroundColor).assertEqual('#FF007DFF'); + expect(obj.$attrs.borderStyle).assertEqual(1); + expect(obj.$attrs.borderWidth).assertEqual('0.00vp'); + expect(obj.$attrs.borderColor).assertEqual('#FFFFFFFF'); + expect(obj.$attrs.borderRadius).assertEqual('0.00vp'); + expect(obj.$attrs.padding.left).assertEqual('24.00vp'); + expect(obj.$attrs.padding.right).assertEqual('24.00vp'); + expect(obj.$attrs.padding.top).assertEqual('8.00vp'); + expect(obj.$attrs.padding.bottom).assertEqual('8.00vp'); + expect(obj.$attrs.textIconSpace).assertEqual('4.00vp'); + await Utils.sleep(1000); + try { + let clickCallback = async (clickData) => { + console.debug("====>[Test_Security_Button_Paste_0100] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Paste_0100] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Paste_0100] 设置权限成功"); + expect(clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS).assertTrue(); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Paste_0100] END===="); + done() + } else { + console.debug("====>[Test_Security_Button_Paste_0100] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Paste_0100] END===="); + done() + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_0100] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('PasteButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Paste_0100] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_0100] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + + it('Test_Security_Button_Paste_0200', 0, async function (done) { + console.debug('====>[Test_Security_Button_Paste_0200] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": SecurityComponentLayoutDirection.VERTICAL, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Paste_0200] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_0200] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyPaste'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.layoutDirection).assertEqual(SecurityComponentLayoutDirection.VERTICAL); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Paste_0200] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Paste_0200] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Paste_0200] 设置权限成功"); + expect(clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Paste_0200] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Paste_0200] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Paste_0200] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_0200] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('PasteButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Paste_0200] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_0200] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Paste_0300', 0, async function (done) { + console.debug('====>[Test_Security_Button_Paste_0300] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 150, + "positionY": 20, + "anchorX": 20, + "anchorY": 20, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Paste_0300] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_0300] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyPaste'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.position.x).assertEqual('150.00vp'); + expect(obj.$attrs.position.y).assertEqual('20.00vp'); + expect(obj.$attrs.markAnchor.x).assertEqual('20.00vp'); + expect(obj.$attrs.markAnchor.y).assertEqual('20.00vp'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Paste_0300] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Paste_0300] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Paste_0300] 设置权限成功"); + expect(clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Paste_0300] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Paste_0300] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Paste_0300] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_0300] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('PasteButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Paste_0300] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_0300] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + + it('Test_Security_Button_Paste_0400', 0, async function (done) { + console.debug('====>[Test_Security_Button_Paste_0400] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 1, + "positionX": 0, + "positionY": 0, + "anchorX": 20, + "anchorY": 20, + "offsetX": 100, + "offsetY": 100, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Paste_0400] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_0400] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyPaste1'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.offset.x).assertEqual('100.00vp'); + expect(obj.$attrs.offset.y).assertEqual('100.00vp'); + expect(obj.$attrs.markAnchor.x).assertEqual('20.00vp'); + expect(obj.$attrs.markAnchor.y).assertEqual('20.00vp'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Paste_0400] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Paste_0400] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Paste_0400] 设置权限成功"); + expect(clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Paste_0400] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Paste_0400] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Paste_0400] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_0400] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponents(ON.type('PasteButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Paste_0400] button is:" + JSON.stringify(button)); + await button[1].click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_0400] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Paste_0500', 0, async function (done) { + console.debug('====>[Test_Security_Button_Paste_0500] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Italic, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Paste_0500] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_0500] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyPaste'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.fontStyle).assertEqual(1); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Paste_0500] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Paste_0500] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Paste_0500] 设置权限成功"); + expect(clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Paste_0500] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Paste_0500] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Paste_0500] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_0500] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('PasteButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Paste_0500] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_0500] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Paste_0600', 0, async function (done) { + console.debug('====>[Test_Security_Button_Paste_0600] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Lighter, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Paste_0600] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_0600] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyPaste'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.fontWeight).assertEqual('FontWeight.Lighter'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Paste_0600] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Paste_0600] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Paste_0600] 设置权限成功"); + expect(clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Paste_0600] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Paste_0600] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Paste_0600] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_0600] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('PasteButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Paste_0600] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_0600] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Paste_0700', 0, async function (done) { + console.debug('====>[Test_Security_Button_Paste_0700] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Normal, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Paste_0700] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_0700] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyPaste'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.fontWeight).assertEqual('FontWeight.Normal'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Paste_0700] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Paste_0700] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Paste_0700] 设置权限成功"); + expect(clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Paste_0700] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Paste_0700] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Paste_0700] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_0700] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('PasteButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Paste_0700] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_0700] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Paste_0800', 0, async function (done) { + console.debug('====>[Test_Security_Button_Paste_0800] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Regular, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Paste_0800] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_0800] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyPaste'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.fontWeight).assertEqual('FontWeight.Regular'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Paste_0800] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Paste_0800] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Paste_0800] 设置权限成功"); + expect(clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Paste_0800] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Paste_0800] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Paste_0800] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_0800] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('PasteButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Paste_0800] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_0800] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Paste_0900', 0, async function (done) { + console.debug('====>[Test_Security_Button_Paste_0900] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Bold, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Paste_0900] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_0900] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyPaste'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.fontWeight).assertEqual('FontWeight.Bold'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Paste_0900] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Paste_0900] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Paste_0900] 设置权限成功"); + expect(clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Paste_0900] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Paste_0900] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Paste_0900] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_0900] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('PasteButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Paste_0900] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_0900] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Paste_1000', 0, async function (done) { + console.debug('====>[Test_Security_Button_Paste_1000] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Bolder, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Paste_1000] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_1000] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyPaste'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.fontWeight).assertEqual('FontWeight.Bolder'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Paste_1000] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Paste_1000] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Paste_1000] 设置权限成功"); + expect(clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Paste_1000] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Paste_1000] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Paste_1000] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_1000] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('PasteButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Paste_1000] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_1000] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Paste_1100', 0, async function (done) { + console.debug('====>[Test_Security_Button_Paste_1100] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dotted, + "borderWid": 5, + "borderCol": 0xffffffff, + "borderRad": 5, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Paste_1100] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_1100] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyPaste'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.borderStyle).assertEqual(2); + expect(obj.$attrs.borderWidth).assertEqual('5.00vp'); + expect(obj.$attrs.borderColor).assertEqual('#FFFFFFFF'); + expect(obj.$attrs.borderRadius).assertEqual('5.00vp'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Paste_1100] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Paste_1100] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Paste_1100] 设置权限成功"); + expect(clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Paste_1100] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Paste_1100] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Paste_1100] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_1100] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('PasteButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Paste_1100] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_1100] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Paste_1200', 0, async function (done) { + console.debug('====>[Test_Security_Button_Paste_1200] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 5, + "borderCol": 0xffffffff, + "borderRad": 5, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Paste_1200] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_1200] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyPaste'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.borderStyle).assertEqual(1); + expect(obj.$attrs.borderWidth).assertEqual('5.00vp'); + expect(obj.$attrs.borderColor).assertEqual('#FFFFFFFF'); + expect(obj.$attrs.borderRadius).assertEqual('5.00vp'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Paste_1200] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Paste_1200] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Paste_1200] 设置权限成功"); + expect(clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Paste_1200] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Paste_1200] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Paste_1200] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_1200] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('PasteButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Paste_1200] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_1200] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Paste_1300', 0, async function (done) { + console.debug('====>[Test_Security_Button_Paste_1300] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Solid, + "borderWid": 5, + "borderCol": 0xffffffff, + "borderRad": 5, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Paste_1300] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_1300] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyPaste'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.borderStyle).assertEqual(0); + expect(obj.$attrs.borderWidth).assertEqual('5.00vp'); + expect(obj.$attrs.borderColor).assertEqual('#FFFFFFFF'); + expect(obj.$attrs.borderRadius).assertEqual('5.00vp'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Paste_1300] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Paste_1300] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Paste_1300] 设置权限成功"); + expect(clickData.data.clickResult == PasteButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Paste_1300] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Paste_1300] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Paste_1300] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_1300] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('PasteButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Paste_1300] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_1300] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Paste_1400', 0, async function (done) { + console.debug('====>[Test_Security_Button_Paste_1400] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 200, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Paste_1400] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_1400] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyPaste1'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.offset.x).assertEqual('200.00vp'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Paste_1400] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Paste_1400] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == PasteButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { + console.debug("====>[Test_Security_Button_Paste_1400] ERR CASE 成功"); + expect(clickData.data.clickResult == PasteButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); + console.debug("====>[Test_Security_Button_Paste_1400] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Paste_1400] ERR CASE 失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Paste_1400] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_1400] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponents(ON.type('PasteButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Paste_1400] button is:" + JSON.stringify(button)); + await button[1].click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_1400] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Paste_1500', 0, async function (done) { + console.debug('====>[Test_Security_Button_Paste_1500] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": -200, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Paste_1500] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_1500] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyPaste1'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.offset.x).assertEqual('-200.00vp'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Paste_1500] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Paste_1500] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == PasteButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { + console.debug("====>[Test_Security_Button_Paste_1500] ERR CASE 成功"); + expect(clickData.data.clickResult == PasteButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); + console.debug("====>[Test_Security_Button_Paste_1500] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Paste_1500] ERR CASE 失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Paste_1500] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_1500] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponents(ON.type('PasteButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Paste_1500] button is:" + JSON.stringify(button)); + await button[1].click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_1500] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Paste_1600', 0, async function (done) { + console.debug('====>[Test_Security_Button_Paste_1600] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 150, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Paste_1600] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_1600] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyPaste'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.iconSize).assertEqual('150.00vp'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Paste_1600] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Paste_1600] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == PasteButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { + console.debug("====>[Test_Security_Button_Paste_1600] ERR CASE 成功"); + expect(clickData.data.clickResult == PasteButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); + console.debug("====>[Test_Security_Button_Paste_1600] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Paste_1600] ERR CASE 失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Paste_1600] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_1600] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('PasteButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Paste_1600] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_1600] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Paste_1700', 0, async function (done) { + console.debug('====>[Test_Security_Button_Paste_1700] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0x10ff0000, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Paste_1700] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_1700] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyPaste'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.iconColor).assertEqual('#10FF0000'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Paste_1700] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Paste_1700] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == PasteButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { + console.debug("====>[Test_Security_Button_Paste_1700] ERR CASE 成功"); + expect(clickData.data.clickResult == PasteButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); + console.debug("====>[Test_Security_Button_Paste_1700] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Paste_1700] ERR CASE 失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Paste_1700] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_1700] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('PasteButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Paste_1700] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_1700] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Paste_1800', 0, async function (done) { + console.debug('====>[Test_Security_Button_Paste_1800] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 20, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xfffa0050, + "bgColor": 0xffff0000, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Paste_1800] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_1800] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyPaste'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.buttonType).assertEqual(0); + expect(obj.$attrs.iconSize).assertEqual('20.00vp'); + expect(obj.$attrs.iconColor).assertEqual('#FFFA0050'); + expect(obj.$attrs.backgroundColor).assertEqual('#FFFF0000'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Paste_1800] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Paste_1800] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == PasteButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { + console.debug("====>[Test_Security_Button_Paste_1800] ERR CASE 成功"); + expect(clickData.data.clickResult == PasteButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); + console.debug("====>[Test_Security_Button_Paste_1800] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Paste_1800] ERR CASE 失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Paste_1800] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_1800] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('PasteButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Paste_1800] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_1800] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Paste_1900', 0, async function (done) { + console.debug('====>[Test_Security_Button_Paste_1900] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 1, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 20, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Paste_1900] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_1900] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyPaste'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.iconSize).assertEqual('1.00vp'); + expect(obj.$attrs.fontSize).assertEqual('20.00fp'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Paste_1900] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Paste_1900] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == PasteButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { + console.debug("====>[Test_Security_Button_Paste_1900] ERR CASE 成功"); + expect(clickData.data.clickResult == PasteButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); + console.debug("====>[Test_Security_Button_Paste_1900] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Paste_1900] ERR CASE 失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Paste_1900] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_1900] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('PasteButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Paste_1900] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_1900] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Paste_2000', 0, async function (done) { + console.debug('====>[Test_Security_Button_Paste_2000] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor":Color.Transparent, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Paste_2000] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_2000] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyPaste'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.iconColor).assertEqual('#00000000'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Paste_2000] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Paste_2000] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == PasteButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { + console.debug("====>[Test_Security_Button_Paste_2000] ERR CASE 成功"); + expect(clickData.data.clickResult == PasteButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); + console.debug("====>[Test_Security_Button_Paste_2000] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Paste_2000] ERR CASE 失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Paste_2000] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_2000] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('PasteButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Paste_2000] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_2000] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Paste_2100', 0, async function (done) { + console.debug('====>[Test_Security_Button_Paste_2100] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": Color.Transparent, + "iconColor":0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Paste_2100] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_2100] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyPaste'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.fontColor).assertEqual('#00000000'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Paste_2100] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Paste_2100] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == PasteButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { + console.debug("====>[Test_Security_Button_Paste_2100] ERR CASE 成功"); + expect(clickData.data.clickResult == PasteButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); + console.debug("====>[Test_Security_Button_Paste_2100] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Paste_2100] ERR CASE 失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Paste_2100] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_2100] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('PasteButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Paste_2100] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_2100] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Paste_2200', 0, async function (done) { + console.debug('====>[Test_Security_Button_Paste_2200] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 20, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor":0xffffffff, + "bgColor": Color.Transparent, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Paste_2200] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_2200] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keyPaste'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.backgroundColor).assertEqual('#00000000'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Paste_2200] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Paste_2200] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == PasteButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { + console.debug("====>[Test_Security_Button_Paste_2200] ERR CASE 成功"); + expect(clickData.data.clickResult == PasteButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); + console.debug("====>[Test_Security_Button_Paste_2200] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Paste_2200] ERR CASE 失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Paste_2200] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_2200] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('PasteButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Paste_2200] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Paste_2200] clickSecComponent err : " + JSON.stringify(err)); + } + }); + }) +} \ No newline at end of file diff --git a/test/security_component/entry/src/main/ets/test/SaveComponentTest.test.ets b/test/security_component/entry/src/main/ets/test/SaveComponentTest.test.ets new file mode 100644 index 0000000..112b6bb --- /dev/null +++ b/test/security_component/entry/src/main/ets/test/SaveComponentTest.test.ets @@ -0,0 +1,1926 @@ +/** + * 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" +import router from '@ohos.router'; +import events_emitter from '@ohos.events.emitter'; +import { Driver, ON } from '@ohos.UiTest' +import Utils from './Utils'; + +export default function saveComponentTest() { + describe('saveComponentTest', function () { + beforeAll(async function (done) { + let options = { + url: 'MainAbility/pages/saveButton', + } + try { + router.clear(); + let pages = router.getState(); + console.debug("====>saveComponentTest get state success " + JSON.stringify(pages)); + if (!("saveButton" == pages.name)) { + console.debug("====>saveComponentTest get state success " + JSON.stringify(pages.name)); + let result = await router.pushUrl(options); + await Utils.sleep(2000); + console.debug("====>saveComponentTest push page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("====>saveComponentTest push page error: " + err); + } + done() + }); + + afterEach(async function () { + await Utils.sleep(1000); + console.debug("====>saveComponentTest after each called"); + }); + + it('Test_Security_Button_Save_0100', 0, async function (done) { + console.debug('====>[Test_Security_Button_Save_0100] START===='); + let strJson = getInspectorByKey('keySave'); + let obj = JSON.parse(strJson); + expect(obj.$attrs.icon).assertEqual(0); + expect(obj.$attrs.text).assertEqual(0); + expect(obj.$attrs.buttonType).assertEqual(0); + expect(obj.$attrs.iconSize).assertEqual('16.00vp'); + expect(obj.$attrs.layoutDirection).assertEqual(0); + expect(obj.$attrs.position.x).assertEqual('0.00vp'); + expect(obj.$attrs.position.y).assertEqual('0.00vp'); + expect(obj.$attrs.markAnchor.x).assertEqual('0.00vp'); + expect(obj.$attrs.markAnchor.y).assertEqual('0.00vp'); + expect(obj.$attrs.offset.x).assertEqual('0.00vp'); + expect(obj.$attrs.offset.y).assertEqual('0.00vp'); + expect(obj.$attrs.fontSize).assertEqual('16.00fp'); + expect(obj.$attrs.fontStyle).assertEqual(0); + expect(obj.$attrs.fontWeight).assertEqual('FontWeight.Medium'); + expect(obj.$attrs.fontFamily).assertEqual('HarmonyOS Sans'); + expect(obj.$attrs.fontColor).assertEqual('#FFFFFFFF'); + expect(obj.$attrs.iconColor).assertEqual('#FFFFFFFF'); + expect(obj.$attrs.backgroundColor).assertEqual('#FF007DFF'); + expect(obj.$attrs.borderStyle).assertEqual(1); + expect(obj.$attrs.borderWidth).assertEqual('0.00vp'); + expect(obj.$attrs.borderColor).assertEqual('#FFFFFFFF'); + expect(obj.$attrs.borderRadius).assertEqual('0.00vp'); + expect(obj.$attrs.padding.left).assertEqual('24.00vp'); + expect(obj.$attrs.padding.right).assertEqual('24.00vp'); + expect(obj.$attrs.padding.top).assertEqual('8.00vp'); + expect(obj.$attrs.padding.bottom).assertEqual('8.00vp'); + expect(obj.$attrs.textIconSpace).assertEqual('4.00vp'); + await Utils.sleep(1000); + try { + let clickCallback = async (clickData) => { + console.debug("====>[Test_Security_Button_Save_0100] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Save_0100] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Save_0100] 设置权限成功"); + expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); + await Utils.sleep(500); + let driver = Driver.create(); + let textComponent = await driver.findComponent(ON.type('Button')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Save_0100] textComponent is:" + JSON.stringify(textComponent)); + await textComponent.click(); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Save_0100] END===="); + done() + } else { + console.debug("====>[Test_Security_Button_Save_0100] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Save_0100] END===="); + done() + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_0100] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('SaveButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Save_0100] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_0100] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Save_0200', 0, async function (done) { + console.debug('====>[Test_Security_Button_Save_0200] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": SecurityComponentLayoutDirection.VERTICAL, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Save_0200] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_0200] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keySave'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.layoutDirection).assertEqual(SecurityComponentLayoutDirection.VERTICAL); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Save_0200] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Save_0200] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Save_0200] 设置权限成功"); + expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Save_0200] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Save_0200] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Save_0200] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_0200] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('SaveButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Save_0200] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_0200] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Save_0300', 0, async function (done) { + console.debug('====>[Test_Security_Button_Save_0300] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 150, + "positionY": 20, + "anchorX": 20, + "anchorY": 20, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Save_0300] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_0300] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keySave'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.position.x).assertEqual('150.00vp'); + expect(obj.$attrs.position.y).assertEqual('20.00vp'); + expect(obj.$attrs.markAnchor.x).assertEqual('20.00vp'); + expect(obj.$attrs.markAnchor.y).assertEqual('20.00vp'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Save_0300] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Save_0300] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Save_0300] 设置权限成功"); + expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Save_0300] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Save_0300] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Save_0300] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_0300] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('SaveButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Save_0300] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_0300] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Save_0400', 0, async function (done) { + console.debug('====>[Test_Security_Button_Save_0400] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 1, + "positionX": 0, + "positionY": 0, + "anchorX": 20, + "anchorY": 20, + "offsetX": 100, + "offsetY": 100, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Save_0400] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_0400] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keySave1'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.offset.x).assertEqual('100.00vp'); + expect(obj.$attrs.offset.y).assertEqual('100.00vp'); + expect(obj.$attrs.markAnchor.x).assertEqual('20.00vp'); + expect(obj.$attrs.markAnchor.y).assertEqual('20.00vp'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Save_0400] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Save_0400] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Save_0400] 设置权限成功"); + expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Save_0400] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Save_0400] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Save_0400] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_0400] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponents(ON.type('SaveButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Save_0400] button is:" + JSON.stringify(button)); + await button[1].click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_0400] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Save_0500', 0, async function (done) { + console.debug('====>[Test_Security_Button_Save_0500] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Italic, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Save_0500] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_0500] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keySave'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.fontStyle).assertEqual(1); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Save_0500] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Save_0500] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Save_0500] 设置权限成功"); + expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Save_0500] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Save_0500] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Save_0500] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_0500] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('SaveButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Save_0500] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_0500] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Save_0600', 0, async function (done) { + console.debug('====>[Test_Security_Button_Save_0600] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Lighter, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Save_0600] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_0600] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keySave'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.fontWeight).assertEqual('FontWeight.Lighter'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Save_0600] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Save_0600] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Save_0600] 设置权限成功"); + expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Save_0600] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Save_0600] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Save_0600] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_0600] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('SaveButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Save_0600] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_0600] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Save_0700', 0, async function (done) { + console.debug('====>[Test_Security_Button_Save_0700] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Normal, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Save_0700] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_0700] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keySave'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.fontWeight).assertEqual('FontWeight.Normal'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Save_0700] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Save_0700] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Save_0700] 设置权限成功"); + expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Save_0700] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Save_0700] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Save_0700] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_0700] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('SaveButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Save_0700] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_0700] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Save_0800', 0, async function (done) { + console.debug('====>[Test_Security_Button_Save_0800] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Regular, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Save_0800] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_0800] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keySave'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.fontWeight).assertEqual('FontWeight.Regular'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Save_0800] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Save_0800] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Save_0800] 设置权限成功"); + expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Save_0800] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Save_0800] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Save_0800] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_0800] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('SaveButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Save_0800] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_0800] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Save_0900', 0, async function (done) { + console.debug('====>[Test_Security_Button_Save_0900] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Bold, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Save_0900] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_0900] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keySave'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.fontWeight).assertEqual('FontWeight.Bold'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Save_0900] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Save_0900] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Save_0900] 设置权限成功"); + expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Save_0900] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Save_0900] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Save_0900] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_0900] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('SaveButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Save_0900] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_0900] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Save_1000', 0, async function (done) { + console.debug('====>[Test_Security_Button_Save_1000] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Bolder, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Save_1000] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_1000] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keySave'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.fontWeight).assertEqual('FontWeight.Bolder'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Save_1000] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Save_1000] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Save_1000] 设置权限成功"); + expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Save_1000] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Save_1000] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Save_1000] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_1000] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('SaveButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Save_1000] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_1000] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Save_1100', 0, async function (done) { + console.debug('====>[Test_Security_Button_Save_1100] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dotted, + "borderWid": 5, + "borderCol": 0xffffffff, + "borderRad": 5, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Save_1100] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_1100] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keySave'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.borderStyle).assertEqual(2); + expect(obj.$attrs.borderWidth).assertEqual('5.00vp'); + expect(obj.$attrs.borderColor).assertEqual('#FFFFFFFF'); + expect(obj.$attrs.borderRadius).assertEqual('5.00vp'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Save_1100] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Save_1100] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Save_1100] 设置权限成功"); + expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Save_1100] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Save_1100] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Save_1100] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_1100] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('SaveButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Save_1100] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_1100] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Save_1200', 0, async function (done) { + console.debug('====>[Test_Security_Button_Save_1200] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 5, + "borderCol": 0xffffffff, + "borderRad": 5, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Save_1200] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_1200] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keySave'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.borderStyle).assertEqual(1); + expect(obj.$attrs.borderWidth).assertEqual('5.00vp'); + expect(obj.$attrs.borderColor).assertEqual('#FFFFFFFF'); + expect(obj.$attrs.borderRadius).assertEqual('5.00vp'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Save_1200] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Save_1200] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Save_1200] 设置权限成功"); + expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Save_1200] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Save_1200] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Save_1200] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_1200] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('SaveButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Save_1200] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_1200] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Save_1300', 0, async function (done) { + console.debug('====>[Test_Security_Button_Save_1300] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Solid, + "borderWid": 5, + "borderCol": 0xffffffff, + "borderRad": 5, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Save_1300] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_1300] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keySave'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.borderStyle).assertEqual(0); + expect(obj.$attrs.borderWidth).assertEqual('5.00vp'); + expect(obj.$attrs.borderColor).assertEqual('#FFFFFFFF'); + expect(obj.$attrs.borderRadius).assertEqual('5.00vp'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Save_1300] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Save_1300] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Save_1300] 设置权限成功"); + expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Save_1300] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Save_1300] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Save_1300] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_1300] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('SaveButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Save_1300] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_1300] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Save_1400', 0, async function (done) { + console.debug('====>[Test_Security_Button_Save_1400] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 200, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Save_1400] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_1400] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keySave1'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.offset.x).assertEqual('200.00vp'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Save_1400] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Save_1400] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == SaveButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { + console.debug("====>[Test_Security_Button_Save_1400] 设置权限成功"); + expect(clickData.data.clickResult == SaveButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); + console.debug("====>[Test_Security_Button_Save_1400] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Save_1400] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Save_1400] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_1400] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponents(ON.type('SaveButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Save_1400] button is:" + JSON.stringify(button)); + await button[1].click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_1400] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Save_1500', 0, async function (done) { + console.debug('====>[Test_Security_Button_Save_1500] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": -200, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Save_1500] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_1500] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keySave1'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.offset.x).assertEqual('-200.00vp'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Save_1500] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Save_1500] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == SaveButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { + console.debug("====>[Test_Security_Button_Save_1500] 设置权限成功"); + expect(clickData.data.clickResult == SaveButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); + console.debug("====>[Test_Security_Button_Save_1500] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Save_1500] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Save_1500] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_1500] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponents(ON.type('SaveButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Save_1500] button is:" + JSON.stringify(button)); + await button[1].click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_1500] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Save_1600', 0, async function (done) { + console.debug('====>[Test_Security_Button_Save_1600] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 150, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Save_1600] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_1600] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keySave'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.iconSize).assertEqual('150.00vp'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Save_1600] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Save_1600] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == SaveButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { + console.debug("====>[Test_Security_Button_Save_1600] 设置权限成功"); + expect(clickData.data.clickResult == SaveButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); + console.debug("====>[Test_Security_Button_Save_1600] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Save_1600] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Save_1600] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_1600] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('SaveButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Save_1600] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_1600] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Save_1700', 0, async function (done) { + console.debug('====>[Test_Security_Button_Save_1700] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0x10ff0000, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Save_1700] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_1700] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keySave'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.iconColor).assertEqual('#10FF0000'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Save_1700] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Save_1700] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == SaveButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { + console.debug("====>[Test_Security_Button_Save_1700] 设置权限成功"); + expect(clickData.data.clickResult == SaveButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); + console.debug("====>[Test_Security_Button_Save_1700] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Save_1700] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Save_1700] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_1700] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('SaveButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Save_1700] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_1700] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Save_1800', 0, async function (done) { + console.debug('====>[Test_Security_Button_Save_1800] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 20, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xfffa0050, + "bgColor": 0xffff0000, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Save_1800] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_1800] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keySave'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.iconSize).assertEqual('20.00vp'); + expect(obj.$attrs.iconColor).assertEqual('#FFFA0050'); + expect(obj.$attrs.backgroundColor).assertEqual('#FFFF0000'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Save_1800] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Save_1800] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == SaveButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { + console.debug("====>[Test_Security_Button_Save_1800] 设置权限成功"); + expect(clickData.data.clickResult == SaveButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); + console.debug("====>[Test_Security_Button_Save_1800] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Save_1800] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Save_1800] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_1800] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('SaveButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Save_1800] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_1800] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Save_1900', 0, async function (done) { + console.debug('====>[Test_Security_Button_Save_1900] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 1, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 20, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Save_1900] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_1900] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keySave'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.iconSize).assertEqual('1.00vp'); + expect(obj.$attrs.fontSize).assertEqual('20.00fp'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Save_1900] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Save_1900] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == SaveButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { + console.debug("====>[Test_Security_Button_Save_1900] 设置权限成功"); + expect(clickData.data.clickResult == SaveButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); + console.debug("====>[Test_Security_Button_Save_1900] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Save_1900] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Save_1900] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_1900] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('SaveButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Save_1900] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_1900] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Save_2000', 0, async function (done) { + console.debug('====>[Test_Security_Button_Save_2000] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": Color.Transparent, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Save_2000] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_2000] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keySave'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.iconColor).assertEqual('#00000000'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Save_2000] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Save_2000] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == SaveButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { + console.debug("====>[Test_Security_Button_Save_2000] 设置权限成功"); + expect(clickData.data.clickResult == SaveButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); + console.debug("====>[Test_Security_Button_Save_2000] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Save_2000] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Save_2000] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_2000] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('SaveButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Save_2000] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_2000] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Save_2100', 0, async function (done) { + console.debug('====>[Test_Security_Button_Save_2100] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 16, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": Color.Transparent, + "iconColor": 0xffffffff, + "bgColor": 0xff007dff, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Save_2100] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_2100] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keySave'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.fontColor).assertEqual('#00000000'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Save_2100] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Save_2100] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == SaveButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { + console.debug("====>[Test_Security_Button_Save_2100] 设置权限成功"); + expect(clickData.data.clickResult == SaveButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); + console.debug("====>[Test_Security_Button_Save_2100] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Save_2100] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Save_2100] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_2100] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('SaveButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Save_2100] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_2100] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Save_2200', 0, async function (done) { + console.debug('====>[Test_Security_Button_Save_2200] START===='); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "icon": 0, + "textType": 0, + "bgType": ButtonType.Normal, + "iconSize": 16, + "direct": 0, + "positionX": 0, + "positionY": 0, + "anchorX": 0, + "anchorY": 0, + "offsetX": 0, + "offsetY": 0, + "fontSize": 20, + "fontStyle": FontStyle.Normal, + "fontWeight": FontWeight.Medium, + "fontFamily": 'HarmonyOS Sans', + "fontColor": 0xffffffff, + "iconColor": 0xffffffff, + "bgColor": Color.Transparent, + "borderSty": BorderStyle.Dashed, + "borderWid": 0, + "borderCol": 0xffffffff, + "borderRad": 0, + "left": 24, + "right": 24, + "top": 8, + "bottom": 8, + "middle": 4 + } + } + var innerEvent = { + eventId: 1, + priority: events_emitter.EventPriority.LOW + } + console.debug("====>[Test_Security_Button_Save_2200] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_2200] change component data error: " + err.message); + } + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keySave'); + let obj = JSON.parse(strJsonNew); + expect(obj.$attrs.backgroundColor).assertEqual('#00000000'); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Save_2200] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Save_2200] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == SaveButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED) { + console.debug("====>[Test_Security_Button_Save_2200] 设置权限成功"); + expect(clickData.data.clickResult == SaveButtonOnClickResult.TEMPORARY_AUTHORIZATION_FAILED).assertTrue(); + console.debug("====>[Test_Security_Button_Save_2200] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Save_2200] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Save_2200] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_2200] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponent(ON.type('SaveButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Save_2200] button is:" + JSON.stringify(button)); + await button.click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_2200] clickSecComponent err : " + JSON.stringify(err)); + } + }); + }) +} \ No newline at end of file diff --git a/test/security_component/entry/src/main/ets/test/SaveComponentTest_1.test.ets b/test/security_component/entry/src/main/ets/test/SaveComponentTest_1.test.ets new file mode 100644 index 0000000..6ac33ad --- /dev/null +++ b/test/security_component/entry/src/main/ets/test/SaveComponentTest_1.test.ets @@ -0,0 +1,358 @@ +/** + * 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" +import router from '@ohos.router'; +import events_emitter from '@ohos.events.emitter'; +import { Driver, ON } from '@ohos.UiTest' +import Utils from './Utils'; + +export default function saveComponentTest_1() { + describe('saveComponentTest_1', function () { + beforeAll(async function (done) { + let options = { + url: 'MainAbility/pages/saveButton_1', + } + try { + router.clear(); + let pages = router.getState(); + console.debug("====>saveComponentTest_1 get state success " + JSON.stringify(pages)); + if (!("saveButton_1" == pages.name)) { + console.debug("====>saveComponentTest_1 get state success " + JSON.stringify(pages.name)); + let result = await router.pushUrl(options); + await Utils.sleep(2000); + console.debug("====>saveComponentTest_1 push page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("====>saveComponentTest_1 push page error: " + err); + } + done() + }); + + afterEach(async function () { + await Utils.sleep(1000); + console.debug("====>saveComponentTest_1 after each called"); + }); + + it('Test_Security_Button_Save_2300', 0, async function (done) { + console.debug('====>[Test_Security_Button_Save_2300] START===='); + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keySave2'); + let obj = JSON.parse(strJsonNew); + console.debug("====>component obj.$attrs.icon:" + obj.$attrs.icon); + console.debug("====>component obj.$attrs.text:" + obj.$attrs.text); + expect(obj.$attrs.icon).assertEqual(1); + expect(obj.$attrs.text).assertEqual(1); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Save_2300] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Save_2300] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Save_2300] 设置权限成功"); + expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Save_2300] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Save_2300] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Save_2300] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_2300] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponents(ON.type('SaveButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Save_2300] button is:" + JSON.stringify(button)); + await button[0].click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_2300] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Save_2400', 0, async function (done) { + console.debug('====>[Test_Security_Button_Save_2400] START===='); + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keySave3'); + let obj = JSON.parse(strJsonNew); + console.debug("====>component obj.$attrs.text:" + obj.$attrs.text); + expect(obj.$attrs.text).assertEqual(2); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Save_2400] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Save_2400] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Save_2400] 设置权限成功"); + expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Save_2400] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Save_2400] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Save_2400] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_2400] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponents(ON.type('SaveButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Save_2400] button is:" + JSON.stringify(button)); + await button[1].click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_2400] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Save_2500', 0, async function (done) { + console.debug('====>[Test_Security_Button_Save_2500] START===='); + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keySave4'); + let obj = JSON.parse(strJsonNew); + console.debug("====>component obj.$attrs.text:" + obj.$attrs.text); + expect(obj.$attrs.text).assertEqual(3); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Save_2500] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Save_2500] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Save_2500] 设置权限成功"); + expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Save_2500] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Save_2500] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Save_2500] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_2500] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponents(ON.type('SaveButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Save_2500] button is:" + JSON.stringify(button)); + await button[2].click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_2500] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Save_2600', 0, async function (done) { + console.debug('====>[Test_Security_Button_Save_2600] START===='); + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keySave5'); + let obj = JSON.parse(strJsonNew); + console.debug("====>component obj.$attrs.text:" + obj.$attrs.text); + expect(obj.$attrs.text).assertEqual(4); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Save_2600] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Save_2600] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Save_2600] 设置权限成功"); + expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Save_2600] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Save_2600] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Save_2600] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_2600] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponents(ON.type('SaveButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Save_2600] button is:" + JSON.stringify(button)); + await button[3].click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_2600] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Save_2700', 0, async function (done) { + console.debug('====>[Test_Security_Button_Save_2700] START===='); + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keySave6'); + let obj = JSON.parse(strJsonNew); + console.debug("====>component obj.$attrs.text:" + obj.$attrs.text); + expect(obj.$attrs.text).assertEqual(5); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Save_2700] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Save_2700] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Save_2700] 设置权限成功"); + expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Save_2700] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Save_2700] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Save_2700] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_2700] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponents(ON.type('SaveButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Save_2700] button is:" + JSON.stringify(button)); + await button[4].click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_2700] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Save_2800', 0, async function (done) { + console.debug('====>[Test_Security_Button_Save_2800] START===='); + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keySave7'); + let obj = JSON.parse(strJsonNew); + console.debug("====>component obj.$attrs.text:" + obj.$attrs.text); + expect(obj.$attrs.text).assertEqual(6); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Save_2800] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Save_2800] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Save_2800] 设置权限成功"); + expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Save_2800] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Save_2800] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Save_2800] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_2800] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponents(ON.type('SaveButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Save_2800] button is:" + JSON.stringify(button)); + await button[5].click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_2800] clickSecComponent err : " + JSON.stringify(err)); + } + }); + + it('Test_Security_Button_Save_2900', 0, async function (done) { + console.debug('====>[Test_Security_Button_Save_2900] START===='); + await Utils.sleep(1000); + let strJsonNew = getInspectorByKey('keySave8'); + let obj = JSON.parse(strJsonNew); + console.debug("====>component obj.$attrs.text:" + obj.$attrs.text); + expect(obj.$attrs.text).assertEqual(7); + await Utils.sleep(1000); + try { + let clickCallback = (clickData) => { + console.debug("====>[Test_Security_Button_Save_2900] get clickEvent result is: " + JSON.stringify(clickEvent)); + console.debug("====>[Test_Security_Button_Save_2900] get clickData.data.clickResult is: " + JSON.stringify(clickData.data.clickResult)); + if (clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS) { + console.debug("====>[Test_Security_Button_Save_2900] 设置权限成功"); + expect(clickData.data.clickResult == SaveButtonOnClickResult.SUCCESS).assertTrue(); + console.debug("====>[Test_Security_Button_Save_2900] END===="); + done(); + } else { + console.debug("====>[Test_Security_Button_Save_2900] 设置权限失败"); + expect().assertFail() + console.debug("====>[Test_Security_Button_Save_2900] END===="); + done(); + } + } + var clickEvent = { + eventId: 2, + priority: events_emitter.EventPriority.LOW + } + events_emitter.once(clickEvent, clickCallback); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_2900] once clickEvent err : " + JSON.stringify(err)); + } + try { + let driver = Driver.create(); + let button = await driver.findComponents(ON.type('SaveButton')); + await Utils.sleep(500); + console.debug("====>[Test_Security_Button_Save_2900] button is:" + JSON.stringify(button)); + await button[6].click(); + await Utils.sleep(1000); + } catch (err) { + console.debug("====>[Test_Security_Button_Save_2900] clickSecComponent err : " + JSON.stringify(err)); + } + }); + }) +} \ No newline at end of file diff --git a/test/security_component/entry/src/main/ets/test/Utils.ets b/test/security_component/entry/src/main/ets/test/Utils.ets new file mode 100644 index 0000000..bb1f4a4 --- /dev/null +++ b/test/security_component/entry/src/main/ets/test/Utils.ets @@ -0,0 +1,118 @@ +// @ts-nocheck +/** + * 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 Utils { + static rect_left; + static rect_top; + static rect_right; + static rect_bottom; + static rect_value; + + static sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + } + + static getComponentRect(key) { + let strJson = getInspectorByKey(key); + let obj = JSON.parse(strJson); + console.info("[getInspectorByKey] current component obj is: " + JSON.stringify(obj)); + let rectInfo = JSON.parse('[' + obj.$rect + ']') + console.info("[getInspectorByKey] rectInfo is: " + rectInfo); + this.rect_left = JSON.parse('[' + rectInfo[0] + ']')[0] + this.rect_top = JSON.parse('[' + rectInfo[0] + ']')[1] + this.rect_right = JSON.parse('[' + rectInfo[1] + ']')[0] + this.rect_bottom = JSON.parse('[' + rectInfo[1] + ']')[1] + return this.rect_value = { + "left": this.rect_left, "top": this.rect_top, "right": this.rect_right, "bottom": this.rect_bottom + } + } + + static async swipe(downX, downY, upX, upY, steps) { + console.info('start to swipe') + this.drags(downX, downY, upX, upY, steps, false) + } + + static async drag(downX, downY, upX, upY, steps) { + console.info('start to drag') + this.drags(downX, downY, upX, upY, steps, true) + } + + static async drags(downX, downY, upX, upY, steps, drag) { + var xStep; + var yStep; + var swipeSteps; + var ret; + xStep = 0; + yStep = 0; + ret = false; + swipeSteps = steps; + if (swipeSteps == 0) { + swipeSteps = 1; + } + xStep = (upX - downX) / swipeSteps; + yStep = (upY - downY) / swipeSteps; + console.info('move step is: ' + 'xStep: ' + xStep + ' yStep: ' + yStep) + var downPonit: TouchObject = { + id: 1, + x: downX, + y: downY, + type: TouchType.Down, + } + console.info('down touch started: ' + JSON.stringify(downPonit)) + sendTouchEvent(downPonit); + console.info('start to move') + if (drag) { + await this.sleep(500) + } + for (var i = 1;i <= swipeSteps; i++) { + var movePoint: TouchObject = { + id: 1, + x: downX + (xStep * i), + y: downY + (yStep * i), + type: TouchType.Move + } + console.info('move touch started: ' + JSON.stringify(movePoint)) + ret = sendTouchEvent(movePoint) + if (ret == false) { + break; + } + await this.sleep(5) + } + console.info('start to up') + if (drag) { + await this.sleep(100) + } + var upPoint: TouchObject = { + id: 1, + x: upX, + y: upY, + type: TouchType.Up, + } + console.info('up touch started: ' + JSON.stringify(upPoint)) + sendTouchEvent(upPoint) + await this.sleep(500) + } +} + + + + diff --git a/test/security_component/entry/src/main/module.json b/test/security_component/entry/src/main/module.json new file mode 100644 index 0000000..0db2097 --- /dev/null +++ b/test/security_component/entry/src/main/module.json @@ -0,0 +1,46 @@ +{ + "module": { + "name": "phone", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "tablet", + "default", + "phone", + "2in1" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "metadata": [ + { + "name": "ArkTSPartialUpdate", + "value": "true" + } + ], + "abilities": [ + { + "name": "com.example.securitycomponent.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/test/security_component/entry/src/main/resources/base/element/color.json b/test/security_component/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000..07a14d2 --- /dev/null +++ b/test/security_component/entry/src/main/resources/base/element/color.json @@ -0,0 +1,12 @@ +{ + "color": [ + { + "name": "color_hello", + "value": "#ffff0000" + }, + { + "name": "color_world", + "value": "#ff0000ff" + } + ] +} \ No newline at end of file diff --git a/test/security_component/entry/src/main/resources/base/element/float.json b/test/security_component/entry/src/main/resources/base/element/float.json new file mode 100644 index 0000000..26a0491 --- /dev/null +++ b/test/security_component/entry/src/main/resources/base/element/float.json @@ -0,0 +1,12 @@ +{ + "float":[ + { + "name":"font_hello", + "value":"28.0fp" + }, + { + "name":"font_world", + "value":"20.0fp" + } + ] +} \ No newline at end of file diff --git a/test/security_component/entry/src/main/resources/base/element/string.json b/test/security_component/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000..f9f9529 --- /dev/null +++ b/test/security_component/entry/src/main/resources/base/element/string.json @@ -0,0 +1,60 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "entry_MainAbility" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + }, + { + "name": "TestAbility_desc", + "value": "description" + }, + { + "name": "TestAbility_label", + "value": "label" + }, + { + "name":"string_hello", + "value":"Hello" + }, + { + "name":"string_world", + "value":"World" + }, + { + "name":"message_arrive", + "value":"We will arrive at %s." + }, + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } + ] +} \ No newline at end of file diff --git a/test/security_component/entry/src/main/resources/base/media/icon.png b/test/security_component/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c GIT binary patch literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4ZzgdeKtgoc+o5EvN9A1K1_<>M?MBqb#!ASf&# zEX?<)!RH(7>1P+j=jqG(58}TVN-$psA6K}atCuI!KTJD&FMmH-78ZejBm)0qc{ESp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