Skip to content

Restore the ad removal from Play purchases - #730

Merged
andiwand merged 1 commit into
mainfrom
fix-ad-removal-purchase
Oct 24, 2026
Merged

andiwand merged 1 commit into
mainfrom
fix-ad-removal-purchase

Conversation

@andiwand

@andiwand andiwand commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

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

  • Lite links com.android.billingclient:billing:9.1.0 again. Pro and Foss do not link it, and only the Lite manifest has the BILLING permission.
  • OwnedPurchases (src/ads) asks Play for owned INAPP and SUBS purchases. The app sold remove_ads_subscription until 2022, so the query includes subscriptions. src/noAds has a no-op version.
  • BillingManager runs the query at each start without the preference. If Play reports a purchase in the state PURCHASED, it saves the preference, removes the ads, updates the consent info, and refreshes the landing screen.

Notes

  • On the first start after a reinstall, ads show until Play answers.
  • The app never revokes a purchase, as before. An ended subscription still keeps the ads off.
  • The Data safety form in Play Console may need a check, because Lite links the billing library again.

Tests

  • assembleLiteDebug, assembleProDebug, assembleFossDebug, lintLiteDebug, spotlessCheck, and testProDebugUnitTest pass.
  • Not tested with a real purchase: that needs an account that owns the old product.

🤖 Generated with Claude Code

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
@andiwand
andiwand merged commit 3e66eb8 into main Oct 24, 2026
2 checks passed
@andiwand
andiwand deleted the fix-ad-removal-purchase branch October 24, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant