Make the Android 13+ pass, and fix what it found

The phone runs Android 12, so the questions that matter most for a release were exactly the ones it could not answer. Installed an API 35 AVD (sdkmanager was already present and dl.google.com reachable) rather than waiting for a public test track to report back. It found two user-visible defects, neither of which any test could have caught.

On Android 13+ the app asked for no runtime permission at all, so the progress notification was dead. StorageAccessPolicy.missingPermissions returned an empty list from API 33 on the reasoning that "all files access" is a special permission and browsing therefore needs no runtime grant — true as far as browsing goes, but the early return also dropped POST_NOTIFICATIONS, and nothing else in the app requested it. startForeground still ran, so nothing crashed and all 203 tests passed, while dumpsys showed granted=false and importance=NONE. Settings could not fix that either, because Android will not let a user grant a permission the app has never asked for. The notification grant is now requested alongside the storage grant, which is the only moment Android accepts it.

The four READ_MEDIA_* declarations were in the same position, and the manifest comment claiming they back thumbnails and viewers on Android 13+ was wrong. Coil loads both from a real filesystem path — the code comments already say "all-files mode only" — and the one MediaStore use is a best-effort delete request that "all files access" already covers. They were never requested, so they were never granted, so nothing could have depended on them. Removed, which also settles the checklist rule that declaring an unused permission is itself a policy violation.

The selection bar drew its last three actions off the screen on a phone. With one archive selected it holds ten icon buttons, ~480 dp at the 48 dp minimum touch size against the 411 dp a phone has, and BottomAppBar is a plain Row that does not scroll. Compose laid the surplus out past the right edge: measured on a 1080 px screen the row ran Copy(167) to Compress(923-980, itself squeezed to 57 px) and stopped, so Extract here, Select all and Clear selection were unreachable, while the same selection in a 2400 px landscape window showed all ten. The logic was never wrong — ArchiveFormats.isExtractable had judged the .zip correctly — the app just looked like it could not extract. The action row now scrolls, verified by swiping it in portrait and seeing all ten appear.

Verified on the AVD rather than only built: the notification dialog now appears and importance goes NONE -> DEFAULT, a real 220 MB copy posts notification 1001 on channel file-operations with ONGOING_EVENT|FOREGROUND_SERVICE and tears it down plus stops the service when done, edge-to-edge is correct under API 35s enforcement, predictive back returns from a folder and keeps the activity resumed, and Compress to ZIP produced an archive the host unzip read back with the right relative paths and contents. 204 JVM tests, lint clean, release artefacts re-measured.
This commit is contained in:
2026-10-15 11:39:48 +02:00
parent 5786b618b7
commit bb1187881b
8 changed files with 220 additions and 66 deletions
+18 -11
View File
@@ -42,16 +42,20 @@ rest are things you must do in the Play Console or with your own accounts.
- [x] **[code] re-verified 2026-10-15.** `bundleRelease` and `assembleRelease` both succeed
with R8 minification and resource shrinking on.
- `app-release.aab` is **4 836 490 bytes**
(`sha256 0c0702d3917e9b94f42dabfce8002cae6b9377ee4b25d054bf97f73b4c3a8652`).
- `app-release.apk` is **2 155 563 bytes**, signed by the upload key above.
- `app-release.aab` is **4 837 465 bytes**
(`sha256 9c2b3a007784297511f29b107a3be40e648709d7702315c53b93ef18f5979070`).
- `app-release.apk` is **2 155 455 bytes**, signed by the upload key above.
- Both report `versionCode=1 versionName=1.0.0 targetSdk=36` and exactly the
permission set in step 4 — **no `INTERNET`**, so "nothing leaves the device" holds
in the shipped artefact and not just in the source manifest.
- The figures moved from the first measurement (4 682 814 / 2 081 955) because of the
LZMA library behind `.xz` and 7z. The permission set did **not** change: the share
target, the file picker and the trash index all arrived without a single new
permission, which is the point of having designed them that way.
- The figures barely moved again, but the permission set did: the four `READ_MEDIA_*`
declarations are gone, removed once the Android 15 pass showed the app never
requested them and never read through `MediaStore` (see below). Four manifest lines
are worth only a few hundred bytes, hence 4 837 465 rather than a visible drop; the
first measurement was 4 682 814 / 2 081 955, before the LZMA library behind `.xz`
and 7z. The permission set has only ever shrunk: the share target, the file picker,
the trash index and the archive work all arrived without a single new permission,
which is the point of having designed them that way.
- ⚠️ **Re-measure after any further change.** These numbers are a record of a verified
artefact, not a constant — a stale hash here is worse than no hash, because it looks
checked.
@@ -99,10 +103,6 @@ Expected, and nothing else:
```
MANAGE_EXTERNAL_STORAGE
READ_EXTERNAL_STORAGE (maxSdkVersion=32)
READ_MEDIA_IMAGES
READ_MEDIA_VIDEO
READ_MEDIA_AUDIO
READ_MEDIA_VISUAL_USER_SELECTED
WRITE_EXTERNAL_STORAGE (maxSdkVersion=29)
FOREGROUND_SERVICE
FOREGROUND_SERVICE_DATA_SYNC
@@ -110,6 +110,13 @@ POST_NOTIFICATIONS
<applicationId>.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION (added by AndroidX)
```
No `READ_MEDIA_*` appears, and that is deliberate. Browsing and every read go through the
filesystem (Coil loads thumbnails and the viewers from a real path); the only `MediaStore`
use is the best-effort delete request, which "All files access" already covers. The app
never requested the media permissions either, so declaring them would mean declaring
permissions that are never used — which is exactly what section 4's "keep the permission
set honest" rule forbids.
## 5. Data safety, content rating, audience
- [ ] **Data safety** form: the app collects **nothing** and shares **nothing**. Answer "No"