Files
foto-duplicate-finder-free/docs/codemap.mmd
T
SoftwareApp 22091dd808 feat: turn the paid app into a freemium app with ads and Pro
- add a single AdMob anchored adaptive banner to the free tier
- add UMP consent and a privacy-options entry point before ads load
- add the one-time Play Billing product `pro_no_ads`; Pro removes the banner
  and nothing else, every scan/selection/deletion feature stays free
- cache the entitlement locally, handle pending purchases, acknowledge and
  retry acknowledgement, and restore from Play on resume
- grandfather paid installs through `legacyPro.cutoffEpochMs`, checking both
  the new package and the old paid package declared in <queries>
- move the Play identity to `de.softwareapp_hb.fotodup.finder.free` while
  keeping the Kotlin namespace `de.softwareapp_hb.fotodup.finder`
- add a debug-only Pro toggle and focused monetisation tests
- add AGENTS.md, docs/codemap.md, docs/codemap.mmd and docs/MONETIZATION.md
- update README, PRIVACY, CHANGELOG, ROADMAP, store copy and the Play checklist
- bump to 1.1.0 / versionCode 4
2026-10-20 09:28:29 +02:00

165 lines
4.5 KiB
Plaintext

%% Foto Dup Finder — standalone code map
%% Render with a Mermaid-enabled Markdown preview, GitHub/GitLab, or the Mermaid CLI.
%% Full narrative, runtime flows and change-impact matrix: docs/codemap.md
flowchart TB
subgraph ENTRY["App entry"]
app["FotoDupApplication<br/>process singletons"]
main["MainActivity<br/>edge-to-edge + consent"]
theme["FotoDupTheme"]
end
subgraph UI["UI — Jetpack Compose"]
screen["ScannerScreen<br/>permissions, scaffold, menu"]
vm["ScannerViewModel<br/>selection, deletion, Pro actions"]
uiState["ScannerUiState"]
sections["ScannerSections<br/>banner, progress, empty state"]
groups["GroupSection<br/>summary + group cards"]
thumb["PhotoThumbnail"]
banner["BannerAdSlot<br/>adaptive AdView"]
proSheet["ProSheet<br/>one-time purchase"]
textRes["text/TextRes"]
end
subgraph DOMAIN["Domain"]
scanController["ScanController<br/>process-scoped scan owner"]
scanEngine["ScanEngine<br/>tiered pipeline"]
scanModels["ScanModels<br/>progress, result, phase"]
parallel["Parallel<br/>bounded CPU fan-out"]
end
subgraph SERVICE["Service"]
scanService["ScanService<br/>dataSync foreground service"]
end
subgraph DATA["Data — Android"]
mediaSource["MediaStorePhotoSource"]
hasher["PhotoHasher<br/>signature, SHA-256, pHash"]
indexStore["PhotoIndexStore<br/>SQLite hash cache"]
deleter["MediaDeleter<br/>system consent"]
permissions["AppPermissions"]
bounded["BoundedCall<br/>provider deadlines"]
photoRecord["PhotoRecord"]
end
subgraph CORE["Core — pure Kotlin, no Android imports"]
hashing["Hashing<br/>quick + SHA-256"]
phash["PerceptualHash<br/>64-bit pHash"]
rgb["RgbDHash<br/>RGB difference hashes"]
grouper["DuplicateGrouper<br/>union-find + fit"]
policy["DuplicatePolicy"]
adaptive["AdaptiveThreshold"]
group["DuplicateGroup"]
dsu["DisjointSet"]
decode["DecodeMath"]
bytes["ByteUtils"]
fingerprint["PhotoFingerprint"]
end
subgraph MONETIZATION["Monetization"]
proStore["ProStore<br/>Billing + entitlement cache"]
adsController["AdsController<br/>UMP + Mobile Ads"]
proState["ProState"]
adsState["AdsState"]
adPolicy["AdPolicy<br/>banner gate"]
legacy["LegacyPro<br/>paid-install cutoff"]
product["ProProduct<br/>pro_no_ads"]
end
subgraph DEBUG["Debug only"]
debugScan["DebugScanTrigger"]
debugPro["DebugProToggle"]
end
mediaStore[("MediaStore<br/>photo library")]
sqlite[("photo_index.db")]
prefs[("pro_entitlement<br/>SharedPreferences")]
admob[("Google AdMob")]
ump[("Google UMP")]
play[("Google Play Billing")]
notification[("Scan notification")]
app --> scanController
app --> proStore
app --> adsController
main --> app
main --> screen
main --> theme
main --> adsController
screen --> vm
screen --> sections
screen --> groups
screen --> banner
screen --> proSheet
screen --> theme
screen --> textRes
vm --> uiState
vm --> scanController
vm --> proStore
vm --> adsController
vm --> deleter
sections --> uiState
sections --> textRes
groups --> uiState
groups --> thumb
banner --> adPolicy
proSheet --> proState
scanController --> scanEngine
scanController --> scanService
scanController --> scanModels
scanEngine --> scanModels
scanEngine --> parallel
scanEngine --> mediaSource
scanEngine --> hasher
scanEngine --> indexStore
scanEngine --> grouper
scanEngine --> policy
scanEngine --> adaptive
scanEngine --> group
scanService --> scanController
scanService --> notification
mediaSource --> photoRecord
mediaSource --> permissions
mediaSource --> bounded
mediaSource -.->|query| mediaStore
hasher --> hashing
hasher --> phash
hasher --> rgb
hasher --> fingerprint
hasher --> decode
hasher --> bounded
hasher -.->|read bytes and thumbnails| mediaStore
indexStore --> photoRecord
indexStore -.->|SQLite| sqlite
deleter -.->|system delete request| mediaStore
hashing --> bytes
phash --> decode
rgb --> decode
grouper --> group
grouper --> dsu
grouper --> policy
grouper --> adaptive
group --> fingerprint
proStore --> product
proStore --> proState
proStore --> legacy
proStore -.->|query purchases and acknowledge| play
proStore -.->|entitlement cache| prefs
adsController --> adsState
adsController -.->|consent form| ump
adsController -.->|initialize| admob
banner -.->|AdView request| admob
debugScan -.-> scanController
debugPro -.-> proStore