Repository navigation
Restore the ad removal from Play purchases - #730
Merged
Merged
Conversation
Commit bf8e410 removed the Play Billing library in 2023. Since then, Lite knows about a purchase only from a local preference. A buyer who reinstalls the app or changes device sees ads again. Lite links the billing library again. At each start without the preference, OwnedPurchases asks Play for owned one-time products and subscriptions. If the account owns one, BillingManager saves the preference and removes the ads. Pro and Foss do not link the library. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VpdRKfQv8WnENqcVbMpRhf
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.
Problem
A user bought the ad removal in Lite, but the app shows ads. Commit bf8e410 removed the Play Billing library in 2023. Since then, Lite knows about a purchase only from the local preference
purchaseAcknowledged. If a buyer reinstalls the app, clears its data, or changes device, the preference is gone and the ads come back.Change
com.android.billingclient:billing:9.1.0again. Pro and Foss do not link it, and only the Lite manifest has theBILLINGpermission.OwnedPurchases(src/ads) asks Play for ownedINAPPandSUBSpurchases. The app soldremove_ads_subscriptionuntil 2022, so the query includes subscriptions.src/noAdshas a no-op version.BillingManagerruns the query at each start without the preference. If Play reports a purchase in the statePURCHASED, it saves the preference, removes the ads, updates the consent info, and refreshes the landing screen.Notes
Tests
assembleLiteDebug,assembleProDebug,assembleFossDebug,lintLiteDebug,spotlessCheck, andtestProDebugUnitTestpass.🤖 Generated with Claude Code