Anti-AIClone

Log date · Mon

Does Play Integrity protect Android app code?

Published on · Updated

No. Play Integrity informs server decisions about requests, apps and devices; it does not hide client code.

Can Play Integrity protect your code?

No. Play Integrity gives your backend app, device and account signals to inform a decision about a request; it does not hide client code or choose your business policy. [1] We compare two cases using one documentation-format example: when request binding matches, the signals can inform a decision; when the hash differs, the request is untrustworthy even if the app and device fields look good.

This is a worked example based on Google documentation, not a device result: we checked the syntax of synthetic JSON locally, but did not call Play Integrity, decrypt a token or measure device behavior.

Four questions (documentation-based example)
QuestionAnswer
What can it inform?App, device and Play licensing checks for a particular request.
What if the hash differs?Do not trust the request, even if other fields look good.
Does it hide an offline algorithm?No; client code still has to run on the device.
Should every issue trigger a ban?No; distinguish unevaluated signals, risk and service errors.

How a standard request reaches your server

A standard request has two stages. The app prepares a token provider ahead of time. When a protected action occurs, it hashes the request and supplies that requestHash when requesting a token. The app sends the signed, encrypted token and business request to its backend; the backend asks Google Play to decrypt and verify it, then reads the verdict and decides how to proceed. [3] A Cloud project is required; linking Play Console also enables additional configuration and testing features. [4]

Use a stable, unambiguous serialization of the action, user or session, important business parameters and a server-recognized request identifier. The server must independently compute the same digest from the received request rather than trust an expected value supplied by the client. Avoid placing sensitive plaintext in requestHash, and agree on field order, encoding and defaults across both sides.

Google says standard requests have automatic replay protection: repeatedly decrypting the same token clears verdicts or makes them UNEVALUATED. [3] That does not replace business idempotency: a payment endpoint still needs its own order state and duplicate-submission rules.

Standard requests are intended for on-demand checks of server actions. Classic requests work differently: they use a nonce, and the developer is responsible for mitigating certain attack risks. Keep the binding rules for the two request types distinct. [1][2]

Read a sample verdict

Below we combine fields and values shown in Google’s documentation into a synthetic standard-request payload. It illustrates the decrypted, verified JSON format, not a token returned by a device. [2] The documented field order is not guaranteed, so parse by name.

Synthetic documentation-format example, Play Integrity not executed; fields combined from [2].
{
  "requestDetails": {"requestPackageName": "com.package.name", "requestHash": "aGVsbG8gd29scmQgdGhlcmU", "timestampMillis": "1675655009345"},
  "appIntegrity": {"appRecognitionVerdict": "PLAY_RECOGNIZED", "packageName": "com.package.name", "versionCode": "42"},
  "deviceIntegrity": {"deviceRecognitionVerdict": ["MEETS_DEVICE_INTEGRITY"]},
  "accountDetails": {"appLicensingVerdict": "LICENSED"}
}

First check requestPackageName, requestHash and timestampMillis against the actual request and the server’s allowed time window, then inspect the other fields. The example hash is a documentation placeholder; in an integration the server must recompute it from the actual request. The timestamp is historical and cannot establish freshness for a current request. [2]

PLAY_RECOGNIZED means the app and certificate match versions distributed by Google Play. MEETS_DEVICE_INTEGRITY is a device integrity label, while LICENSED describes the account’s Play app entitlement. These answer different questions: a Play entitlement is neither your business account identity nor proof that a user purchased a particular service or may perform a transaction. [2]

Two requests, two decisions

Suppose a quoting app uses these fields when submitting an order. The following is an example policy, not a rule imposed by Google or a measured acceptance rate. The backend still authenticates the user, validates price and inventory, and controls duplicate submissions.

Recommended policy: bind first, then interpret signals
CaseRecommendation
A: Package, hash and freshness match; app recognized and device meets policyContinue with account authorization and business validation before processing.
B: Hash differs; other fields match AReject this request and record the binding failure; a favorable device label cannot repair it.
App or license UNEVALUATED, or device label absentTreat as unknown; use other signals, retry and support paths rather than declaring fraud.
Token request or decode fails, network is down, or quota is exhaustedSeparate technical failure from a risk verdict; rate-limit, defer or route to support by action.

The documentation says an unevaluated result can arise from unmet requirements or technical issues; when no device label applies, deviceRecognitionVerdict can be omitted. [2] A parser therefore needs to handle missing fields and new values without collapsing every unexpected value into “tampering.” Observe your own audience without enforcement first, then introduce policy in stages according to the risk of each action. [1]

When designing fallback, start with the consequences of the action: a read-only screen can follow a different policy from a transfer or refund. Give users a clear retry message, and let support staff look up the technical error category using the internal identifier. A temporary dependency failure should have an operational owner and a documented recovery route.

What a verdict can and cannot do

Decision scope and complementary controls (recommendations)
GoalWhat the verdict supportsWhat else is needed
Recognize the appCheck Play recognition of app and certificate.Check expected package, certificate and version; plan for legitimate distribution channels.
Protect a server actionAdd risk signals to a particular request.Server authentication, authorization, rate limits, business validation and idempotency.
Protect local logicDoes not hide or encrypt rules shipped in the app.Minimize sensitive client logic and evaluate obfuscation or server-side execution.
Protect secretsDoes not make a shared secret embedded in the package safe.Keep privileged shared secrets on the server and rotate exposed credentials.
Offline featuresCannot make an offline client rely on a live server decision.Define offline permissions, synchronization conflicts, expiry and fallback.

Obfuscation raises the effort needed to understand and modify code; integrity verdicts provide signals to a backend. They can complement each other, but neither proves the effectiveness of the other. For rules that must run offline, separately assess client exposure and acceptable loss instead of treating a rejected online request as evidence that an algorithm cannot be reproduced.

Validate your own integration

Set up a Cloud project and Play Console testing features in a test environment, then integrate standard requests using the official flow. [3][4] Choose one action, fix its serialization, and check the package, recomputed hash and freshness window on the server before recording app, device and license signals separately. Avoid logging raw tokens, credentials or sensitive request content; correlate outcomes using an internal request identifier.

Cover a normal request, a hash mismatch after changing a business parameter, a stale request, unevaluated or missing fields, and token request and decode failures. Verify the backend response, user message and recovery for each case; include test accounts and devices representing the distribution channels you support. Google provides Play Console testing capabilities for configuring responses. [2][4]

Count each state, technical errors and affected legitimate users before deciding which actions need stricter treatment. Assign owners and recovery paths for quota exhaustion, outages and user appeals. Recheck false rejections and business impact whenever the policy changes.

Check actual deployment conditions too: whether old and new app versions use the same hash encoding, whether server clocks are accurate, and whether users can retry safely after switching networks. Group aggregate results by app version and error category to find integration problems before expanding enforcement. Test the complete release path, not just a debug build, because signing and distribution affect the app signals.

Your checklist

  • Define server decisions and fallbacks for sensitive actions.
  • Agree on request serialization; recompute the hash and check freshness on the backend.
  • Handle unevaluated, missing fields and technical errors separately.
  • Observe legitimate users before gradually enforcing policy.
  • Assess offline logic and client credential exposure separately.

Primary sources

All sources and reproduction status ↗