Go to file
baoyang 53480a83c0 fix OAT
Signed-off-by: baoyang <baoyang9@huawei.com>
Change-Id: I73ab5801c092da4fd71b5d8e6c24db45cdd102c2
2024-05-24 02:35:05 +00:00
.gitee add pr template 2024-03-26 14:29:06 +08:00
config 安全控件更改部件名 2023-09-06 09:58:43 +08:00
figures update docs 2023-10-08 10:10:27 +08:00
frameworks encrypt ipc message 2024-05-14 15:09:04 +00:00
interfaces/inner_api !136 feat:支持安全控件首次弹窗取消和允许 2024-05-16 11:17:32 +00:00
services/security_component_service/sa !136 feat:支持安全控件首次弹窗取消和允许 2024-05-16 11:17:32 +00:00
test/fuzztest/security_component fix codecheck error 2024-04-26 02:05:28 +00:00
BUILD.gn hiden symbol 2024-02-22 22:04:19 +08:00
bundle.json 部件整改 2024-04-08 11:38:14 +08:00
hisysevent.yaml Description: HMAC接口 2023-07-04 15:39:42 +08:00
LICENSE Description: 添加license 2023-07-24 10:10:45 +08:00
OAT.xml fix OAT 2024-05-24 02:35:05 +00:00
README_zh.md 安全控件增加keyevent事件 2023-11-09 22:57:07 +08:00
README.md 安全控件增加keyevent事件 2023-11-09 22:57:07 +08:00
security_component.gni 安全控件更改部件名 2023-09-06 09:58:43 +08:00

Security Component Manager Service

Introduction

The security components are a set of ArkUI components provided by OpenHarmony, like <Button> and <Text>. You can integrate them to your application UI. When a security component is clicked, the application is granted temporary permissions and can access the user's private data without applying for permissions. This minimizes the interference of the authorization pop-up windows to users.

For example, if you integrate the LocationButton component into your application, you do not need to apply for the location permission. When the user clicks this component, the application can obtain the temporary location permission in the foreground and call the location service API to obtain location information.

The following figure illustrates the working mechanism of security components.

security_component

The security components are implemented by UX implementation and security component manager service. Integrated in the ArkUI framework, the UX implementation is responsible for drawing components. The security component manager service manages the security components, performs validity checks, and grants temporary permissions.

The security component manager service provides the following functions:

  • Provides native interfaces for registering or unregistering a security component, and granting temporary permissions to the application.

  • Checks the validity of security components. Only valid security components can be authorized successfully.

  • Provides native interfaces for the mediaLibrary service to query temporary permissions.

  • Provides APIs and adaptation layer for vendors to customize security enhancement functions.

Directory Structure

/base/security/security_component_manager
├── frameworks                  # Code of basic functionalities
│   ├── common                  # Common code
│   ├── enhance_adapter         # Adaptation code for capability enhancement
│   └── security_component      # Framework code of the security component service
├── interfaces                  # APIs
│   └── inner_api               # Internal APIs
│       ├── enhance_kits        # APIs for security component configuration
│       └── security_component  # Security component service APIs
└── services                    # Services
    └── security_component_service/sa
        └── sa_main             # System ability code of the security components

Usage

Available APIs

API Description
int32_t RegisterSecurityComponent(SecCompType type, const std::string& componentInfo, int32_t& scId); Registers a security component.
int32_t UpdateSecurityComponent(int32_t scId, const std::string& componentInfo); Updates security component information.
int32_t UnregisterSecurityComponent(int32_t scId); Unregisters a security component.
int32_t ReportSecurityComponentClickEvent(int32_t scId, const std::string& componentInfo, const SecCompClickEvent& clickInfo, sptr<IRemoteObject> callerToken); Reports a click event to apply for temporary authorization.
int32_t SetEnhanceCfg(uint8_t* cfg, uint32_t cfgLen); Sets enhanced configuration of the security component for multimodal services.
int32_t GetPointerEventEnhanceData(void* data, uint32_t dataLen, uint8_t* enhanceData, uint32_t& enHancedataLen); Obtains security enhancement data of the click event for multimodal services.
bool ReduceAfterVerifySavePermission(AccessToken::AccessTokenID tokenId); Cancels the saving of the component permissions after verification.

Repositories Involved

arkui_ace_engine

multimodalinput_input