java.lang.Object | ||
↳ | com.google.android.gms.common.api.GoogleApi<com.google.android.gms.common.api.Api.ApiOptions.NoOptions> | |
↳ | com.google.android.gms.safetynet.SafetyNetClient |
The main entry point for SafetyNet.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Provides attestation results for the device.
| |||||||||||
Prompts the user to enable Verify Apps if it is currently turned off.
| |||||||||||
Initializes the Safe Browsing API.
| |||||||||||
Determines whether Verify Apps is enabled.
| |||||||||||
Gets a list of known, potentially harmful apps installed.
| |||||||||||
Checks whether a URI is known to have specific threats.
| |||||||||||
Safely shuts down the Safe Browsing API, releasing a resources from the system.
| |||||||||||
Provides user attestation with reCAPTCHA.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Provides attestation results for the device.
An attestation result states whether the device where it is running matches the profile of a device that has passed Android compatibility testing. When you request a compatibility check, you must provide a nonce, which is a random token generated in a cryptographically secure manner. You can obtain a nonce by generating one within your app each time you make a compatibility check request. As a more secure option, you can obtain a nonce from your own server, using a secure connection. A nonce used with an attestation request should be at least 16 bytes in length. After you make a request, the responseSafetyNetApi.AttestationResponse
includes your nonce, so you can
verify it against the one you sent. You should only use a nonce value once, for a single
request. Use a different nonce for any subsequent attestation requests. For tips on using
cryptography functions, see
Security Tips.
Parameters | |
---|---|
nonce |
byte :
A cryptographic nonce used for anti-replay and tracking of requests. |
apiKey |
String :
An Android API key obtained through the developer console. |
Returns | |
---|---|
Task<SafetyNetApi.AttestationResponse> |
See also:
Prompts the user to enable Verify Apps if it is currently turned off.
Returns | |
---|---|
Task<SafetyNetApi.VerifyAppsUserResponse> |
Initializes the Safe Browsing API.
This method must be called prior to calling lookupUri(String, String, int...)
.
Returns | |
---|---|
Task<Void> |
Determines whether Verify Apps is enabled.
Returns | |
---|---|
Task<SafetyNetApi.VerifyAppsUserResponse> |
Gets a list of known, potentially harmful apps installed.
Returns | |
---|---|
Task<SafetyNetApi.HarmfulAppsResponse> |
Checks whether a URI is known to have specific threats.
Parameters | |
---|---|
uri |
String :
A String that represents the URI that should be looked up. |
apiKey |
String
|
threatTypes |
int :
integers from SafeBrowsingThreat to indicate that the URI
should be queried for these threat types.
|
Returns | |
---|---|
Task<SafetyNetApi.SafeBrowsingResponse> |
Safely shuts down the Safe Browsing API, releasing a resources from the system.
This method should be called when the client is no longer using the API, which includes when the client's Activity is no longer visible.
Returns | |
---|---|
Task<Void> |
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.
Parameters | |
---|---|
siteKey |
String :
A site public key registered for this app at
https://g.co/recaptcha/androidsignup
|
Returns | |
---|---|
Task<SafetyNetApi.RecaptchaTokenResponse> |