Name |
Date |
Size |
#Lines |
LOC |
||
---|---|---|---|---|---|---|
.. | - | - | ||||
config/ | 12-May-2024 | - | 24 | 21 | ||
figures/ | 12-May-2024 | - | ||||
frameworks/ | 12-May-2024 | - | 1,419 | 1,038 | ||
interfaces/inner_api/ | 12-May-2024 | - | 4,231 | 2,856 | ||
services/security_component_service/sa/ | 12-May-2024 | - | 6,935 | 4,856 | ||
test/fuzztest/security_component/ | 12-May-2024 | - | 2,266 | 1,355 | ||
BUILD.gn | D | 12-May-2024 | 1.5 KiB | 46 | 41 | |
LICENSE | D | 12-May-2024 | 10.1 KiB | 177 | 150 | |
README_zh.md | D | 12-May-2024 | 3.4 KiB | 62 | 42 | |
bundle.json | D | 12-May-2024 | 3.3 KiB | 106 | 105 | |
hisysevent.yaml | D | 12-May-2024 | 4 KiB | 95 | 69 | |
security_component.gni | D | 12-May-2024 | 854 | 22 | 19 |
README_zh.md
1# 安全控件管理服务 2 3## 简介 4 5安全控件是OpenHarmony提供的一组系统实现的ArkUI组件,类似Button(按钮)、Text(文本)提供给开发者集成到自己应用界面中。 6当用户点击了这类控件后,应用将被授予对应的临时授权,而不需要额外申请权限即可访问用户隐私数据,达到减少授权弹窗对用户的干扰。 7 8例如:应用开发者可以在应用中集成位置控件(LocationButton),这样就不用申请精准定位权限,当用户点击该控件时,应用可以获得前台情况下的精准定位临时权限,继而调用位置服务接口获取位置信息。 9 10安全控件特性原理图如下所示: 11 12 13由安全控件UX实现、安全控件管理服务组成。UX实现集成在ArkUI框架中,负责提供控件的具体绘制; 安全控件管理服务负责安全控件的管理、合法性检查、临时权限的授予等。 14 15安全控件管理服务主要提供如下功能: 16 17- 提供应用安全控件的注册、临时授权、取消注册等Native接口实现。 18 19- 负责安全控件的合法性检查,只有合法的安全控件才能授权成功。 20 21- 提供媒体库服务查询临时授权的Native接口实现。 22 23- 提供安全增强相关接口及适配层,供厂商定制安全增强功能使用。 24 25 26## 目录 27 28``` 29/base/security/security_component_manager 30├── frameworks # 框架层,基础功能代码存放目录 31│ ├── common # 框架公共代码存放目录 32│ ├── enhance_adapter # 能力增强适配代码存放目录 33│ └── security_component # 安全控件服务框架代码存放目录 34├── interfaces # 接口层 35│ └── inner_api # 内部接口层 36│ ├── enhance_kits # 安全控件配置接口代码存放目录 37│ └── security_component # 安全控件服务接口层代码存放目录 38└── services # 服务层 39 └── security_component_service/sa 40 └── sa_main # 安全控件服务侧代码存放目录 41 42``` 43 44## 使用 45### 接口说明 46 47| **接口申明** | **接口描述** | 48| --- | --- | 49| int32_t RegisterSecurityComponent(SecCompType type, const std::string& componentInfo, int32_t& scId); | 注册安全控件 | 50| int32_t UpdateSecurityComponent(int32_t scId, const std::string& componentInfo); | 更新安全控件信息 | 51| int32_t UnregisterSecurityComponent(int32_t scId); | 取消注册安全控件 | 52| int32_t ReportSecurityComponentClickEvent(int32_t scId, const std::string& componentInfo, const SecCompClickEvent& touchInfo, sptr<IRemoteObject> callerToken); | 上报点击事件,申请临时授权 | 53| int32_t SetEnhanceCfg(uint8_t* cfg, uint32_t cfgLen); | 设置安全控件增强的配置,供多模服务使用 | 54| int32_t GetPointerEventEnhanceData(void* data, uint32_t dataLen, uint8_t* enhanceData, uint32_t& enHancedataLen); | 获取点击事件的安全增强数据,供多模服务使用 | 55| bool ReduceAfterVerifySavePermission(AccessToken::AccessTokenID tokenId); | 校验后取消保存控件权限 | 56 57## 相关仓 58 59**[arkui\_ace\_engine](https://gitee.com/openharmony/arkui_ace_engine/blob/master/README_zh.md)** 60 61**[multimodalinput\_input](https://gitee.com/openharmony/multimodalinput_input/blob/master/README_zh.md)** 62