m7c: Play Billing and a complete deletion path

- billing module with a testable seam: models (product ids, purchase events),
  StoreClient + PlayStoreClient over in_app_purchase, Entitlements persisted in
  SharedPreferences, BillingService orchestrating query/buy/restore/grant.
- rules encoded: grant before completePurchase (Play refunds unacknowledged
  purchases after three days), pending purchases are shown but never granted,
  restorePurchases on start so a reinstall keeps the purchase, and Remove Ads
  only hides interstitials - rewarded video stays available.
- ads gate: AdsService.adsRemoved stops both the counter and the preload, so an
  owner never requests an interstitial.
- settings sheet: shop section (price from the store, never hardcoded),
  "restore purchases", and "delete local data" with confirmation; the existing
  mail-based deletion request stays the account-deletion path since the app has
  no accounts.
- 9 new tests with a fake store cover purchase, restore, pending, cancel,
  error, restart persistence, missing store and a store that throws. 17 total.
- verified on device: the app talks to the real Play Billing service
  (IInAppBillingService in logcat) and degrades to "no products created"
  without a crash; com.android.vending.BILLING is in the merged manifest.
- docs: monetization 7c (rules + verification), decision D6 (local entitlement
  until purchases affect the server), compliance rows for billing/restore/
  deletion, blocked.md 3c (create remove_ads in the Console).
- release 0.9.0 (13).
This commit is contained in:
2026-10-25 04:06:44 +01:00
parent 82bd496cc9
commit a26e0b93b5
15 changed files with 868 additions and 6 deletions
+40
View File
@@ -136,6 +136,38 @@ packages:
url: "https://pub.dev"
source: hosted
version: "4.1.2"
in_app_purchase:
dependency: "direct main"
description:
name: in_app_purchase
sha256: d8317ec2ed6fe33199957d67ee67e08a4fd4871ef93b91d7611d8ee560892afc
url: "https://pub.dev"
source: hosted
version: "3.3.1"
in_app_purchase_android:
dependency: transitive
description:
name: in_app_purchase_android
sha256: b76ab601573f8a848e72d015496257235066ba3479bef6300482239f417e0d72
url: "https://pub.dev"
source: hosted
version: "0.5.5"
in_app_purchase_platform_interface:
dependency: transitive
description:
name: in_app_purchase_platform_interface
sha256: "0b0076cac8ce4fa7048f01e76af8b123aeb6a7c4e0dea2a5206d6664454f3e36"
url: "https://pub.dev"
source: hosted
version: "1.4.1"
in_app_purchase_storekit:
dependency: transitive
description:
name: in_app_purchase_storekit
sha256: de4f86b7bed848cd60a32c93affad868ba06a5276c007e23878855558094ff43
url: "https://pub.dev"
source: hosted
version: "0.4.15"
jni:
dependency: transitive
description:
@@ -152,6 +184,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.0"
json_annotation:
dependency: transitive
description:
name: json_annotation
sha256: "2a743920d81b7910627f68ee2c9ac1fc0bfee32b9fc3403587d7c6791ca12f80"
url: "https://pub.dev"
source: hosted
version: "4.12.0"
leak_tracker:
dependency: transitive
description: