目录

interface info
public interface SafetyDetectClient
Safety Detect API 的主入口

Public Method Summary

ReturnMethod
com.huawei.hmf.tasks.Task<SysIntegrityResp>

sysIntegrity(byte[] nonce, String appId)

发起一次对当前设备的系统完整性检测请求

com.huawei.hmf.tasks.Task<VerifyAppsCheckEnabledResp>

enableAppsCheck()

开启应用安全检测功能

com.huawei.hmf.tasks.Task<VerifyAppsCheckEnabledResp>

isVerifyAppsCheck()

应用安全检测功能开关状态查询

com.huawei.hmf.tasks.Task<MaliciousAppsListResp>

getMaliciousAppsList()

发起应用安全检测请求

com.huawei.hmf.tasks.Task<Void>

initUrlCheck()

初始化URL检测

com.huawei.hmf.tasks.Task<UrlCheckResponse>

urlCheck(String uri, String appId, int… threatTypes)

发起URL检测请求

com.huawei.hmf.tasks.Task<Void>

shutdownUrlCheck()

关闭URL检测

com.huawei.hmf.tasks.Task<UserDetectResponse>

userDetection(String appId)

发起虚假用户检测请求

com.huawei.hmf.tasks.Task<Void>

initUserDetect()

初始化虚假用户检测

com.huawei.hmf.tasks.Task<Void>

shutdownUserDetect()
关闭虚假用户检测

Public Methods

Method
Task<SysIntegrityResp> sysIntegrity(byte[] nonce, String appId)
发起一次对当前设备的系统完整性检测请求

Parameters

Parameter nameParameter desc
nonce一个密码学的 nonce 值,用于防重放攻击。您必须确保每次调用 sysIntegrity 接口时传入的 nonce 值都是不同的。nonce 的长度有限制,为 16-64 字节。
appId您在华为开发者联盟网站上申请的 appId。HMS Core 会对 appId 进行鉴权,你需要在华为开发者联盟网站的 API 管理上打开这个 appId 访问 Safety Detect 服务的开关。


Return

typedesc
Task<SysIntegrityResp>系统安全检测返回结果
Method
Task<VerifyAppsCheckEnabledResp> enableAppsCheck()
开启应用安全检测功能

Return

typedesc
Task<VerifyAppsCheckEnabledResp>开启应用安全检测功能的返回结果
Method
Task<VerifyAppsCheckEnabledResp> isVerifyAppsCheck()
应用安全检测功能开关状态查询

Return

typedesc
Task<VerifyAppsCheckEnabledResp>查询应用安全检测功能开关状态的返回结果
Method
Task<MaliciousAppsListResp> getMaliciousAppsList()
发起应用安全检测请求

Return

typedesc
Task<MaliciousAppsListResp>应用安全检测的返回结果
Method
Task<Void> initUrlCheck()
初始化 URL 检测
Method
Task<UrlCheckResponse> urlCheck(String url, String appId, int… threatTypes)
发起 URL 检测请求

Parameters

Parameter nameParameter desc
url待检测的 URL,包含协议、主机、路径,不包含查询参数,即使传入了查询参数也会被 SDK 丢弃。
appId您在华为开发者联盟网站上申请的 appId。HMS Core 会对 appId 进行鉴权,你需要在华为开发者联盟网站的 API 管理上打开这个 appId 访问 Safety Detect 服务的开关。
threatTypes关注的待检测 URL 威胁类型。详细威胁类型参考UrlCheckThreat。


Return

typedesc
Task<UrlCheckResponse>URL 检测结果
Method
Task<Void> shutdownUrlCheck()
关闭 URL 检测服务
Method
Task<UserDetectResponse> userDetection(String appId)
发起一次用户检测请求

Parameters

Parameter nameParameter desc
appId您在华为开发者联盟网站上申请的 appId。HMS Core 会对 appId 进行鉴权,你需要在华为开发者联盟网站的 API 管理上打开这个 appId 访问 Safety Detect 服务的开关。


Return

typedesc
Task<UserDetectResponse>虚假用户检测返回结果
Task<Void> initUserDetect()初始化虚假用户检测
Task<Void> shutdownUserDetect()关闭虚假用户检测