diff --git a/AGENTS.md b/AGENTS.md index f77067c..0a61e55 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -12,7 +12,7 @@ definition of done for this repository. |---|---| | Product | Foto Dup Finder — offline duplicate/near-duplicate photo finder | | Model | **Freemium**: free tier with one AdMob banner, one-time Pro purchase removes ads | -| Current version | `1.1.0` / `versionCode 4` (`app/build.gradle.kts`) | +| Current version | `1.1.1` / `versionCode 5` (`app/build.gradle.kts`) | | Platform | Android, Kotlin + Jetpack Compose, single `:app` module | | Application id | `de.softwareapp_hb.fotodup.finder.free` (debug `.free.debug`); namespace/code package remains `de.softwareapp_hb.fotodup.finder` | | SDKs | `minSdk 26`, `compileSdk`/`targetSdk` 36 | @@ -30,7 +30,7 @@ Roadmap: [`docs/ROADMAP.md`](docs/ROADMAP.md) Release checklist: [`docs/PLAY_RELEASE_CHECKLIST.md`](docs/PLAY_RELEASE_CHECKLIST.md) Privacy policy: [`PRIVACY.md`](PRIVACY.md) -**Current gate:** the freemium release (`1.1.0`) is implemented in code, but the +**Current gate:** the freemium release (`1.1.1`) is implemented in code, but the Play Console work (change the app to free, create `pro_no_ads`, AdMob app/unit, UMP message, Data Safety, Ads/Advertising ID declarations) is manual. Do not describe the app as "ad-free", "no internet" or "paid once" — those claims belong @@ -242,6 +242,13 @@ Never use `./gradlew --offline` for a fresh dependency check, and never commit - Minimum before calling a change done: `./gradlew :app:testDebugUnitTest :app:lintDebug :app:assembleDebug`. For release changes also `:app:assembleRelease` (R8 + manifest merge). +- **Launch a minified build before uploading.** `assembleDebug` does not run R8 and + cannot catch shrinker-only startup crashes. Either install the release APK on a + device (uninstall the Play-signed copy first if the signatures conflict) or + temporarily enable `isMinifyEnabled`/`isShrinkResources` in the debug build type + and install it side by side. The `1.1.0` upload crashed in + `androidx.startup.InitializationProvider` because R8 removed WorkManager's + generated `WorkDatabase_Impl` constructor; `app/proguard-rules.pro` now keeps it. ## 10. Privacy and security @@ -289,12 +296,18 @@ Never use `./gradlew --offline` for a fresh dependency check, and never commit `--add-exports`). Removing them breaks the data-layer tests on JDK 17+. 9. **AOSP emulators do not have Play services.** An empty ad slot or a "purchases unavailable" message there is expected; it is not a code failure. -10. **`versionCode` must increase** for every Play upload. `1.0.2` used 3; the - freemium build is 4. Update `CHANGELOG.md` and the release checklist too. +10. **`versionCode` must increase** for every Play upload. `1.0.2` used 3, the + 1.1.0 internal-testing build used 4, and the fixed freemium build is 5. + Update `CHANGELOG.md` and the release checklist too. 11. **Do not call `navigationBarsPadding()` twice.** The bottom slot owns the inset; `BottomActionBar` must not add it again. 12. **The old paid-app docs are historical.** Do not copy "pay once", "no ads" or "no INTERNET" claims into new copy. +13. **R8 reflects into Room/WorkManager.** `play-services-ads` pulls in WorkManager + 2.7.0. The generated `androidx.work.impl.WorkDatabase_Impl` constructor is + removed by R8 unless `app/proguard-rules.pro` keeps it, producing a release-only + crash before `Application.onCreate`. Keep the rule and smoke-test a minified + build; debug builds do not reproduce it. ## 12. Definition of done @@ -310,6 +323,8 @@ Never use `./gradlew --offline` for a fresh dependency check, and never commit - [ ] `./gradlew :app:assembleDebug` succeeds. - [ ] For release-affecting work: `./gradlew :app:assembleRelease` succeeds and the merged manifest permissions are re-audited. +- [ ] For release-affecting work: a **minified build launches** on a device (R8-only + failures are invisible to `assembleDebug` and unit tests). - [ ] `docs/codemap.md` and `docs/codemap.mmd` are updated for architecture changes. - [ ] `README.md`, `PRIVACY.md`, `CHANGELOG.md`, `docs/MONETIZATION.md`, `docs/STORE_LISTING.md` and `docs/PLAY_RELEASE_CHECKLIST.md` are updated when diff --git a/CHANGELOG.md b/CHANGELOG.md index ee91f59..82aabee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,27 @@ upload needs a **higher `versionCode`** than every previous upload. ## [Unreleased] +## [1.1.1] — 2026-10-20 · versionCode 5 + +### Fixed + +- **Release-only startup crash.** The minified release build died before + `Application.onCreate` in `androidx.startup.InitializationProvider` with + `Failed to create an instance of androidx.work.impl.WorkDatabase`. WorkManager + arrives transitively through `play-services-ads`, and R8 removed the generated + Room `WorkDatabase_Impl` no-argument constructor that Room invokes reflectively. + `app/proguard-rules.pro` now keeps that constructor. Debug builds were unaffected, + which is why the first internal-testing upload looked fine locally. +- **Release smoke testing.** `AGENTS.md` and `docs/PLAY_RELEASE_CHECKLIST.md` now + require launching a minified build before uploading; unit tests and + `assembleDebug` cannot catch R8-only startup failures. + +### Changed + +- **`versionName` 1.1.1 / `versionCode` 5.** The 1.1.0 build (`versionCode` 4) was + already consumed by internal testing and crashed on startup, so it cannot be + reused for a Play upload. + ## [1.1.0] — 2026-10-20 · versionCode 4 ### Added diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 49d4741..4725c99 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -89,8 +89,8 @@ android { applicationId = "de.softwareapp_hb.fotodup.finder.free" minSdk = 26 targetSdk = 36 - versionCode = 4 - versionName = "1.1.0" + versionCode = 5 + versionName = "1.1.1" // AdMob reads its application id from the manifest, so it has to be a placeholder: // the value differs between a developer machine, CI and a release build. diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 45242f3..c9590d0 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -9,3 +9,12 @@ # Coroutines: keep the internal classes R8 sometimes struggles to strip correctly. -dontwarn kotlinx.coroutines.** + +# WorkManager 2.7.0 arrives transitively through play-services-ads and creates +# androidx.work.impl.WorkDatabase_Impl through Room's reflection. R8 removes the +# generated no-arg constructor because nothing calls it directly, which makes the +# app crash in androidx.startup.InitializationProvider with: +# Failed to create an instance of androidx.work.impl.WorkDatabase +-keep class androidx.work.impl.WorkDatabase_Impl { + public (); +} diff --git a/docs/PLAY_RELEASE_CHECKLIST.md b/docs/PLAY_RELEASE_CHECKLIST.md index c5f5631..e1138a1 100644 --- a/docs/PLAY_RELEASE_CHECKLIST.md +++ b/docs/PLAY_RELEASE_CHECKLIST.md @@ -30,10 +30,11 @@ the rest are things you must do in the Play Console / with your own accounts. ## 2. Versioning -- [x] Set `versionName` (user-visible) **[code]** — `1.1.0` in `app/build.gradle.kts`. -- [x] `versionCode` **[code]** — currently **4**. It is the counter Play orders uploads by, and - every later upload must be higher. Codes 1–3 were consumed by 1.0.0–1.0.2, so the - freemium build takes **4**. +- [x] Set `versionName` (user-visible) **[code]** — `1.1.1` in `app/build.gradle.kts`. +- [x] `versionCode` **[code]** — currently **5**. It is the counter Play orders uploads by, and + every later upload must be higher. Codes 1–3 were consumed by 1.0.0–1.0.2, and **4** by + the 1.1.0 internal-testing build (which crashed on startup, see step 3), so the fixed + freemium build takes **5**. ## 3. Build the release artefacts @@ -42,17 +43,25 @@ the rest are things you must do in the Play Console / with your own accounts. ./gradlew :app:assembleRelease # -> APK for local testing ``` -- [ ] **Build and record the 1.1.0 artefacts.** The 1.0.2 record is historical +- [ ] **Build and record the 1.1.1 artefacts.** The 1.0.2 record is historical (2,940,935 bytes, `sha256 534e5ae9…`). The freemium build adds the ads/UMP/Billing dependencies and the AdMob manifest entry, so its size and hash must be re-measured after real AdMob ids are configured. Verify the release APK reports package - `de.softwareapp_hb.fotodup.finder.free`, `versionCode=4 versionName=1.1.0 + `de.softwareapp_hb.fotodup.finder.free`, `versionCode=5 versionName=1.1.1 targetSdk=36` and the permission set in step 5 (including `INTERNET`, `AD_ID` and `BILLING`). - Local validation with the default test ids (2026-10-20): APK 3,655,562 bytes, - `sha256 931d2b21…`; signed AAB 7,680,301 bytes, `sha256 03abb548…`. - Re-measure both after setting the real ids/cutoff — the ids change the manifest and - therefore the artefacts. + The 1.1.0 validation build (`versionCode` 4, test ids) was a 3,655,562-byte APK / + 7,680,301-byte AAB, but it **crashed on launch** and must not be reused: + R8 removed `androidx.work.impl.WorkDatabase_Impl`'s no-arg constructor, which + WorkManager creates reflectively from `androidx.startup.InitializationProvider`. + `app/proguard-rules.pro` now keeps it. The 1.1.1 test-id validation build + (`versionCode` 5) is a 3,688,330-byte APK (`sha256 ee87b0eb…`) / 7,752,081-byte + AAB (`sha256 39223adb…`); `dexdump` confirms the `WorkDatabase_Impl` public + no-arg constructor is present. Re-measure both artefacts with the real ids/cutoff. +- [ ] **Launch the minified build before uploading.** Do not rely on + `assembleDebug`/unit tests: they do not run R8. Install the release APK on a + real device (or a temporarily minified debug build side by side) and confirm it + gets past the splash screen to the scanner/UMP consent. See `AGENTS.md` §9. - [ ] Upload the **`.aab`** (not the APK) to the Play Console. ⚠️ **Expect a native-debug-symbols warning here, and ignore it.** Play scans the bundle, finds `base/lib//libandroidx.graphics.path.so`, and reports *"This App Bundle contains native @@ -491,6 +500,12 @@ action except the items marked **[code]**. - [ ] Create an **internal testing** track and add yourself as a tester; install via the Play link on a real device. +- [ ] **Confirm the first screen appears.** The 1.1.0 upload (`versionCode` 4) installed + but crashed before `Application.onCreate`; versionCode 5 keeps WorkManager's + `WorkDatabase_Impl` constructor so it gets past + `androidx.startup.InitializationProvider`. If a future release crashes the same + way, check the R8 keep rule and `app/build/outputs/mapping/release/usage.txt` for + `WorkDatabase_Impl`. - [ ] Test on the oldest supported Android version you can (minSdk 26) and on the newest you have (Android 16 / API 36). - [ ] Test the permission flows: diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index 3f61e9f..2b546cc 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -31,8 +31,8 @@ Legend: ✅ done · 🚧 in progress · ⏳ not started · 💡 candidate (propo | ~~Large-library scan stall~~ ✅ **fixed — verified on device** | The 5,363-photo library used to freeze at *“74 / 100 · Comparing file signatures…”* (a **blocked syscall**: zero CPU, workers sleeping). `BoundedCall` now abandons a stuck provider call **and** trips a stall breaker after three consecutive timeouts. **Verified on the real test device (Android 12 / MIUI): the scan completes — 20.2 s cold, 11.0 s warm, 15 groups, 6 unreadable — where it used to hang.** Covered by `BoundedCallTest` and `ScanEngineEndToEndTest` | | ~~Unreleased `BoundedCall` fix~~ ✅ | The provider-call deadline shipped in **1.0.1** (`versionCode` 2) | | **Play Console: foreground-service declaration** | Declaring the `dataSync` type (App content › Foreground service permissions) is release-blocking. **[code]** the manifest already declares it, [PLAY_RELEASE_CHECKLIST](PLAY_RELEASE_CHECKLIST.md) step 5 carries all four things the form asks for (description, defer/interrupt impact, use case **Local processing: Other**, video link), and the **video now exists**: recorded on the test device on 2026-10-14 with `INSTALL=0 WARMUP=0 tools/record-fgs-demo.sh`, then verified frame by frame rather than assumed — intro at 0 s, the scan starting, **~6 s of the shade with the live "Finding duplicate photos / Looking for visually similar photos… / CANCEL" notification while the scan kept running**, and the results at the end. It is committed, and that is what published it — the link is the file's **page** in Gitea (`/src/branch/main/…`), which plays it anonymously. The `/raw/` URL is deliberately not the link: Gitea sends `Content-Security-Policy: default-src 'none'` with raw responses, so a browser navigating to the video sits on a blank tab even though the bytes are perfect. Pasting the page URL into the declaration is all that is left. Two details of the take are recorded in step 5 because they each cost an attempt: a *warm* scan is 5.4 s, shorter than the shade takes to open, so `WARMUP=0` films the cold one; and MIUI refuses `adb install` outright, so `INSTALL=0` records with the build already on the device. On a KVM-less emulator the same video cannot be made at all: every scan start dies as `am_crash … ForegroundServiceDidNotStartInTimeException` → *Force finishing activity* with no `am_kill`, i.e. emulation is too slow to reach `startForeground()` inside Android's budget (QEMU's `-icount` clock dilation made it work once, not reproducibly) | -| **Remaining Play paperwork** | Console actions only, no code: the **hosted privacy policy URL** (the working copy is now published to Gitea as [`fishfacegit/foto-duplicate-finder`](https://gitea.softwareapp-hb.de/fishfacegit/foto-duplicate-finder), so the policy renders at a public, login-free URL and only the Console paste is left), **Data safety**, the **Photo/video permissions** declaration, the **content rating / audience / app access / ads / advertising ID / export** questions, and the **listing copy + the three screenshot sets** (phone, 7-inch and 10-inch, all captured), plus the **freemium setup**: publish the new listing at `de.softwareapp_hb.fotodup.finder.free` as **Free**, create and activate the one-time product `pro_no_ads`, add the AdMob app/banner unit and UMP message, set `legacyPro.cutoffEpochMs` to the first freemium release, and update the **Ads / Advertising ID / Data Safety** answers ([MONETIZATION](MONETIZATION.md)). The old paid listing at `.finder` and its €2.99 price/sale are left untouched. Confirm **Play App Signing for the new app** (the same upload key can sign both listings). Keystore, `versionCode`, listing copy, graphics, permission audit and the signed `.aab` (the 1.0.2 `versionCode` 3 build is historical; the 1.1.0 validation build is in [PLAY_RELEASE_CHECKLIST](PLAY_RELEASE_CHECKLIST.md) step 3) are in place; rollout goes internal → closed → production. Step-by-step: [PLAY_RELEASE_CHECKLIST](PLAY_RELEASE_CHECKLIST.md) | -| ~~Store screenshots need one re-shoot~~ ✅ **done for the paid build — freemium re-shoot pending** | The old captures showed the *Photo access needed* banner (an app-op is not a grant) and `03-results.png` showed the developer's own library. After a real grant the set was re-shot over the generated demo library: **01-empty** (no tap needed — results and selection live in `ScannerViewModel`, so force-stop + relaunch returns to the empty state with the grant still in place), **02-scanning** (`5353 / 5385`), **03-results** (**17 groups, 54 of 5385 photos, 83.5 MB reclaimable**; the headline group's 43.1 MB out-ranks the device's own 39.8 MB, so no real photo is in frame) and **04-options**. Captures are taken by watching for UI **text** changes, because MIUI refuses synthetic taps (`INJECT_EVENTS`). The demo library is deleted from the test device afterwards — MediaStore **5,386 → 5,364** rows, and the 22 stale rows it leaves in the hash index are pruned by `PhotoIndexStore.pruneTo` on the next scan. Deliberately not captured: the staged state and the system confirmation dialog, because staging clears the demo group and would put real photos back in frame. **The freemium build additionally needs the banner and the Pro sheet in frame; re-shoot before the 1.1.0 listing.** Details: [STORE_LISTING](STORE_LISTING.md) | +| **Remaining Play paperwork** | Console actions only, no code: the **hosted privacy policy URL** (the working copy is now published to Gitea as [`fishfacegit/foto-duplicate-finder`](https://gitea.softwareapp-hb.de/fishfacegit/foto-duplicate-finder), so the policy renders at a public, login-free URL and only the Console paste is left), **Data safety**, the **Photo/video permissions** declaration, the **content rating / audience / app access / ads / advertising ID / export** questions, and the **listing copy + the three screenshot sets** (phone, 7-inch and 10-inch, all captured), plus the **freemium setup**: publish the new listing at `de.softwareapp_hb.fotodup.finder.free` as **Free**, create and activate the one-time product `pro_no_ads`, add the AdMob app/banner unit and UMP message, set `legacyPro.cutoffEpochMs` to the first freemium release, and update the **Ads / Advertising ID / Data Safety** answers ([MONETIZATION](MONETIZATION.md)). The old paid listing at `.finder` and its €2.99 price/sale are left untouched. Confirm **Play App Signing for the new app** (the same upload key can sign both listings). Keystore, `versionCode`, listing copy, graphics, permission audit and the signed `.aab` (the 1.0.2 `versionCode` 3 build is historical; the 1.1.1 validation build is in [PLAY_RELEASE_CHECKLIST](PLAY_RELEASE_CHECKLIST.md) step 3) are in place; rollout goes internal → closed → production. Step-by-step: [PLAY_RELEASE_CHECKLIST](PLAY_RELEASE_CHECKLIST.md) | +| ~~Store screenshots need one re-shoot~~ ✅ **done for the paid build — freemium re-shoot pending** | The old captures showed the *Photo access needed* banner (an app-op is not a grant) and `03-results.png` showed the developer's own library. After a real grant the set was re-shot over the generated demo library: **01-empty** (no tap needed — results and selection live in `ScannerViewModel`, so force-stop + relaunch returns to the empty state with the grant still in place), **02-scanning** (`5353 / 5385`), **03-results** (**17 groups, 54 of 5385 photos, 83.5 MB reclaimable**; the headline group's 43.1 MB out-ranks the device's own 39.8 MB, so no real photo is in frame) and **04-options**. Captures are taken by watching for UI **text** changes, because MIUI refuses synthetic taps (`INJECT_EVENTS`). The demo library is deleted from the test device afterwards — MediaStore **5,386 → 5,364** rows, and the 22 stale rows it leaves in the hash index are pruned by `PhotoIndexStore.pruneTo` on the next scan. Deliberately not captured: the staged state and the system confirmation dialog, because staging clears the demo group and would put real photos back in frame. **The freemium build additionally needs the banner and the Pro sheet in frame; re-shoot before the 1.1.1 listing.** Details: [STORE_LISTING](STORE_LISTING.md) | | ~~Tablet store screenshots outstanding~~ ✅ **done for the paid build — freemium re-shoot pending** | Play has a **7-inch tablet** and a **10-inch tablet** screenshot slot of its own (asking for **≥ 4** screenshots on large screens). Both are now captured on AOSP Android 12 AVDs — `Nexus 7 2013` (1200×1920, `sw600dp`) and `medium_tablet` (1600×2560, `sw800dp`) — because this machine exposes no `/dev/kvm`: they ran in **pure software emulation** (`-accel off -no-window -gpu swiftshader_indirect`), ≈3 min to boot, with `hide_error_dialogs` on so SystemUI's ANR dialog could not sit in frame. Four screens per tablet over the same generated demo library: empty, scanning (20 / 22), results (**2 groups · 16 of 22 photos · 43.7 MB reclaimable**, 39.7 s / 53.1 s) and Options. `tools/make-store-screenshots.sh` is form-factor aware (`FORM_FACTOR=phone\|tablet-7in\|tablet-10in`) and the tablet form factors crop **0 px** of chrome, because a tablet frame is already inside Play's 2:1 cap. Recipe: [STORE_LISTING](STORE_LISTING.md) | | **Device-only verifications** | RAW/DNG files, a *real* iPhone HEIC with a non-upright EXIF orientation, permission revoked mid-scan, and the Android 14 “Selected photos” flow. ✅ The **index-reuse** check is done: after a scan the index holds **5,363 rows, 5,357 with a perceptual hash**, and a second scan runs in **11.0 s vs 20.2 s** cold | @@ -49,7 +49,7 @@ Legend: ✅ done · 🚧 in progress · ⏳ not started · 💡 candidate (propo 1. ✅ **Done** — the scan-stall hardening and the `BoundedCall` fix shipped as **1.0.1** (`versionCode` 2); **1.0.2** (`versionCode` 3) was the last paid build. The next upload is - **1.1.0** (`versionCode` 4), the freemium build, which also needs the Play Console changes in + **1.1.1** (`versionCode` 5), the fixed freemium build, which also needs the Play Console changes in [MONETIZATION](MONETIZATION.md). Only the on-device re-check of the 5,363-photo scan remains. 2. Finish the Play Console paperwork and roll out through **internal → closed → production**. 3. ✅ **Done** — **M10 store assets**: the icon and feature graphic are generated from the