Files
foto-duplicate-finder-free/docs/PLAY_RELEASE_CHECKLIST.md
T

653 lines
44 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Google Play release checklist
Work top to bottom. Items marked **[code]** are already handled in this repository;
the rest are things you must do in the Play Console / with your own accounts.
## 1. Identity and signing
- [x] Final **application id** chosen: `de.softwareapp_hb.fotodup.finder.free`
(`applicationId` in `app/build.gradle.kts`). It can **never be changed after the
first release**, so treat it as locked. This is a **new Play listing**, separate
from the old paid app at `de.softwareapp_hb.fotodup.finder`; the code package and
`namespace` deliberately stay `de.softwareapp_hb.fotodup.finder`, and debug builds
append `.debug` → `de.softwareapp_hb.fotodup.finder.free.debug`.
- [x] Generate an **upload keystore** (keep it safe; if you lose it you cannot
publish updates) — **[code]** done: `fotodup-upload.jks` in the project root
(git-ignored, `alias upload`), `CN=Hadrian Burkhardt, L=Potsdam, C=DE`.
- [x] Copy `keystore.properties.example` to `keystore.properties` and fill it in.
**[code]** done — the file is in place, and the Gradle build picks it up automatically and
signs release builds; without it the release APK stays unsigned.
- [ ] Enable **Play App Signing** for the **new** app in the Play Console and upload the
certificate of your *upload* key (the same upload key can sign both listings):
```bash
keytool -exportcert -alias upload -keystore fotodup-upload.jks -rfc > upload_cert.pem
```
Upload key fingerprint (SHA-256), to confirm the right key was registered:
`AA:8C:3D:6C:D0:55:46:50:48:ED:04:3E:AF:34:2B:66:B4:13:87:C9:E0:DA:29:70:5A:0D:18:47:08:1A:4C:7A`.
Enrolment happens with the first upload of the new listing: Google then holds that
app's signing key and this one only signs uploads.
- [ ] Store the keystore + passwords in a password manager / secure vault. Back it up.
## 2. Versioning
- [x] Set `versionName` (user-visible) **[code]** — `1.1.1` in `app/build.gradle.kts`.
- [x] `versionCode` **[code]** — currently **6**. 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, **4** by
the 1.1.0 internal-testing build (which crashed on startup), and **5** by an earlier
1.1.1 upload, so the corrected freemium build takes **6**.
## 3. Build the release artefacts
```bash
./gradlew :app:bundleRelease # -> app/build/outputs/bundle/release/app-release.aab
./gradlew :app:assembleRelease # -> APK for local testing
```
- [x] **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=6 versionName=1.1.1
targetSdk=36` and the permission set in step 5 (including `INTERNET`, `AD_ID` and
`BILLING`).
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 current 1.1.1 / versionCode 6 build
(real AdMob ids and `legacyPro.cutoffEpochMs=1792504293000`) is a 3,688,330-byte
APK (`sha256 6043ec92…`) / 7,752,264-byte AAB (`sha256 4766ca49…`); `dexdump`
confirms the `WorkDatabase_Impl` public no-arg constructor is present. Rebuild
and re-measure if the ids or cutoff change.
- [ ] **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/<abi>/libandroidx.graphics.path.so`, and reports *"This App Bundle contains native
code, and you've not uploaded debug symbols"*. It is a recommendation, not an error: it does
not block the upload, review or rollout.
- That one library (4 ABIs, ~37 KB total) is **not** this project's code — it arrives
transitively through `androidx.compose.ui:ui-graphics` →
`androidx.graphics:graphics-path:1.0.1`. The project has no `ndk` / `externalNativeBuild` /
`jniLibs` config and no native sources at all.
- There is nothing to upload: the published `graphics-path-1.0.1.aar` ships **stripped** libs
(`symtab=0`, no `.debug_*` sections, no symbol entries anywhere in the AAR), and the
commonly-suggested fix does not apply — with `ndk.debugSymbolLevel = "FULL"` the build
succeeds but produces no `app/build/outputs/native-debug-symbols/` output and adds nothing
to the bundle, because AGP only packages symbols for native code it builds itself.
- Excluding the lib (`packaging { jniLibs { excludes += "**/libandroidx.graphics.path.so" } }`)
would silence the warning but risks `UnsatisfiedLinkError` inside Compose's path handling,
for a 37 KB saving. Not worth it.
- What it actually costs: symbolication of frames *inside that Compose helper*. Kotlin/Java
crashes are unaffected — the R8 mapping rides inside the bundle
(`BUNDLE-METADATA/com.android.tools.build.obfuscation/proguard.map`), so Play deobfuscates
them automatically.
- [ ] Keep `app/build/outputs/mapping/release/mapping.txt` for every release so you
can de-obfuscate crash reports (upload it under *Release > App bundle explorer*).
## 4. Store listing
Ready-to-paste copy and the generated graphics live in
[docs/STORE_LISTING.md](STORE_LISTING.md) (milestone M10). Everything below is a Console
action except the items marked **[code]**.
- [ ] **Freemium Console setup — this replaces the old paid-app step.**
1. Create the **new Play app** for `de.softwareapp_hb.fotodup.finder.free` and
publish it as **Free** (new apps are free by default). Do **not** change the old
paid listing's price; it can stay for existing customers or be unpublished.
2. *Monetise > Products > In-app products* → create **`pro_no_ads`**, type **One-time
product**, set the price, **Activate** it. The product id must match
`ProProduct.ID` exactly; an inactive product is not returned by Play.
3. AdMob → create/link the Android app, one **Banner** unit and a **UMP message**.
Put the ids in `local.properties` (`admob.appId`, `admob.bannerUnitId`) or pass
`-Padmob.appId=...`; never commit them.
4. Set `legacyPro.cutoffEpochMs` to the instant of the first freemium release.
Installs older than that are grandfathered into Pro; a `0` cutoff disables the
migration. Because the new app has a different applicationId, this only works
when the old paid app is still installed on the first freemium launch. Tell
existing customers to keep the old app installed for that first run, or use a
promo code/support flow.
5. Add **license testers**, upload to **internal testing**, and test buy, cancel,
pending, restore, reinstall and a second device with the same account. Use a promo
code or a license-tester purchase, never a real charge.
6. Update the **Ads**, **Advertising ID** and **Data Safety** answers in step 5.
Full steps: [MONETIZATION](MONETIZATION.md); rationale and copy:
[STORE_LISTING › App pricing](STORE_LISTING.md#app-pricing).
- [ ] App name (≤ 30 chars): "Foto Dup Finder" (15 chars).
- [ ] Short description (≤ 80 chars) — two freemium options are drafted and length-checked
in STORE_LISTING.md. “Free” is now accurate, but Play's metadata policy still keeps
price and promotional wording out of the title, icon and developer name.
- [ ] Full description (≤ 4000 chars) — drafted in STORE_LISTING.md. It states the free
tier / one-time Pro distinction in the body, not as a promotional gimmick.
- [x] **App icon** 512×512 PNG **[code]** — `tools/make-store-assets.sh` renders it from the
same vectors as the adaptive icon in `res/drawable/ic_launcher_*`.
- [x] **Feature graphic** 1024×500 PNG **[code]** — same script.
- [x] **Phone screenshots** (at least 2, up to 8) **[code]** — four are captured and normalised to
1080×2160 in `store-assets/screenshots/phone/` (committed): empty state, scanning
(`5353 / 5385`), results (**17 duplicate groups, 54 of 5385 photos, 83.5 MB reclaimable**)
and the Options menu. They were shot after a real permission grant and over the generated
demo library (`tools/make-demo-photos.py`), so neither the "Photo access needed" banner nor
a personal photo is in frame; the demo library is deleted from the test device again once
the captures are done.
Upload the four, then drag **03-results** to first place — the results screen is the one
that sells, and the empty state is the weakest opener.
⚠️ Play rejects a screenshot whose longer side is more than 2× its shorter side, so a
1080×2400 phone capture has to be cropped to 1080×2160;
`tools/make-store-screenshots.sh` does exactly that (status and navigation bars only).
- [x] **7-inch tablet screenshots** **[code]** — captured on a `Nexus 7 2013` AOSP Android 12 AVD
(1200×1920 portrait, `sw600dp`) and normalised to `store-assets/screenshots/tablet-7in/`
(committed) with `FORM_FACTOR=tablet-7in ./tools/make-store-screenshots.sh`: the same four
screens as the phone set, over the same generated demo library — empty state, scanning
(*“Looking for visually similar photos…”* 20 / 22), results (**2 duplicate groups, 16 of 22
photos, 43.7 MB reclaimable**, scanned in 39.7 s) and the Options menu (✓ on *Balanced*).
Play asks for **at least 4 screenshots** on tablets, so four is the floor, not the target.
📋 A tablet frame is already inside Play's 2:1 cap, so this form factor deliberately crops
**0 px** of system chrome; the tablet captures are the raw screencaps, flattened to 24-bit.
- [x] **10-inch tablet screenshots** **[code]** — same run on a `medium_tablet` AOSP Android 12 AVD
(1600×2560 portrait, `sw800dp`), normalised into `store-assets/screenshots/tablet-10in/` with
`FORM_FACTOR=tablet-10in`: scanning at 20 / 22 and the same **2 groups · 16 of 22 photos ·
43.7 MB reclaimable** results screen, scanned in 53.1 s.
⚠️ Both AVDs ran in **pure software emulation**, because this machine exposes no `/dev/kvm`
(`-accel off -no-window -gpu swiftshader_indirect`): ≈3 min to boot and 1–12 s per screenshot.
`hide_error_dialogs` was turned on and animations off, because under software emulation SystemUI
raises an ANR dialog that would otherwise sit in frame. Full recipe:
[STORE_LISTING](STORE_LISTING.md) › Screenshots › 7-inch and 10-inch tablets.
- [ ] Category: *Tools* (or *Photography* — pick it **before** the tags, because it shapes the
*Suggested tags* list). Tags: **max 5, from Play's own list, not typed freely — and only two
are honest for this app: *Photography*, plus optionally *Privacy & security*.** Play's
taxonomy contains no duplicate/cleanup tag at all, so do not pad the field with
*Photo editor* just to fill it; the reasoning is in
[STORE_LISTING](STORE_LISTING.md) › Category and tags.
## 5. Policy and compliance
- [ ] Host [PRIVACY.md](../PRIVACY.md) at a public URL and paste that URL into the
Play Console. **This is mandatory** because the app accesses photos. The contact address
in it is final (`softwareapp.hb@gmail.com`), so the file publishes as-is.
**Hosting half done (2026-10-14):** the working copy is published to the Gitea instance as
[`fishfacegit/foto-duplicate-finder`](https://gitea.softwareapp-hb.de/fishfacegit/foto-duplicate-finder)
(`origin` = `ssh://git@gitea-container.incus:2222/fishfacegit/foto-duplicate-finder.git`), so
the policy now has a public, login-free URL:
- **rendered HTML (use this one in the Console):**
`https://gitea.softwareapp-hb.de/fishfacegit/foto-duplicate-finder/src/branch/main/PRIVACY.md`
- raw `text/plain` fallback:
`https://gitea.softwareapp-hb.de/fishfacegit/foto-duplicate-finder/raw/branch/main/PRIVACY.md`
What is left is the Console paste: open the URL in a private window to prove it needs no
login, then put it in **App content › Privacy policy**. A dedicated HTML page (the landing
page would do) reads better than a file view inside the repo; any static host works the same
way, the requirement is only that the URL is public, stable and readable without an account.
> **Note on Play's automatic translation:** it translates the *store listing*, not
> the hosted policy. If you want the policy in another language, host a translated
> copy yourself and link it from the listing.
- [ ] Complete the **Data safety** form:
- *Does your app collect or share any required user data types?* → **Yes**.
- **Device or other IDs** → collected and shared (advertising ID, app set ID,
account-related identifiers where applicable). Purpose: **Advertising or
marketing**, **Analytics**, **Fraud prevention, security and compliance**.
- **App activity** → collected and shared (app launch, taps, video views) for
advertising/analytics.
- **Diagnostics** → collected and shared (launch time, hang rate, energy usage).
- **Location** → **Approximate location**, collected/shared if the Console treats the
ads SDK's IP-based estimate as location; the app itself requests no location
permission.
- **Photos** → **not collected**: read and processed on-device only.
- *Is all user data encrypted in transit?* → **Yes** (Google states TLS for the ads
SDK; Play Billing is handled by Google).
- *Do you provide a way for users to request data deletion?* → The developer holds
no server-side data. Uninstalling/clearing app storage removes the local index and
Pro cache; users can reset/delete the advertising ID in Android Settings and change
consent through **Privacy options** where UMP requires it.
- **Purchases** are handled entirely by Google Play. The app never receives payment
details; the optional `pro_no_ads` entitlement is cached locally.
- The full data-type list and the source are in
[MONETIZATION › Play Console declarations](MONETIZATION.md#8-play-console-declarations-and-data-safety).
Re-read the form if the AdMob/UMP configuration or the Billing dependency changes.
- [x] Confirm the **permission set** the Console will show. **[code]** the freemium build adds
the ads and Billing permissions; re-check from the *merged* release manifest rather than the
source one after any dependency change, so nothing a library quietly adds slips past:
| Declared permission | Why | From |
|---|---|---|
| `READ_MEDIA_IMAGES` | read the photo library | app |
| `READ_MEDIA_VISUAL_USER_SELECTED` | Android 14 partial access | app |
| `READ_EXTERNAL_STORAGE` (`maxSdkVersion=32`) | same, on Android ≤ 12 | app |
| `WRITE_EXTERNAL_STORAGE` (`maxSdkVersion=29`) | legacy delete on Android 10 only | app |
| `FOREGROUND_SERVICE`, `FOREGROUND_SERVICE_DATA_SYNC` | keep a scan alive | app |
| `POST_NOTIFICATIONS` | scan-progress notification | app |
| `INTERNET`, `ACCESS_NETWORK_STATE` | free-tier ads/consent + Pro purchase | app / Ads SDK |
| `com.google.android.gms.permission.AD_ID` | advertising ID | Ads SDK |
| `ACCESS_ADSERVICES_AD_ID`, `ACCESS_ADSERVICES_ATTRIBUTION`, `ACCESS_ADSERVICES_TOPICS` | Privacy Sandbox | Ads SDK |
| `WAKE_LOCK` | ad rendering | Ads SDK |
| `com.android.vending.BILLING` | one-time `pro_no_ads` purchase | Billing SDK |
| `…DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION` | framework-generated, not user-facing | AndroidX |
`MANAGE_EXTERNAL_STORAGE` must remain **absent**. `INTERNET` is load-bearing for ads
and Billing, so the old “no network permission” claim no longer holds; the remaining
promise is narrower and still true: the app's own code never uploads photos,
thumbnails, hashes or filenames. Audit the merged manifest with:
```bash
./gradlew :app:processReleaseMainManifest
grep -A1 '<uses-permission' \
app/build/intermediates/merged_manifests/release/processReleaseManifest/AndroidManifest.xml \
| grep -oE '[A-Za-z0-9_.]*permission\.[A-Z_]+|com\.android\.vending\.BILLING' | sort -u
```
(Match `<uses-permission` only. A bare `android.permission.` grep also picks up
`android.permission.DUMP`, which AndroidX puts on its profile-installer *receiver* —
a component restriction, not a permission the app requests.)
- [ ] Answer the **Photo and video permissions** declaration (App content › Photo and video
permissions). It lists `READ_MEDIA_IMAGES` as *undeclared* and asks one question per
permission — in a box with a hard **250-character** limit:
> **Read media images** — Describe why the Android photo picker or other system pickers do
> not fully support your app's core functionality, and why your app needs to use the
> `READ_MEDIA_IMAGES` permission.
Paste — **243** of the 250 characters, pure ASCII so the count cannot drift on paste:
> The app needs READ_MEDIA_IMAGES to read every photo, because duplicate detection compares
> each photo with every other. A picker exposes only selected files, and a photo's duplicates
> are exactly the files it withholds. All hashing is on-device.
One sentence carries the whole argument: the reason the permission is needed *is* the reason
the picker cannot work. A picker hands over the files the user selected, and duplicates are
by definition the files nobody selected — the copies of a picked photo live in the part of
the library the picker never exposes. The closing sentence is there because a permission
declaration is also a privacy statement, and 25 characters is a cheap way to say it. If you
would rather open with the comparison than with the permission, this fits too (**228**):
> Finding duplicates requires comparing every photo with every other, so the app must read
> the whole library via READ_MEDIA_IMAGES. A picker exposes only selected files, and a
> photo's duplicates are exactly the files it withholds.
The longer versions below are kept for anywhere that is *not* capped at 250 — Play sometimes
follows up by email, and both read well wherever more detail is wanted. **1 689 characters**:
> Foto Dup Finder's core functionality is finding duplicate and visually similar photos
> across the user's whole photo library, and letting the user delete the copies. Reading the
> photo library is that entire operation.
>
> The Android photo picker cannot support it. The picker only grants access to the items the
> user selects in that session, and the duplicates are by definition outside that selection:
> the copies of a picked photo are other files, in other folders, that the picker never hands
> over. Comparing only the picked items tells the user nothing they did not already know;
> finding the groups requires comparing every photo in the library with every other photo.
>
> The app also needs the whole library to calibrate itself. It estimates the distance
> distribution of unrelated photos from the library's own pairwise perceptual-hash distances
> and sets the widest similarity threshold whose expected number of accidental matches stays
> in budget. Below a few hundred pairs that fit is impossible and the app falls back to a
> default; over a hand-picked subset it would be meaningless, because a selection is not a
> sample of the library — it is the part the duplicates are not in.
>
> Nothing is uploaded: photos are read and hashed entirely on the device. The only
> network use is the free tier's ads/consent SDK and the optional Pro purchase, and
> neither ever receives a photo, thumbnail, hash or filename. Any deletion requires an
> explicit selection by the user and always goes through Android's own confirmation
> dialog (`MediaStore.createDeleteRequest` / `createTrashRequest`) — never silently — and
> the app never requests `MANAGE_EXTERNAL_STORAGE`. Partial access
> (`READ_MEDIA_VISUAL_USER_SELECTED`) is declared and supported as a reduced mode for
> users who prefer to hand over fewer photos.
…and **682 characters**, for a box with less room than that:
> Foto Dup Finder's only function is finding duplicate and similar photos across the user's
> whole photo library and letting them delete the copies: reading the library is the feature.
> The Android photo picker grants access only to the items a user selects, while the
> duplicates of a picked photo are precisely the files the picker never hands over — a
> selection cannot answer "what is duplicated in my library". The app also calibrates its
> similarity threshold from the library's own pairwise distance distribution, which needs the
> whole library to mean anything. Photos are processed on-device and never uploaded; the
> only network use is ads/consent and the optional Pro purchase, and deletion always goes
> through Android's confirmation dialog.
Nothing in any of them is aspirational — every claim is a place in the code, so it can be
defended if Play comes back with questions:
| The answer claims … | … and this is where that is true |
|---|---|
| the app reads the whole library | `MediaStorePhotoSource.loadPhotos()` queries the image collection with a `null` selection — metadata only, pixels later and lazily |
| duplicate detection needs every pair | `DuplicateGrouper` clusters by exact SHA-256 *and* perceptual fingerprints, union-find over the whole scan |
| the threshold is fitted per library | `AdaptiveThreshold.choose()` estimates the unrelated-photo distribution from the scan's own pairwise histogram and returns the widest threshold keeping the *expected* number of accidental matches in budget; under `MIN_SAMPLE` = 200 pairs it falls back to the policy ceiling |
| a selection cannot stand in for a library | that histogram is built from every pair in the scan — the phone's 5,385-photo library fitted to *pHash ≤ 10 bits* and said so on screen, while the 22-photo tablet library was too small to fit and used its ceiling (`(default)`) |
| a constant threshold cannot work | `AdaptiveThreshold` KDoc and README § scan pipeline: the widest pHash threshold with zero false pairs falls from **13 (120 images) to 5 (2 880)** as a library grows |
| photos never leave the device | `ScanEngine` / `PhotoHasher` operate on local bytes and the SQLite index; no photo, thumbnail, hash or filename is sent. Only AdMob/UMP/Billing use the network (see [MONETIZATION](MONETIZATION.md)) |
| deletion is never silent | `MediaDeleter` → `MediaStore.createDeleteRequest` / `createTrashRequest`; no `MANAGE_EXTERNAL_STORAGE` |
| partial access is real, not a gesture | `AppPermissions.MediaAccess.PARTIAL` / `hasPartialAccess()`, with a banner and a prompt to upgrade to full access |
Three notes for filling the form in. (1) The declaration asks about `READ_MEDIA_IMAGES` only:
`READ_MEDIA_VISUAL_USER_SELECTED` is the *narrow* half of the pair and needs no justification,
so do not volunteer it as though it were the broad one. (2) If that screen also asks for a
**video**, the recorded foreground-service demo does show a full 5,385-photo library scan and
the groups it found, which is the functionality this declaration is about — but it was filmed
to answer the foreground-service question, so it is a fallback rather than the intended
answer, and a take focused on this question (open → grant → scan → groups) may be asked for.
(3) If the declaration were refused, the app already runs in the partial mode it implements
(banner + subset scan), so nothing would need rewriting — what would be lost is the promise
("find the duplicates you forgot about"), which is why the answer above is the one to stand
behind.
- [ ] Declare the **foreground service type**. This is the release-blocking item for the
Android 14+ review. **[code]** The manifest already matches what you will declare:
| Where | Value |
|---|---|
| `AndroidManifest.xml` | `<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />` |
| `AndroidManifest.xml` | `<service android:name=".service.ScanService" android:foregroundServiceType="dataSync" android:exported="false" />` |
| `ScanService.kt` | `ServiceCompat.startForeground(…, ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC)` |
| `ScanService.kt` | `onTimeout()` stops the scan at Android 15's 6-hour `dataSync` cap |
The declaration page asks for **four** things per type, not one. Go to
**App content › Foreground service permissions**:
1. **Description** of the app functionality using the type:
> The app finds duplicate photos on the device. The user starts a scan and may leave
> the app while it runs; the foreground service keeps that user-initiated scan alive
> and shows its progress. The scan reads the photo library and writes a small local
> index of file hashes. The scan service itself performs no network access; ads,
> consent and the optional Pro purchase are separate and never receive photo data.
2. **User impact if the task is deferred or interrupted.** A scan is not deferrable work —
the user is watching for a result — so there is no WorkManager/JobScheduler fallback:
> If the scan were deferred, tapping "Start scan" would appear to do nothing and the
> user would have to keep the app open for the work to begin at all. If it were
> interrupted, the user would lose the progress of a whole-library comparison and
> have to start again. Only reads are involved, so an interruption cannot lose or
> corrupt data; the service stops as soon as the scan finishes or is cancelled, and
> it is held only for the duration of the scan.
3. **Use case**: **Local processing › Other.** The Console puts three options under *Local
processing*, and the other two do not describe this app. *Media transcoding* means
converting media into a different format — the app writes no media file at all, it only
reads photos to hash and compare them. *Importing, exporting* means moving files in or
out of the app — the app's only write is its own private index of file hashes, which no
other app ever sees. Play's wording for *Other* is *"Use for specifically user-initiated
work and not for regular system or server-initiated tasks"*, which is exactly a scan the
user taps *Start scan* for. This is not a cosmetic choice: an inaccurate use case is a
misdeclaration, and the description and the video have to back up whichever option is
picked — "reads the photo library and writes a small local index of file hashes" only
fits *Other*.
4. **A link to a video** demonstrating the feature — *"The video should demonstrate the
steps the user needs to take in your app in order to trigger the feature."*
**Recorded on the test device** (Android 12 / MIUI, `2a2ae895`) on 2026-10-14 with:
```bash
INSTALL=0 WARMUP=0 ./tools/record-fgs-demo.sh 2a2ae895
```
The output is `store-assets/fgs-demo/foreground-service-demo.mp4` (**committed**, so it is
already published; the checkpoint PNG per milestone beside it stays git-ignored). It was
checked frame by frame afterwards rather than assumed: the intro at 0 s, the scan starting
(*"Comparing file signatures… 91/102"*, 8 s), the shade held open for ~6 s with the live
notification (*"Finding duplicate photos / Looking for visually similar photos… /
CANCEL"*, 13–18 s) while the scan kept running behind it, and the finished results
(*17 duplicate groups · 54 of 5,385 photos*) at the end.
**The link to paste** is the file's page in Gitea — what the repository's own *view* of
the file opens, and what plays it:
```
https://gitea.softwareapp-hb.de/fishfacegit/foto-duplicate-finder/src/branch/main/store-assets/fgs-demo/foreground-service-demo.mp4
```
⚠️ **Not the `/raw/` URL**, even though that is the file itself. Gitea answers raw
responses with `Content-Security-Policy: default-src 'none'; style-src 'unsafe-inline';
sandbox` — a deliberate guard against raw HTML and SVG — and that blocks the media load of a
document that navigates straight to a video: the tab stays blank with no error, which is
exactly how this behaved in a browser. The same URL is fine as a *subresource*: the page
above embeds `<video controls src="…/raw/branch/main/…mp4">`, which is why previewing the
file plays it and opening `/raw/` does not. Use `/raw/` for `curl` and downloads, never as
the link in the form.
Verified about the **page** URL: **200** anonymously, containing that `<video controls>`
element. Verified about the **raw** URL, from outside this network and unauthenticated:
**200**, `Content-Type: video/mp4`, `Content-Length: 1847900`, `Content-Disposition:
inline`, bytes sha256-identical to the recording, and `Range: bytes=0-99` → **206** with
exactly those 100 bytes although `Accept-Ranges` is not advertised (which matters because
`screenrecord` writes the `moov` atom at the very end of the file). Two things to know
before pasting: the URL is pinned to `main`, so a re-shoot has to **overwrite the file in
place** rather than be added alongside it; and replacing the video at all means resubmitting
the declaration.
If a link with no Gitea chrome around the player is preferred later, there are two ways and
neither is needed for the declaration: an unlisted YouTube upload of the same file, or a
rule on the Gitea host's Caddy proxy dropping the header for this one path
(`@fgsdemo path …/store-assets/fgs-demo/*.mp4` plus `header_down @fgsdemo
-Content-Security-Policy`) — **scoped to `store-assets/` only**, since that header is what
makes raw HTML and SVG safe to serve. Neither was tried from here.
Both flags exist because this take found two traps worth knowing before a re-shoot:
- **`WARMUP=0` keeps the *cold* scan on camera.** A warm scan of this library takes
**5.4 s**, which is less than the notification shade takes to open — so the first take
filmed an empty shade, convincingly. The cold first scan (~20 s) is what gives the
shade time to appear while the notification is still live, and reinstalling the app
restores that window.
- **`INSTALL=0` skips the install**, because MIUI does not let `adb` install anything:
the command **hangs** waiting for two prompts on the device — Google Play Protect
(*"App zum Sicherheitsscan senden?"*) and then MIUI's own *Installieren* — and
auto-cancels as `INSTALL_FAILED_USER_RESTRICTED` if they go unanswered. The simplest
route is to install once by hand and then record with `INSTALL=0`.
A hand recording is just as valid and needs no tooling: every Android 11+ phone has a
screen recorder in the quick settings, and the whole video is six steps — the intro, tap
*Start scan* (the trigger the declaration asks to see), press Home, pull the shade down
and leave the notification sitting there while the scan runs, tap the app back for the
results, stop. Under two minutes and uncut: a reviewer has to be able to follow the
trigger and see the service still working once the app has left the screen.
⚠️ **MIUI blocks synthetic input until the matching developer option is on.** Every
`adb shell input tap` on this phone fails with *"Injecting to another application
requires INJECT_EVENTS permission"* — which is why the project's earlier captures were all
taken by hand. With **USB debugging** enabled (and the security-settings toggle that comes
with it) the block lifts, `tools/record-fgs-demo.sh` drives the phone end to end and
nothing is needed from a human. Toggling it resets the USB connection, though: the device
comes back on a **new** `/dev/bus/usb` node, which has to be made readable before `adb`
sees it again.
⚠️ **It cannot be recorded on a KVM-less emulator**, and the failure is the platform's,
not the app's: every scan start there ends in
`am_crash … ForegroundServiceDidNotStartInTimeException` → *Force finishing activity*,
with no `am_kill` or low-memory record, because software emulation is too slow to get
from `startForegroundService()` to `startForeground()` inside Android's budget. QEMU's
virtual instruction counter dilates the guest clock and made it work exactly once
(`-qemu -icount shift=1,sleep=off`, guest clock measured 2.30× slow) but not
reproducibly, so that is a lead rather than a recipe; `SETTLE_SECONDS` / `WARM_SECONDS`
scale this script's waits if it is ever retried.
The declaration is **per type**: if a new foreground-service type is ever added to
the manifest, it has to be declared here too.
- [ ] Complete the **content rating** questionnaire (no objectionable content →
typically rated Everyone / 3+).
- [ ] **App access** → *All functionality is available without special access*: no login, no
account, nothing gated.
- [ ] **Ads** → **Yes, my app contains ads.** The free tier shows one AdMob banner;
Pro removes it. Play asks whether the app *contains* ads, not whether every user
sees them, so the answer is Yes.
- [ ] **Advertising ID** → **Yes, my app uses advertising ID.** The question adds "This
includes any SDKs that your app imports that use advertising ID"; the Google Mobile
Ads SDK merges `AD_ID` and the Privacy Sandbox permissions, and Play Billing merges
`BILLING`. Audited against the merged release manifest, not against intentions:
| Check | Command | Expected |
|---|---|---|
| ads + Billing dependencies, direct or transitive | `./gradlew -q :app:dependencies --configuration releaseRuntimeClasspath \| grep -iE 'play-services-ads\|billing\|user-messaging'` | `play-services-ads`, `billing`, `user-messaging-platform` |
| `AD_ID` and Privacy Sandbox permissions in the release APK | `aapt2 dump badging app/build/outputs/apk/release/app-release.apk \| grep -i permission` | the permission table above, including `AD_ID` and `ACCESS_ADSERVICES_*` |
| the same for the **`.aab`** Play scans | `unzip -p app/build/outputs/bundle/release/app-release.aab base/manifest/AndroidManifest.xml \| strings \| grep -E 'AD_ID\|BILLING'` | both present |
| Play Services classes in the shipped code | `unzip -p app/build/outputs/apk/release/app-release.apk classes.dex \| grep -a -c 'com/google/android/gms'` | greater than 0 (ads SDK) |
| network is possible | the permission audit above | `INTERNET` present |
This is the machine-checked version of what [PRIVACY.md](../PRIVACY.md) now says:
photos are processed on-device, while Google Mobile Ads collects/shared ad data for
advertising, analytics and fraud prevention. Re-run the audit after **any**
dependency change. The *Data safety* form's *Device or other IDs* answer is
**Yes** for the same reason.
- [ ] Select the target audience (not designed for children).
- [ ] Answer the remaining *App content* declarations **No** / not applicable: news app,
government app, financial features, health, COVID-19 contact tracing.
- [ ] Accept the *Developer Program Policies* and *US export laws* declarations.
## 6. Testing before production
- [ ] 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 6 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:
- [ ] Deny access — app must not crash and must explain what is needed.
- [ ] Android 14+ **partial access** ("Select photos") — banner appears and the
app scans the subset.
- [ ] Grant full access — scan works.
- [ ] Test deletion:
- [ ] Move to trash (Android 11+).
- [ ] Permanent delete (Android 11+).
- [ ] Refuse the system dialog — nothing is deleted, the app says so.
- [x] Test with a library of several thousand photos to sanity-check scan time. **[code]** done on
the test device: the 5,363-photo library scans in **20.2 s cold / 11.0 s warm**, and the
screenshot run over 5,385 photos finished in **11.1 s** (6 unreadable files skipped).
- [x] **Freemium build on the real phone** (Xiaomi M2101K7AG, Android 12 / API 31):
**5,373 photos, 19 groups, 47 photos involved, 40.1 MB reclaimable, 25.5 s**
(signatures 2.2 s · exact 42 ms · perceptual 22.1 s), pHash cut fitted to ≤ 10 bits,
6 unreadable. The AdMob **adaptive test banner loaded**, the free/Pro toggle removed
it, the Pro sheet rendered, and **Buy Pro** showed the expected
“purchases unavailable” message because `pro_no_ads` is not active in the Console yet.
No app-level fatal; the only logcat fatal was the separate `uiautomator` dump tool.
**Warm retest on the same phone:** the cached index brings the same **5,373-photo**
library down to **3.0 s** (signatures 675 ms · exact 4 ms · perceptual 939 ms),
still **19 groups / 47 photos / 40.1 MB**. Buy Pro still reports “purchases
unavailable” because this debug build was sideloaded and `pro_no_ads` is not active
on the internal track yet; that is the expected gate, not a crash.
- [ ] Verify no crashes in *Play Console > Quality > Android vitals* after rollout.
## 7. Release notes ("What's new") and rollout
⚠️ **Which block applies:** the freemium app is a **new `.free` listing**, so its first
release uses the “new freemium listing” block below. The 1.0.2 and initial-release
blocks are kept for the history of the old paid listing; the old initial block still
says “no ads”, which was true only of the paid build. The 1.1.0-update block has been
replaced because the plan is a new listing, not an in-place price change.
Release notes are **not stored in this repo** — they are typed into the Play Console
for each release.
Where:
- Production: **Test and release > Production**, then **Create new release**
- Testing: **Test and release > Testing > Internal / Closed / Open testing**
Rules (per Google's *Prepare and roll out a release* guide):
- Up to **500 Unicode characters per language**.
- Language tags go on their own line, wrapping the text — a block starts with a line
containing `<en-US>` and ends with a line containing `</en-US>`. Several
`<lang>` blocks can be entered together.
- Notes belong to a **release**, so every track has its own; "Copy from a previous
release" avoids retyping.
- Google explicitly forbids using release notes for **promotion or to solicit user
actions** — keep them factual about what changed.
- For app updates list only user-visible changes; the full developer history belongs
in [CHANGELOG.md](../CHANGELOG.md).
Ready-to-paste block for the **new freemium listing's first release** (313 chars):
<en-US>
Initial release.
• Find exact and near-duplicate photos
• Keep the best copy and remove the rest in one confirmed batch
• Move photos to the trash or delete them permanently
• Free with one small banner; a one-time Pro purchase removes it
• Photos are processed on your device and never uploaded
</en-US>
Optional German block for the same release (360 chars):
<de-DE>
Erste Veröffentlichung.
• Exakte und ähnliche doppelte Fotos finden
• Das beste Foto behalten und den Rest in einem bestätigten Schritt entfernen
• Fotos in den Papierkorb verschieben oder endgültig löschen
• Kostenlos mit einem kleinen Banner; ein einmaliger Pro-Kauf entfernt ihn
• Fotos werden auf dem Gerät verarbeitet und nie hochgeladen
</de-DE>
Ready-to-paste block for **1.0.2** (the `versionCode` 3 build, historical):
<en-US>
• Maintenance release with compatibility fixes
</en-US>
Ready-to-paste block for **1.0.1** (the scan-robustness patch):
<en-US>
• Fixed a scan that could appear to stop on very large photo libraries
• The app now recovers gracefully when the photo library is temporarily unresponsive
</en-US>
- [ ] Upload the `.aab`, paste the notes above, and roll out to **internal** →
**closed** → **production** (staged rollout recommended).
- [ ] Monitor Android vitals and reviews; respond to feedback.
## 8. Post-launch maintenance
- [ ] Play requires new apps/updates to target recent API levels (API 36 from
August 2026 **[code]**). Re-check this requirement each year and bump
`targetSdk`.
- [ ] Watch for newer AGP; when it supports it, update `compileSdk` to 37 and bump
the Compose BOM and Coil together (see the version note in the README).
- [ ] Optionally add crash reporting later — but note this would change the Data
safety answers, so weigh it against the “photos never leave the device” promise.
## 9. Monetisation — freemium ads + one-time Pro
**Current model: freemium.** The app is free to download. The free tier shows one
anchored adaptive AdMob banner; a one-time Play Billing product **`pro_no_ads`**
removes it. Pro removes ads and nothing else — every scan, selection and deletion
feature stays free. Existing paid installs are grandfathered through
`legacyPro.cutoffEpochMs`.
The Console work is in step 4 and the declarations are in step 5; the full setup and
data-disclosure details are in [MONETIZATION](MONETIZATION.md). Rationale and current
copy: [STORE_LISTING › App pricing](STORE_LISTING.md#app-pricing).
Standing rules:
- **One banner, no interstitials.** Do not add an interstitial, app-open, native or
rewarded format without a product decision and a UX/privacy review.
- **Consent before ads.** UMP must resolve before `MobileAds.initialize()`; a refused
or unresolved consent means no ad request. Pro users skip ad initialisation entirely.
- **Pro never gates a feature.** It removes the banner; a scan limit or a locked
deletion flow would change the product promise and the store copy.
- **Billing is one-time and acknowledged.** Play Billing 9.1.0, product `pro_no_ads`,
pending purchases enabled, acknowledgement retried. The entitlement is client-side
and cached; Play re-verifies on resume.
- **Grandfather paid customers.** Keep the install-time cutoff and document its
limitations; uninstall/reinstall can lose it.
- **Keep Data Safety and `PRIVACY.md` in step.** Google Mobile Ads collects/shares ad
data (ad ID, interactions, diagnostics, IP); photos remain on-device. The **Ads** and
**Advertising ID** answers are **Yes**.
- **Secrets stay out of the repo.** Real AdMob ids and the legacy cutoff live in
`local.properties` or CI Gradle properties; test ids may stay in the build defaults.
- **Re-shoot the store assets.** The committed screenshots and feature graphic predate
the banner and Pro sheet; the freemium listing needs new captures.
- **Refunds and support** follow Play policy; keep the contact address in
[PRIVACY.md](../PRIVACY.md) current.