We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All

SafetyDetect SysIntegrityResp

Class info
public class SysIntegrityRespextends com.huawei.hms.support.api.entity.safetydetect.base.BaseResp
Entity class returned by the sysIntegrity API.

Public Method Summary

Return typeMethod name
String

getResult() 

Gets the system integrity check result. The result format complies with JSON Web Signature (JWS).

Public Methods
method1

Method
public String getResult ()
Gets the system integrity check result. The result format complies with JWS.


Return

typedesc
String

Character string whose format complies with JWS. The character string is encoded based on Base64URL. When an exception or error occurs during system integrity check, null is returned.


In the JWS format, the header fields are as follows:

  1. {
  2.   "alg": "RS256",
  3.   "x5c": ["",""]
  4. }
Parameter description:
alg: Signature algorithm name. The value RS256 indicates SHA256withRSA. 

x5c: Certificate chain used by Huawei signature server for signing the JWS-format result, in which x5c[0] indicates the certificate for signing the JWS-format result and x5c[1] indicates the CA certificate for Huawei devices.

  1. {
  2.    "nonce":"bSshKk0YTZrfOl5IjK7HcQ==",
  3.    "timestampMs":1571708929141,
  4.    "apkPackageName":"com.huawei.hms.safetydetectsample",
  5.    "apkDigestSha256":"6Ihk8Wcv1MLm0O5KUCEVYCI/0KWzAHn9DyN38R3WYu8=",
  6.    "apkCertificateDigestSha256":["yT5JtXRgeIgXssx1gQTsMA9GzM9ER4xAgCsCC69Fz3I="],
  7.    "basicIntegrity":false,
  8. "advice":"RESTORE_TO_FACTORY_ROM"
  9. }
Parameter description:

"nonce": Base64 encoding result of the nonce value imported when the sysIntegrity API is called.

"timestampMs": Timestamp generated by the Huawei signature server.

"apkPackageName": Your app package name.

"apkDigestSha256": SHA256 digest of your app's Android package (APK).

"apkCertificateDigestSha256": SHA256 digest of your app's signature certificate. 

"basicIntegrity": System integrity check result. The value true indicates that the system is integral.

"advice": Suggestions in handling the system integrity check result. The value RESTORE_TO_FACTORY_ROM indicates restoration to factory settings.