Interface Info |
|---|
public interface SafetyDetectClient Main entry for calling Safety Detect APIs. |
Qualifier and Type | Method Name and Description |
|---|---|
com.huawei.hmf.tasks.Task<SysIntegrityResp> | sysIntegrity(byte[] nonce, String appId) Initiates a request to check the system integrity of the current device. NOTE: This method is not recommended. Use sysIntegrity(SysIntegrityRequest sysIntegrityRequest) instead. |
com.huawei.hmf.tasks.Task<SysIntegrityResp> | sysIntegrity(SysIntegrityRequest sysIntegrityRequest) Initiates a request to check the system integrity of the current device. NOTE: This method is recommended for version 5.0.5.302 and later. |
com.huawei.hmf.tasks.Task<VerifyAppsCheckEnabledResp> | Enables app security check. |
com.huawei.hmf.tasks.Task<VerifyAppsCheckEnabledResp> | Checks whether app security check is enabled. |
com.huawei.hmf.tasks.Task<MaliciousAppsListResp> | Initiates an app security check request. |
com.huawei.hmf.tasks.Task<Void> | Initializes URL check. |
com.huawei.hmf.tasks.Task<UrlCheckResponse> | urlCheck(String uri, String appId, int... threatTypes) Initiates a URL check request. |
com.huawei.hmf.tasks.Task<Void> | Disables URL check. |
com.huawei.hmf.tasks.Task<UserDetectResponse> | userDetection(String appId) Initiates a fake user detection request. |
com.huawei.hmf.tasks.Task<Void> | Initializes fake user detection. |
com.huawei.hmf.tasks.Task<Void> | Disables fake user detection. |
com.huawei.hmf.tasks.Task<WifiDetectResponse> | Obtains the malicious Wi-Fi check result. |
Method |
|---|
Task<SysIntegrityResp> sysIntegrity(byte[] nonce, String appId) Initiates a request to check the system integrity of the current device. |
Parameters
Name | Description |
|---|---|
nonce | Cryptographic nonce value, which is used to prevent replay attacks. Ensure that the nonce value passed each time when the sysIntegrity API is called is unique. A nonce value must consist of 16 to 66 bytes. |
appId | App ID applied on HUAWEI Developers. HMS Core (APK) needs to authenticate the app ID. You need to enable the Safety Detect service for the app with this ID on the Manage APIs page in AppGallery Connect. |
Returns
Type | Description |
|---|---|
Task<SysIntegrityResp> | System integrity check result. |
Method |
|---|
Task<SysIntegrityResp> sysIntegrity(SysIntegrityRequest sysIntegrityRequest) Initiates a request to check the system integrity of the current device. |
Parameters
Name | Description |
|---|---|
sysIntegrityRequest | Request entity class of the SysIntegrity API. |
Returns
Type | Description |
|---|---|
Task<SysIntegrityResp> | System integrity check result. |
Method |
|---|
Task<VerifyAppsCheckEnabledResp> enableAppsCheck() Enables app security check. |
Returns
Type | Description |
|---|---|
Result of enabling app security check. |
Method |
|---|
Task<VerifyAppsCheckEnabledResp> isVerifyAppsCheck() Checks whether app security check is enabled. |
Returns
Type | Description |
|---|---|
Whether app security check is enabled. |
Method |
|---|
Task<MaliciousAppsListResp> getMaliciousAppsList() Initiates an app security check request. |
Returns
Type | Description |
|---|---|
Task<MaliciousAppsListResp> | App security check result. |
Method |
|---|
Task<UrlCheckResponse> urlCheck(String url, String appId, int... threatTypes) Initiates a URL check request. |
Parameters
Name | Description |
|---|---|
url | URL to check, including the protocol, host, and path but excluding query parameters. The SDK will discard all passed query parameters. |
appId | App ID applied on HUAWEI Developers. HMS Core (APK) needs to authenticate the app ID. You need to enable the Safety Detect service for the app with this ID on the Manage APIs page in AppGallery Connect. |
threatTypes | Concerned threat types for URLs to check. For details about threat types, please refer to UrlCheckThreat. |
Returns
Type | Description |
|---|---|
Task<UrlCheckResponse> | URL check result. |
Method |
|---|
Task<UserDetectResponse> userDetection(String appId) Initiates a fake user detection request. |
Parameters
Name | Description |
|---|---|
appId | App ID applied on HUAWEI Developers. HMS Core (APK) needs to authenticate the app ID. You need to enable the Safety Detect service for the app with this ID on the Manage APIs page in AppGallery Connect. |
Returns
Type | Description |
|---|---|
Task<UserDetectResponse> | Result of fake user detection. |
Method |
|---|
Task<WifiDetectResponse> getWifiDetectStatus() Obtains the malicious Wi-Fi check result. |
Returns
Type | Description |
|---|---|
Task<WifiDetectResponse> | Malicious Wi-Fi check result. |