Skip to content

[Oztechan/AdTrack#171] Reset iOS premium on reinstall (move premium off Keychain) - #172

Merged
mustafaozhan merged 1 commit into
developfrom
171/Ads-ios-premium-reset-on-reinstall
Oct 2, 2026
Merged

mustafaozhan merged 1 commit into
developfrom
171/Ads-ios-premium-reset-on-reinstall

Conversation

@mustafaozhan

@mustafaozhan mustafaozhan commented Sep 5, 2026 •

Copy link
Copy Markdown
Member

Closes #171. Sub-task of #121.

Problem

On iOS, premium shared the Keychain-backed SecureStorage with auth tokens. The Keychain survives app uninstall, so a granted premium window persisted across reinstall — inconsistent with Android, where all app storage is wiped on uninstall.

Fix

  • New PreferenceStorage — a sandbox-scoped, uninstall-wiped key/value store, deliberately not Keychain-backed.
    • iOS: backed by NSUserDefaults (wiped on uninstall, unlike the Keychain) → premium now resets on reinstall.
    • Android: reuses the existing store; Android already wipes app data on uninstall, so behaviour is unchanged there. The change is wiring only (the shared PremiumManagerImpl now needs this type on both platforms).
  • PremiumManagerImpl depends on PreferenceStorage instead of SecureStorage.
  • Auth tokens are untouched — they stay in Keychain-backed SecureStorage, so users stay logged in across reinstall.
  • DI/test support + affected Koin/manager tests updated.

Verified

  • :common:testDebugUnitTest + :common:detektAll green.
  • :common:compileKotlinIosSimulatorArm64 green (NSUserDefaults binding resolves).

Note: no production users yet, so no in-flight premium windows are affected.

@mustafaozhan mustafaozhan self-assigned this Sep 5, 2026
@mustafaozhan mustafaozhan added this to the 1.0.0 milestone Sep 5, 2026
@codecov

codecov Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 63.42%. Comparing base (0c226ef) to head (f3e3420).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
...oztechan/adtrack/core/storage/PreferenceStorage.kt 75.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #172      +/-   ##
===========================================
- Coverage    63.63%   63.42%   -0.21%     
===========================================
  Files           69       70       +1     
  Lines         1031     1036       +5     
  Branches       115      115              
===========================================
+ Hits           656      657       +1     
- Misses         321      325       +4     
  Partials        54       54              

Impacted file tree graph

Files with missing lines Coverage Δ
.../com/oztechan/adtrack/di/PlatformModule.android.kt 31.25% <100.00%> (+4.58%) ⬆️
...oztechan/adtrack/ads/premium/PremiumManagerImpl.kt 100.00% <100.00%> (ø)
...oztechan/adtrack/core/storage/PreferenceStorage.kt 75.00% <75.00%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…andbox store

Premium moves from the Keychain-backed SecureStorage (shared with auth tokens) to a new
PreferenceStorage. On iOS that's NSUserDefaults (wiped on uninstall, unlike the Keychain), so
premium resets on reinstall. On Android, PreferenceStorage reuses the existing store — Android
already wipes app data on uninstall, so behaviour there is unchanged. Auth tokens stay in the
Keychain-backed SecureStorage.
@mustafaozhan
mustafaozhan force-pushed the 171/Ads-ios-premium-reset-on-reinstall branch from f2e3fc7 to f3e3420 Compare September 5, 2026 21:21
@mustafaozhan
mustafaozhan merged commit 5599ff9 into develop Oct 2, 2026
11 checks passed
@mustafaozhan
mustafaozhan deleted the 171/Ads-ios-premium-reset-on-reinstall branch October 2, 2026 08:14
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.

Ads: reset iOS premium on reinstall (move off Keychain)

1 participant