AI-generated Key Takeaways
-
SafetyNetApi
is the primary interface for interacting with the SafetyNet service on Android. -
It offers various functionalities such as attestation, harmful app detection, reCAPTCHA verification, and safe browsing checks through nested classes and methods.
-
The
verifyWithRecaptcha
method, now deprecated, provided user attestation using reCAPTCHA but has been replaced with a newer implementation. -
Developers can access different aspects of SafetyNet, like checking device compatibility or verifying user authenticity, via the methods and classes within this API.
-
Although deprecated methods exist within this API, they point to newer alternatives for developers to utilize.
The main entry point for interacting with SafetyNet.
Nested Class Summary
class | SafetyNetApi.AttestationResponse |
Response from
attest(byte[], String) that contains a Compatibility Test Suite
attestation result.
|
|
class | SafetyNetApi.HarmfulAppsResponse | A Response
returned from
listHarmfulApps() . |
|
class | SafetyNetApi.RecaptchaTokenResponse | Response
from
verifyWithRecaptcha(String) . |
|
interface | SafetyNetApi.RecaptchaTokenResult | This interface was deprecated. use
SafetyNetApi.RecaptchaTokenResponse returned from
verifyWithRecaptcha(String) . |
|
class | SafetyNetApi.SafeBrowsingResponse | Response
for
lookupUri(String, String, int...) . |
|
class | SafetyNetApi.VerifyAppsUserResponse | A Response
to get user decisions for the Verify Apps API. |
Public Method Summary
abstract PendingResult<SafetyNetApi.RecaptchaTokenResult> |
verifyWithRecaptcha(GoogleApiClient
client, String siteKey)
This method was deprecated. use
verifyWithRecaptcha(String) .
|
Public Methods
public abstract PendingResult<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 client GoogleApiClient
and site public key as parameters, and after the request completes, you can get the
SafetyNetApi.RecaptchaTokenResult
from the response.
Parameters
client | The GoogleApiClient
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 |