harmony 鸿蒙安全子系统变更说明

  • 2025-06-16
  • 浏览 (3)

安全子系统变更说明

cl.security_guard.1 securityGuard接口权限变更

访问级别

系统接口。

变更原因

根据权限命名规范,变更获取风险详细数据的权限,重新定义新权限的同时,删除旧权限。

变更影响

该变更为非兼容性变更,接口权限变更后,接口仍能编译成功,但是接口原本的功能无法正常使用,调用接口会抛出201错误码。

起始API Level

12

变更发生的版本

从OpenHarmony 5.0.0.36开始。

变更的接口

接口声明 变更前 变更后
reportSecurityEvent(securityEvent: SecurityEvent): void 需要ohos.permission.securityguard.REPORT_SECURITY_INFO权限 需要ohos.permission.REPORT_SECURITY_EVENT权限
querySecurityEvent(rules: Array<SecurityEventRule>, querier: Querier): void 需要ohos.permission.securityguard.REQUEST_SECURITY_EVENT_INFO权限 需要ohos.permission.QUERY_SECURITY_EVENT权限
startSecurityEventCollector(rule: CollectorRule): void 需要ohos.permission.securityguard.REQUEST_SECURITY_EVENT_INFO权限 需要ohos.permission.QUERY_SECURITY_EVENT权限
stopSecurityEventCollector(rule: CollectorRule): void 需要ohos.permission.securityguard.REQUEST_SECURITY_EVENT_INFO权限 需要ohos.permission.QUERY_SECURITY_EVENT权限
getModelResult(rule: ModelRule): Promise<ModelResult> 需要ohos.permission.securityguard.REQUEST_SECURITY_MODEL_RESULT权限 需要ohos.permission.QUERY_SECURITY_MODEL_RESULT权限
on(type: ‘securityEventOccur’, securityEventInfo: SecurityEventInfo, callback: Callback<SecurityEvent>): void 需要ohos.permission.securityguard.REQUEST_SECURITY_EVENT_INFO权限 需要ohos.permission.QUERY_SECURITY_EVENT权限
off(type: ‘securityEventOccur’, securityEventInfo: SecurityEventInfo, callback?: Callback<SecurityEvent>): void 需要ohos.permission.securityguard.REQUEST_SECURITY_EVENT_INFO权限 需要ohos.permission.QUERY_SECURITY_EVENT权限

适配指导

业务申请并配置如下权限,仅用于迁移场景使用:
ohos.permission.REPORT_SECURITY_EVENT
ohos.permission.QUERY_SECURITY_EVENT
ohos.permission.QUERY_SECURITY_MODEL_RESULT

你可能感兴趣的鸿蒙文章

harmony 鸿蒙程序访问控制子系统变更说明

harmony 鸿蒙ArkCompiler子系统Changelog

harmony 鸿蒙ArkGraphics2D变更说明

harmony 鸿蒙ArkUI子系统Changelog

harmony 鸿蒙ArkWeb子系统Changelog

harmony 鸿蒙包管理子系统变更说明

harmony 鸿蒙媒体子系统Changelog

harmony 鸿蒙网络管理子系统Changelog

harmony 鸿蒙文件子系统Changelog

harmony 鸿蒙USB服务子系统Changelog

0  赞