目录

interface info
public interface SafetyDetectClient
Represents the main entry point for the Safety Detect service.

Public Method Summary

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

sysIntegrity(byte[] nonce, String appId)

Sends a request to check the system integrity of the current user device.

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

enableAppsCheck()

Enables app security check. The fixed value is true.

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

isVerifyAppsCheck()

Checks whether app security check is enabled.

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

getMaliciousAppsList()

Returns the app security check result of the current user device.

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

initUrlCheck()

Initializes URL check.

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

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

Sends a URL check request.

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

shutdownUrlCheck()

Disables URL check.

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

userDetection(String appId)

Sends a fake user detection request.

com.huawei.hmf.tasks.Task<Void>initUserDetect()
Initiates UserDetect.
com.huawei.hmf.tasks.Task<Void>

shutdownUserDetect()
Disables UserDetect.

Public Methods

Method
Task<SysIntegrityResp> sysIntegrity(byte[] nonce, String appId)
Sends a request to check the system integrity of the current user device.

Parameters

Parameter nameParameter desc
nonceCryptographic nonce for anti-replay protection. You must ensure that a unique nonce is imported each time the sysIntegrity API is called. A nonce consists of 16 to 64 bytes.
appIdYour app ID applied on HUAWEI Developer. HMS Core will authenticate the app ID. Therefore, you need to enable the Safety Detect service for the app corresponding to the app ID on the API management page on HUAWEI Developer.


Return

typedesc
Task<SysIntegrityResp>System integrity check result.
Method
Task<VerifyAppsCheckEnabledResp> enableAppsCheck()
Enables app security check.

Return

typedesc
Task<VerifyAppsCheckEnabledResp>Result for enabling app security check.
Method
Task<VerifyAppsCheckEnabledResp> isVerifyAppsCheck()
Checks whether app security check is enabled.

Return

typedesc
Task<VerifyAppsCheckEnabledResp>Whether app security check is enabled.
Method
Task<MaliciousAppsListResp> getMaliciousAppsList()
Gets the app security check result of the current user device.

Return

typedesc
Task<MaliciousAppsListResp>App security check result of the current user device.
Method
Task<Void> initUrlCheck()
Initializes URL check.
Method
Task<UrlCheckResponse> urlCheck(String url, String appId, int… threatTypes)
Sends a URL check request.

Parameters

Parameter nameParameter desc
urlTo-be-checked URL, including the protocol, host, and path and excluding query parameters. The SDK will discard all the imported query parameters.
appIdYour app ID applied on HUAWEI Developer. HMS Core will authenticate the app ID. Therefore, you need to enable the Safety Detect service for the app corresponding to the app ID on the API management page on HUAWEI Developer.
threatTypesConcerned threat types for URLs to be checked. For details, please refer to UrlCheckThreat.


Return

typedesc
Task<UrlCheckResponse>URL check result.
Method
Task<Void> shutdownUrlCheck()
Disables the URL check service.
Method
Task<UserDetectResponse> userDetection(String appId)
Sends a fake user detection request.

Parameters

Parameter nameParameter desc
appIdYour app ID applied on HUAWEI Developer. HMS Core will authenticate the app ID. Therefore, you need to enable the Safety Detect service for the app corresponding to the app ID on the API management page on HUAWEI Developer.


Return

typedesc
Task<UserDetectResponse>Result of fake user detection.
Task<Void> initUserDetect()Initiates UserDetect.
Task<Void> shutdownUserDetect()Disables UserDetect.