Published 2026-11-05 · By Jeffrey Monica
Start with the threat, not the SDK
Play Integrity can help assess whether an Android interaction appears to originate from a recognized app/device environment. The token is not an access-control decision by itself. An authenticated user can still request an object they do not own; a clean verdict does not eliminate automation, credential theft or business-logic abuse.
Choose concrete protected actions—account recovery, redemption, sensitive profile changes—and define what the service does for recognized, ambiguous and unavailable verdicts. A universal hard block may exclude legitimate environments without meaningfully reducing risk.
Bind the result to the exact request
For standard requests, prepare the provider in advance and obtain an integrity token near the protected action. Bind the original operation's relevant values to the standard requestHash. The server should validate request details against its own reconstruction of the action, including the expected package name, hash and reasonable freshness window. For classic requests the corresponding nonce design is different; do not mix the two protocols.
Have the backend verify/decrypt the token via the documented Google integration. Do not trust a verdict string produced by the Android client or accept a prior token for a new operation. Normalizing the input before hashing is necessary: method, path, subject, object ID and relevant body fields must have one canonical representation.
Validation checklist
- Request hash matches the server's canonical operation context.
- Package and app recognition are validated before evaluating device signals.
- Token freshness and one-action semantics are enforced.
- Tampered object ID or body cannot reuse the original valid evidence.
Turn many signals into measured policy
The returned verdict can include app recognition, device integrity and optional environment-related signals. Their availability and semantics depend on API configuration and device context. Design risk-based responses: allow routine reading, require extra verification for account change, or decline a protected redemption where evidence is absent. Do not treat a single optional label as proof of malicious behavior.
Keep device verdicts separate from identity, account history and rate-based abuse indicators. Use short-lived decisions: Google warns against long verdict caching because it creates proxying and replay opportunities. Count false positives and unsupported devices before tightening enforcement.
Adversarial and reliability testing
Exercise a copied token, a changed operation, stale timestamps, a package mismatch, an absent verdict, service timeout, compromised account with a recognized device and a genuine app requesting another user's resource. The expected behavior must be unambiguous in each case. Integrity checks should improve the difficulty of abuse while leaving core server-side authorization intact.
Primary references
Engineering practices and threat-model choices, not product certification, a guarantee against compromise or a customer penetration-test result.
