daily pastebin goal
68%
SHARE
TWEET

Untitled

a guest Jul 11th, 2018 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // The nonce should be at least 16 bytes in length.
  2. // You must generate the value of API_KEY in the Google APIs dashboard.
  3. SafetyNet.getClient(this).attest(nonce, API_KEY)
  4.     .addOnSuccessListener(this,
  5.         new OnSuccessListener<SafetyNetApi.AttestationResponse>() {
  6.             @Override
  7.             public void onSuccess(SafetyNetApi.AttestationResponse response) {
  8.                 // Indicates communication with the service was successful.
  9.                 // Use response.getJwsResult() to get the result data.
  10.             }
  11.         })
  12.     .addOnFailureListener(this, new OnFailureListener() {
  13.         @Override
  14.         public void onFailure(@NonNull Exception e) {
  15.             // An error occurred while communicating with the service.
  16.             if (e instanceof ApiException) {
  17.                 // An error with the Google Play services API contains some
  18.                 // additional details.
  19.                 ApiException apiException = (ApiException) e;
  20.                 // You can retrieve the status code using the
  21.                 // apiException.getStatusCode() method.
  22.             } else {
  23.                 // A different, unknown type of error occurred.
  24.                 Log.d(TAG, "Error: " + e.getMessage());
  25.             }
  26.         }
  27.     });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top