Repository navigation
Conversation
…#124) Google Play removed the app for leading users to a payment method other than Google Play's billing system. Split Android into two builds: - Play build (systems.lockdown.cydmobile, ANDROID_DISTRIBUTION=play, the default): Google Play Billing is the only purchase path. Purchases carry the account's server-issued obfuscated ID, cyd-server verifies each purchase token, and the purchase is acknowledged only after verification grants Premium. Manage links open the Google Play subscription center. - Non-Play build (systems.lockdown.cydmobile.alt, ANDROID_DISTRIBUTION= other): keeps the external Stripe checkout, direct-download only, with its own EAS profile, signing, and release workflow job. Generalizes the existing App Store purchase flow in CydAccountProvider to both storefronts (storePurchaseState, restoreStorePurchases); the iOS path is behaviorally unchanged.
- Surface the server's own reason (e.g. the 409 account-mismatch message) when the Google Play subscription endpoints reject a request, instead of a generic failure string. - Prefer a product's plain base-plan offer (no offerId) when starting a Play purchase, so a promotional offer in the Play Console can't change what the paywall's shown price buys. - Replace the preposition-composing helper with literal per-storefront messages, and drop the inert GOOGLE_PLAY_* product IDs from the alt EAS profile. - Document that EAS tracks the alt keystore per application ID.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #124.
Summary
Google Play removed the app for leading users to a payment method other than Google Play's billing system. This splits Android into two builds and makes Google Play Billing the only purchase path in the Play one:
The Play purchase flow mirrors the iOS App Store flow on top of the cyd-server endpoints from lockdown-systems/cyd-server#198:
Manage links (
CydAccountBar,AccountMenuSheet, paywall components) open the Google Play subscription center in the Play build; everything else keeps the dashboard URL. The iOS App Store path is behaviorally unchanged.Evidence
After: full jest suite green (82 suites, 942 passed), typecheck and repo lint clean.
New tests cover each layer:
constants/__tests__/subscriptions.test.ts— mode selection for play/other/ios builds and the product catalogsservices/__tests__/cyd-api-client.test.ts—GET/POST /user/google-play/subscription, including surfacing the server's 409 account-mismatch reasoncontexts/__tests__/CydAccountProvider.play.test.tsx— purchase request carries the obfuscated ID and base-plan offer token; a purchase is acknowledged only after server verification grants Premium; a rejected purchase is never acknowledged; restore; Play subscription-center manage URLservices/__tests__/app-config.test.ts— application-ID and google-services split byANDROID_DISTRIBUTIONEnd-to-end testing against the dev API via the Play Console internal track still needs the manual Play Console prerequisites below.
Manual prerequisites (owner)
premium_annual/premium_monthlysubscription products, license testers.altbuild (EAS will offer to create one per application ID; CI expectsANDROID_ALT_*secrets)systems.lockdown.cydmobile.altin Firebase and commit its config asgoogle-services-alt.json— required for push notifications on the alt build; thebuild_android_altCI job fails with instructions until it existsDeliberate additions beyond the issue plan
storePurchaseState,restoreStorePurchases): the issue plan says to generalize the StoreKit code paths to Play; one shared purchase-state surface for both storefronts is that generalization. The iOS behavior and its tests are unchanged.Merge Danger
Door: two-way — the code is trivially revertible, but see the release coordination below.
Blast Radius: release-wide. Until the coordinated release happens, the Play build cannot be submitted (needs the Play Console products + cyd-server deployed to prod), and the first tag after merge will fail the new
build_android_altCI job until theANDROID_ALT_*secrets andgoogle-services-alt.jsonexist. Existing direct-download APK users cannot upgrade in place to the.altbuild (different application ID).(This was written by an LLM.)