对于我正在使用的android中的安全环境检查
https://developer.android.com/training/safetynet/attestation.html
SafetyNet.getClient(this).attest(nonce, API_KEY)
.addOnSuccessListener(this,successListner)
.addOnFailureListener(this,failureListener)
为此,我收到网络错误 null的故障回调。任何人都可以对此有所了解吗?
但是https://medium.com/@hargoyal/secure-android-app-with-safetynet-8e367a1c8ad0
SafetyNet.SafetyNetApi.attest(mGoogleApiClient, nonce)
.setResultCallback(new ResultCallback<SafetyNetApi.AttestationResult>() {
@Override
public void onResult(SafetyNetApi.AttestationResult result) {
Status status = result.getStatus();
if (status.isSuccess()) {
decodeJws(result.getJwsResult());
// Indicates communication with the service was successful.
// Use result.getJwsResult() to get the result data.
} else {
// An error occurred while communicating with the service.
}
}
});
这种方法有效,但不推荐使用SafetyNet.SafetyNetApi。