SafetyNetApi

  • SafetyNetApi is the main entry point for interacting with SafetyNet and includes nested classes for various response types like AttestationResponse, HarmfulAppsResponse, RecaptchaTokenResponse, SafeBrowsingResponse, and VerifyAppsUserResponse.

  • TheverifyWithRecaptcha method, although deprecated in this form, is described as providing user attestation with reCAPTCHA, returning a token after confirming humanness.

  • A newerverifyWithRecaptcha(String) method is indicated as the replacement for the deprecated version.

public interfaceSafetyNetApi

The main entry point for interacting with SafetyNet.

Nested Class Summary

class SafetyNetApi.AttestationResponse Response from attest(byte[], String) that contains aCompatibility Test Suite attestation result. 
class SafetyNetApi.HarmfulAppsResponseAResponse returned from listHarmfulApps()
class SafetyNetApi.RecaptchaTokenResponseResponse from verifyWithRecaptcha(String)
interface SafetyNetApi.RecaptchaTokenResultThis interface was deprecated. use SafetyNetApi.RecaptchaTokenResponse returned from verifyWithRecaptcha(String).  
class SafetyNetApi.SafeBrowsingResponseResponse for lookupUri(String, String, int...)
class SafetyNetApi.VerifyAppsUserResponseAResponse to get user decisions for the Verify Apps API. 

Public Method Summary

abstractPendingResult<SafetyNetApi.RecaptchaTokenResult>
verifyWithRecaptcha(GoogleApiClient client,String siteKey)
This method was deprecated. use verifyWithRecaptcha(String).

Public Methods

public abstractPendingResult<SafetyNetApi.RecaptchaTokenResult>verifyWithRecaptcha(GoogleApiClient client,String siteKey)

This method was deprecated.
use verifyWithRecaptcha(String).

Provides user attestation with reCAPTCHA.

If reCAPTCHA is confident that this is a real user on a real device it will return a token with no challenge. Otherwise it will provide a visual/audio challenge to attest the humanness of the user before returning a token.

When you make a request with this API, you must provide your clientGoogleApiClient and site public key as parameters, and after the request completes, you can get the SafetyNetApi.RecaptchaTokenResult from the response.

Parameters
clientTheGoogleApiClient to service the call. The client must be connected using connect() before invoking this method.
siteKey A site public key registered for this app at//g.co/recaptcha/androidsignup

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-10-31 UTC.