我正在使用 Google 客户端调用 SafetyNet Api,但它没有做出正确的响应。
SafetyNet.SafetyNetApi.attest(mGoogleApiClient, generateNonce())
.setResultCallback(new ResultCallback<SafetyNetApi.AttestationResult>() {
@Override
public void onResult(SafetyNetApi.AttestationResult result) {
Status status = result.getStatus();
String data = decodeJws(result.getJwsResult());
if (status.isSuccess()) {
// Indicates communication with the service was successful.
// Use result.getJwsResult() to get the result data.
} else {
// An error occurred while communicating with the service.
}
}
});
我在结果方法中收到以下错误消息。
状态{statusCode=NETWORK_ERROR, resolution=null}
我们将不胜感激任何形式的帮助。
最佳答案
这不起作用,因为您正在使用 SafetyNetApi
,不再受支持。
从 Google Play 服务 11.0.0 开始,您现在应该 get an API key ,并使用 SafetyNetClient
相反。
您可能还想看看 10 things you might be doing wrong when using the SafetyNet Attestation API .
关于Android:SafetyNet Attest 设备验证响应网络错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53912841/