Phase 0: Intent
Tell the user: "I will review your RevenueCat security posture on Android: verification mode, API keys, user identity, and server side access decisions."
Phase 1: Discovery
Confirm what RevenueCat already covers so you can focus on the real gaps.
Ask the project these questions:
- Is
EntitlementVerificationModeset? If not,CustomerInforesponses are trusted without signature checking. - Is the SDK configured with the public Android key (starts with
goog_) or has someone accidentally pasted the secret key into the client? - Are real users identified with
Purchases.logIn(yourUserId), or is the app still relying on anonymous$RCAnonymousID:...? - Do server endpoints that serve premium content verify entitlement server side, or do they trust a client sent flag?
Phase 2: Plan
Decide each of the following before changing code.
Decision A: Entitlement verification mode
Decision B: Where is the authority?
Even with ENFORCED, the client is not the authority for paid content. Decide whether each premium endpoint:
- Calls the RevenueCat REST API per request, or
- Reads a local
has_entitlementflag driven by RevenueCat webhooks.
Option 2 is cheaper at request time, option 1 has no cache staleness. Pick one, document it, do not mix per endpoint without a reason.
Decision C: User identity
If the app is in production, plan to call Purchases.logIn("your_user_id") with your own authenticated user id. Anonymous ids are device scoped identifiers, not credentials, and are shared across users of the same device.
Phase 3: Execute
3.1 Turn on response verification
Add the mode to PurchasesConfiguration:
Read the verification result when you inspect entitlements:
Upgrade to ENFORCED once you have telemetry confirming FAILED is rare on real traffic:
In ENFORCED, a failed signature flips isActive to false on the affected entitlement.
3.2 Keep API keys in the right place
In Android code, only the public key appears:
Never commit the secret key to the app repo. Grep the Android source tree for the secret key prefix and confirm zero hits before release.
3.3 Identify real users
Call logIn as soon as you have an authenticated user id:
Do not rely on the anonymous id as a credential. It is a device scoped identifier and does not protect purchase history on shared devices.
3.4 Enforce on the server, not on the client
Even with ENFORCED mode, every server endpoint that serves paid content checks entitlement server side:
Or read a local has_pro flag driven by RevenueCat webhooks and check that flag per request.
Phase 4: Verify
- Android source contains only the public SDK key. Secret key grep is clean.
-
EntitlementVerificationModeis set (notDISABLED) and telemetry forVerificationResult.FAILEDis watched. - Real users are identified through
Purchases.logIn. Anonymous ids are only used for pre login flows. - Every paid content endpoint on your server verifies entitlement through the REST API or a webhook driven flag. None trust a client header.


