| interface info |
| public interface SafetyDetectClient |
| Represents the main entry point for the Safety Detect service. |
| Return | Method |
| 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() |
| Method |
| Task<SysIntegrityResp> sysIntegrity(byte[] nonce, String appId) |
| Sends a request to check the system integrity of the current user device. |
Parameters
| Parameter name | Parameter desc |
| nonce | Cryptographic 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. |
| appId | Your 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
| type | desc |
| Task<SysIntegrityResp> | System integrity check result. |
| Method |
| Task<VerifyAppsCheckEnabledResp> enableAppsCheck() |
| Enables app security check. |
Return
| type | desc |
| Task<VerifyAppsCheckEnabledResp> | Result for enabling app security check. |
| Method |
| Task<VerifyAppsCheckEnabledResp> isVerifyAppsCheck() |
| Checks whether app security check is enabled. |
Return
| type | desc |
| Task<VerifyAppsCheckEnabledResp> | Whether app security check is enabled. |
| Method |
| Task<MaliciousAppsListResp> getMaliciousAppsList() |
| Gets the app security check result of the current user device. |
Return
| type | desc |
| 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 name | Parameter desc |
| url | To-be-checked URL, including the protocol, host, and path and excluding query parameters. The SDK will discard all the imported query parameters. |
| appId | Your 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. |
| threatTypes | Concerned threat types for URLs to be checked. For details, please refer to UrlCheckThreat. |
Return
| type | desc |
| 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 name | Parameter desc |
| appId | Your 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
| type | desc |
| Task<UserDetectResponse> | Result of fake user detection. |
| Task<Void> initUserDetect() | Initiates UserDetect. |
| Task<Void> shutdownUserDetect() | Disables UserDetect. |