Capture Vault — End-to-End Specification
Product: Capture Vault (com.leverine.capturevault) — a Leverine product Document status: Living specification, v1.0 — 2026-12-03 Code basis: v0.3.0+3 (Chunks 1–3 built and pushed to Leverine/Capture-Vault) Grounding documents: product plan 2026-12-02 (§9 decisions settled), roadmap 2026-12-03 (incl. the no-accounts amendment), Quest platform homework 2026-12-03, Quest filesystem survey 2026-12-03, company analytics plan 2026-12-03, and the build journals in this docs/ folder (journal-chunk1.md, journal-chunk1-fix.md, journal-chunk2.md, journal-chunk3.md).
How to read this document. “MUST / MUST NOT” are requirements. “SHOULD” is a strong default that needs a recorded reason to deviate. Statements about on-device behaviour are labelled [proven] (observed on Kev’s Quest 2), [documented] (Meta/Android documentation or the platform homework), or [unproven] (believed, designed-for, but not yet observed on hardware). Nothing in this spec may be quoted in store copy in a stronger form than its label here.
1. Product definition
1.1 What it is
Capture Vault is a paid 2D panel app for the Meta Horizon Store that gets screenshots and screen recordings off a Quest headset — organised by game, transferred to a destination the user chooses — with every copy hash-verified before the app will offer to delete the original.1.2 The promise (normative wording)
Open Capture Vault and everything new since your last visit offloads automatically — every copy verified — to your phone, PC, or NAS. No account, no cloud, no Developer Mode.Every clause of that sentence is a requirement:
- “Open … offloads” — the trigger is opening (or resuming) the app. On-open is the automation model; see §1.4 for what is not promised.
- “everything new since your last visit” — newness is defined by the persisted scan watermark (§3.5). The app MUST badge and offload exactly the captures newer than the watermark, and MUST say plainly on first run that everything present is new (there is no “last visit” yet).
- “every copy verified” — a copy counts as done only when its SHA-256 equals the original’s SHA-256 (§3.4). Size alone is never verification.
- “No account, no cloud, no Developer Mode” — the app MUST NOT require, offer, or upsell an account; MUST NOT route captures through any Leverine server (there is none in the design); MUST install and run as a normal Store app on a stock headset.
1.3 Target users and devices
- Users: Quest owners who screenshot or record and then fight Meta’s built-in sync to get the files anywhere useful. Meta’s own help documents sync failing when the headset sleeps, disconnects, or opens another app, and videos over a minute are never auto-synced.
-
Devices (v1, one product): Quest 2, Quest 3, Quest 3S, Quest Pro. Capture storage is identical on all four [documented]:
- Quest 2 / Pro are a closing window: Horizon OS v2.13 is their final feature release and new-app submissions for them close December 2027. The v1 build MUST remain v2.13-compatible for those models (§5.2); later Quest 3-only features MUST be device-targeted so the frozen branch keeps working.
- Per-model capture defaults (resolution/fps/bitrate) could not be verified from a primary Meta source. The app MUST read actual file metadata (dimensions, duration, size) and MUST NOT hard-code expectations per model.
- Pairing for the browser receiver (§5.1) differs by model: QR code on Quest 3/3S; 6-digit code / typed address on Quest 2/Pro, which have no colour passthrough cameras to scan with.
1.4 What v1 is NOT (never promised — in the listing, in the app, anywhere)
- No background offload while playing a game, while the headset is asleep or off, or instant on-capture sync. Horizon OS suspends 2D panel apps; even Meta’s own sync cannot do these. [documented]
- No guaranteed overnight or set-time scheduled sync. A WorkManager periodic check MAY run when Horizon OS chooses; if present it MUST be labelled best-effort in the UI and MUST NOT be sold as scheduled sync.
- No Google Drive in v1 (fast-follow, §5.3). No iPhone camera-roll auto-save (iOS delivers a ZIP to Files — a platform limit).
- No recovery of captures Meta’s sync lost, of files already deleted, and no “fixing” Meta sync.
- No Quest 2/Pro parity with post-v2.13 Horizon OS features.
1.5 Commercial terms (settled, §9 of the plan)
- Price: $7.99 one-time (Kev, 2026-12-02). Meta handles tax/VAT and takes its standard platform fee. No subscription. No IAP paywall for destinations in v1. Lifetime updates at that price.
- Ships under Leverine: repo, signing key, website product page, and
support@leverine.comas the contact. - Name: “Capture Vault” (Kev, 2026-12-02) — clearance screen verdict RISKY but usable (
chunk0/name-clearance.mdin the project records): no Horizon Store collision and no blocking registration found, but a live identical-name iOS screenshot app exists in the same Nice Class 9. Mitigations are mandatory: distinctive icon and listing subtitle, and no branding spend until the manual CIPO/NUANS check is done (§9, D-1). Screened-CLEAR fallback: CaptureCrate. The working name lives in exactly two places in code (kAppNameinlib/branding.dartand the manifestandroid:label) so a rename stays a two-line change.
2. Current state — Chunks 1–3 as built
Everything in this section is built, unit-tested, and pushed. Device verification status is stated per item; §8.4 lists everything still owed on hardware. Current build: 0.3.0+3, 97/97 tests passing,flutter analyze clean, zero third-party packages (Dart and Kotlin sides alike).
2.1 Chunk 1 — panel shell (commit 608a3d9)
- Flutter 2D panel app: Home / Destinations / Gallery / Settings over a tested state layer; dark Material 3; layout is a function of panel width (side
NavigationRail≥ 640 dp, bottomNavigationBarbelow) because Horizon OS panels resize freely. applicationId/ namespacecom.leverine.capturevault; minSdk 29 / targetSdk 34; arm64-v8a only; release signed with the Leverine keystore (signer SHA-2565bc0623a…cd9210, verified against the keystore, not the certificate DN — the keystore carries a debug-looking DN by accident of generation; the fingerprint is the identity).- Zero declared permissions. Permissions arrive with the features that justify them (VRC Security.2, minimum permissions).
- The verified-delete setting exists in the state layer from day one, default OFF, with a unit test pinning the default — the rule cannot drift.
- Sideload verdict on Kev’s Quest 2 (Horizon OS v210, Android 14, 106 GB free): positive [proven] — after the fix in §2.2.
2.2 Chunk 1 fix — the launch crash (commit 324b37c)
The first on-device launch crashed instantly: ClassNotFoundException: com.leverine.capturevault.MainActivity. Root cause: MainActivity.kt sat in package com.leverine.capture_vault (underscore — the Dart package name) while namespace/applicationId are com.leverine.capturevault; this template’s release build does run R8, which stripped the real class as unreferenced. The shipped dex contained no MainActivity in any package — the crash was guaranteed on every device, and Chunk 1’s verification (build success, size, signing, install) could not see it, because install success does not imply a launchable activity.
Fix: file moved to kotlin/com/leverine/capturevault/MainActivity.kt, package aligned across file path, package, namespace, applicationId, and manifest. This defect is the origin of the standing verification rule in §8.1: no build is “done” without a dex check for the MainActivity class, an on-device launch, and an exit-info check.
2.3 Chunk 2 — capture scan + organise-by-game gallery (commit 9581976, gitignore fix 642d101)
- Scan via MediaStore, the sanctioned route under scoped storage: a Kotlin
MethodChannelqueries the Images collection filtered toOculus/Screenshotsand the Video collection filtered toOculus/VideoShots(RELATIVE_PATH LIKE), newest first. Raw-path reads of those folders are closed at targetSdk 34 and MUST NOT be built on. - Exactly two permissions — the app’s first:
READ_MEDIA_IMAGES+READ_MEDIA_VIDEO, requested at runtime from the Gallery behind a rationale state, never at startup (startup only checks). Android 14 selected-photos grants (READ_MEDIA_VISUAL_USER_SELECTED) count as image access; MediaStore then returns only the selected subset — a partial grant MUST produce a partial-but-honest gallery, not an empty one or a crash. - Organise-by-game: filenames parse in pure Dart (
<package>-<YYYYMMDD>-<HHMMSS>[-n]; packages never contain hyphens, so the first hyphen is a reliable separator). Package → installed-app label resolves through PackageManager, falling back to the raw package name, and to an Unknown bucket for names that don’t follow the convention. Groups sort by newest capture; group headers show count + total size; image tiles show thumbnails, video tiles a frame + duration/size badges. The filename timestamp, when it parses, is the timestamp of record; MediaStore’s is the fallback. Metadata is always read from the file. - New-since-last-visit watermark (§3.5), persisted via the channel into Kotlin SharedPreferences. First run: everything is new and the UI says so (“First visit — every capture here is new”). An empty scan never rewinds the watermark.
- Deferred by decision, on record: duplicate detection is a transfer-time skip (§2.8 of the plan), so it landed with the offload engine in Chunk 3, not here. App icons in group headers deferred (labels resolve; icon bitmap plumbing is marginal gain — revisit if the gallery feels anonymous on-device).
- Postscript defect: the machine’s global gitignore contains
*.xml, which had silently kept every XML file — includingAndroidManifest.xml— out of version control since Chunk 1. A fresh clone could not have reproduced the app. Fixed repo-locally with a!*.xmlnegation (commit642d101); the global file itself is the machine owner’s call and was NOT edited.
2.4 Chunk 3a — offload engine (commit 844c0ac)
- Decision engine in pure Dart (
decideTransfer, §3.3): weighs source size + SHA-256 against the destination’s final file and partial, and returns skip-as-duplicate / copy fresh / resume at the partial’s real length / verify a full-length partial without copying. An unknown hash never counts as verified. - Byte-moving in Kotlin behind the channel: copies stream into
<name>.part(256 KiB buffers, streaming SHA-256 — multi-GB files never sit in memory) and are renamed to the final name only after the partial’s hash matches the original. A file under its final name at a destination is verified by construction. Resume appends only after the platform re-checks the partial’s real length against the requested offset; a mismatch fails the attempt and leaves the partial for re-decision. - Destinations with real storage: (a) a SAF granted folder (tree picker
- persisted grant, re-validated at cold start,
grantLostrepair state — §3.6), and (b) the app’s own external folder (always available). The Chunk 1 Phone/Computer/NAS destination kinds remain named intentions; the engine refuses them with a logged “no folder yet” failure rather than pretending to copy. Their transports are §5 work.
- persisted grant, re-validated at cold start,
- Duplicate detection at transfer time: same name + size + hash at the destination → skip, logged as a
duplicaterow. - Persistent 30-day transfer log (§3.7) with a History tab (fifth shell section). Verified, duplicate, and failed rows are all kept — failures stay visible on purpose; from Chunk 3b the log is also the delete gate’s only evidence.
- Home offload action with progress (file x of y, current file) moving only captures the scan badged new. NOTE: this is the on-open promise on demand — the automatic launch trigger and the dataSync foreground service are not yet built (§5.1).
2.5 Chunk 3b — verified delete (commit daa512a)
- The gate is a pure function (
assessDelete, §3.8): an original is deletable only when ALL hold — the Settings switch is on (default OFF); a live log row proves a hash-verified copy for that exact source URI; and the original’s freshly-read current hash still equals the verified hash. Refusals are named and counted, never hidden:settingOff,noVerifiedCopy,sourceChanged. - Per-batch headset confirmation (count, bytes to be freed, free space before/after) plus the system consent prompt. Two routes, consent preferred: MediaStore
createDeleteRequest(one prompt per batch, all-or-nothing) and a per-file SAF route through a granted Oculus-folder tree (built and tested in the state layer; the Gallery wires the consent route today). Only platform-confirmed deletions leave the gallery — partial results reconcile per file. - Adversarial pass: green, nothing stubbed. All abuse cases are refused in tests: no verified copy; failed-hash rows; a verified row whose own hashes disagree; switch off; changed original; pruned proof row (a seeded 31-day-old row is pruned at bootstrap and refused); partial batch consent; cross-file proof; a later failed attempt does not erase earlier proof. This pass is a permanent gate, not a one-time event (§8.2).
2.6 Chunk 3 build defect — owned
The first clean build of Chunk 3 failed: the Kotlin splice scripts that grewMainActivity.kt mismatched closing braces and closed the class early. The 3a commit therefore contained Kotlin that could not have compiled — its Dart side was fully test-green, its design unchanged, and nothing from it ever reached a device. Fixed in the 3b commit and journalled in full (docs/journal-chunk3.md §5). Standing lesson, now a rule (§8.1): a checkpoint isn’t landed until its build is green — a green test suite on one side of the channel proves nothing about the other.
2.7 What is NOT built yet (honest list)
- Browser receiver (plan must-ship #4) — §5.1.
- Automatic on-open trigger + dataSync foreground service (plan must-ship #5’s glue) — §5.1.
- Phone/Computer/NAS transports (SMB etc.) — §5.3 fast-follows.
- Copy-protection layers (entitlement, signature integrity) — §6, lands with Chunk 4.
- All on-device verification of Chunks 2–3 — §8.4. The staged 0.3.0 APK (17,374,603 B, SHA-256
79ee1dad…, libapp.so present arm64-only, dex MainActivity present, Leverine-signed, exactly the two media permissions) has never been installed: the headset was flat/charging at build time.
3. Architecture
3.1 State-layer-first (standing rule)
All product logic lives in a pure-Dart state layer (lib/state/); widgets only render state and forward intent. Platform access sits behind the CapturePlatform interface (lib/state/capture_platform.dart); AppState consumes the interface and tests substitute fakes. New platform capability MUST arrive as a new implementation or a defaulted interface member, never as a refactor of the state layer. The Chunk 3 SAF path arrived exactly this way under the Chunk 2 interface.
Current state-layer modules:
3.2 Platform channel surface
OneMethodChannel (com.leverine.capturevault/captures) implemented in MainActivity.kt (Kotlin, framework APIs only — no AndroidX additions). MediaStore/thumbnail/copy work runs on a background executor; results are posted to the main thread. Every Dart-side channel call MUST degrade, not throw: a failed scan keeps the previous results on screen; a platform failure becomes a logged outcome, never a blank gallery or a crash.
Channel methods (grouped; see Appendix A for the full list):
- Permissions/scan:
checkPermissions,requestPermissions,scanCaptures,resolveLabels,loadThumbnail - Watermark/persistence:
loadWatermark,saveWatermark,loadPersisted,savePersisted - Folders:
pickFolderTree,listGrantedFolders,appFolderPath - Transfer:
statFile,hashUri,hashFile,copyFile,finalizeFile,discardPartial - Delete/space:
requestDelete,deleteViaSaf,freeSpaceBytes
3.3 Decision-engine purity (normative)
decideTransfer and assessDelete are pure functions: gathered facts in, decision out, no I/O, no platform calls, no clock reads inside. The state layer gathers facts (sizes, hashes, log rows, switch state) and the platform layer executes decisions. This purity is what makes the adversarial delete pass (§8.2) possible as unit tests, and it MUST be preserved: any new transfer or delete behaviour lands as a pure decision plus a thin execution path, with tests on the decision first.
decideTransfer rules that MUST hold:
- A duplicate requires size and hash equality. Size alone never skips.
- An over-long partial is corrupt → restart fresh. A zero-length partial is no partial.
- A full-length partial is verified by hashing, not assumed.
hashMatchesis case-insensitive and treats null/empty as never-matching: an unknown hash is not a verified hash.
3.4 The verified-copy invariant
- Bytes stream to
<name>.partat the destination. - The partial is hashed (streaming SHA-256).
- Only on hash equality with the original is the partial renamed to its final name.
3.5 Newness: the scan watermark
- The state layer persists a watermark = the newest capture timestamp seen (epoch millis), via the channel into Kotlin SharedPreferences.
- On scan, captures newer than the watermark are “new” (badged per item and per group; Home shows “N new captures since your last visit”).
- First run (no watermark): everything is new, stated plainly.
- An empty scan MUST NOT rewind the watermark. The watermark advances only to a timestamp actually observed.
- The filename timestamp, when it parses, is the timestamp of record (the naming convention is the product’s foundation); MediaStore’s DATE_TAKEN/DATE_ADDED is the fallback for unconventional names.
3.6 Storage model
Two destination kinds have real storage today; the model MUST generalise to the §5.3 transports without changing the decision engine (transports differ in how facts are gathered and bytes moved, not in what “verified” means).- App folder — the app’s own external files directory. Always available, listed first, not removable. This is the always-works home base [documented].
- SAF granted folder — a user-granted tree (
ACTION_OPEN_DOCUMENT_TREE+takePersistableUriPermission). Persisted grants survive reboot and update [documented]; they die on uninstall, user revocation, target deletion/move, or the per-app grant cap. Therefore:- Grants MUST be re-validated at every cold start against the OS grant list (the platform’s
listGrantedFoldersis the source of truth, not the app’s own record). - A destination whose grant is gone MUST surface as
grantLostwith a repair action — it MUST NOT silently vanish and MUST NOT fail copies mysteriously at transfer time (the engine refuses a lost grant before any copy). - The picker reporting
unavailable(no resolver /ActivityNotFoundException) is a first-class UI outcome, not an error path (§4).
- Grants MUST be re-validated at every cold start against the OS grant list (the platform’s
- Destinations persist across launches (a SharedPreferences string slot, reconciled against live platform facts at bootstrap — same pattern as the grant book). Phone/Computer/NAS kinds persist as intentions and fail honestly (“no folder yet”) until their transports land.
3.7 Transfer log — schema and retention
The log is the user’s proof of offload and the delete gate’s only evidence. It persists across launches (JSON via the channel persistence slot; tolerant decode — a malformed row is dropped, never crashes the load). Row schema (TransferLogEntry, lib/state/offload.dart):
Rules:
- Every attempt appends a row — verified, duplicate, and failed alike.
- Retention: 30 days. Rows prune at bootstrap; the boundary is inclusive (exactly-30-days is kept). Pruning is load-bearing: a pruned proof row is no proof (§3.8), which is deliberate — delete eligibility expires with the evidence.
- A row counts as verified-copy proof only when
verdict == verified && hashMatches(destHash, sourceHash). (duplicaterows also carry matching hashes and are admitted by the gate as proof, since a duplicate is a verified copy already present.)
3.8 The delete gate (assessDelete)
An original is deletable only when ALL of the following hold, evaluated in this order:
- Switch on.
verifiedDeleteEnabledis ON (default OFF; the user turns it on in Settings). Checked before any evidence is read —settingOff. - Live proof. The un-pruned log holds a row for that exact source URI whose
isVerifiedCopyis true — elsenoVerifiedCopy. Failed rows are not proof; a verified row whose own hashes disagree is not proof; a verified row with no destination hash is not proof; a row for a different file is not proof; failure rows never subtract earlier proof. - Original unchanged. The original’s hash, read fresh at plan time, still equals the verified hash — else
sourceChanged. An unreadable original (empty hash) refuses the same way.
- The plan is presented for per-batch confirmation in the headset: count, bytes to be freed, free space before/after (StatFs).
- Consent route preferred: MediaStore
createDeleteRequest— one system prompt per batch, all-or-nothing. (createDeleteRequestis API 30+; minSdk is 29 — the Kotlin route checks the SDK level and degrades to “nothing deleted” on API 29 rather than crashing. All supported headsets run API 34 in practice.) - SAF route: per-file deletes inside a granted Oculus-folder tree (root level or one subfolder down, where Screenshots/VideoShots live).
- Only platform-confirmed deletions leave the gallery (
reconcileDeleteResults). A refused prompt deletes nothing; a partial SAF run removes exactly the confirmed subset. - Deletion is never automatic and never offered for anything the gate refuses. Free-space reporting (before/after) MUST accompany every batch result.
3.9 Dependencies and build shape
- Zero third-party packages (Dart and Kotlin). Framework/SDK APIs only. This keeps the cold-launch budget (< 10 s on Quest 2 — a plan requirement; the on-device stopwatch number is still [unproven]) easy and the review surface small. Any future dependency needs a recorded reason.
- Single-ABI (arm64-v8a) release builds via
flutter build apk --release --target-platform android-arm64— the GradleabiFiltersline does NOT constrain Flutter’s own libraries (Chunk 1 journal, failure #2); the build-command flag is what enforces it. - This template’s release build runs R8 despite a stale “no minify” comment in the Gradle file — assume shrinking is ON and verify the dex (§8.1) rather than trusting comments.
4. Platform constraints — mandated behaviour
Distilled from the platform homework (2026-12-03) and the filesystem survey of Kev’s Quest 2 (Horizon OS v210, Android 14 base, ~6 GB RAM, 128 GB model with 106 GB free at survey). Each constraint has a mandated behaviour; the spec’s behaviour is the requirement, whatever a future Horizon build does.5. The remaining build path, end to end
Chunks are executed in order; each lands under the release discipline of §8 before the next starts. Numbering continues the roadmap’s: Chunks 1–3 are built (§2); what follows is 4 (split into 4.0/4.1 for honesty about what remains of v1’s core) and then the fast-follow sequence in roadmap order.5.1 Chunk 4.0 — v1 core completion (receiver + auto-offload glue)
Two plan must-ship items are not yet built. v1 is not complete — and Chunk 4.1’s “ready to submit” cannot be claimed — until both land or are explicitly re-scoped by Kev (§9, D-5). (a) Browser receiver (plan §2 #4)- Scope: a local HTTP server on the headset; a phone or PC browser downloads originals — ZIP or individual, bit-identical. Pairing: QR code on Quest 3/3S; 6-digit code / typed address on Quest 2/Pro. Remembered browsers. If plain HTTP is used, it MUST be flagged in-app (the CaptureHop precedent).
- This is also what makes the Phone/Computer destination kinds real for browser-equipped devices.
- Acceptance: a phone and a PC each download captures over home Wi-Fi; every downloaded file hash-identical to the original; Quest 2 pairs without a camera scan; an unpaired browser is refused.
- Scope: on launch/resume, auto-scan and auto-offload everything new to the default destination (today’s Home action, triggered automatically); dataSync FGS started from the foreground per P-11 with progress in the panel; transfers resume after any death (P-9/P-12) via the §3.4 checkpoint design. A WorkManager periodic check MAY be added, labelled best-effort (never “scheduled sync”, §1.4).
- Acceptance: a multi-GB transfer interrupted mid-flight (Wi-Fi drop, app closed, headset slept) resumes and finishes byte-exact — the File Handler F1 fixture discipline (300 MiB and 1 GiB byte-exact, twice) applied here; the panel shows progress throughout; killing the panel mid-transfer loses nothing already finalised.
5.2 Chunk 4 — store readiness (ends at “ready to submit”)
Goal: a submittable Horizon Store package with Quest 2/3/3S/Pro targeting, submitted during 2027 — well before the December 2027 Q2/Pro cutoff. Scope:- VRC self-check pass, Privacy.1 first. Privacy.1 is the most commonly failed VRC. The privacy policy is already live at https://leverine.com/capture-vault/privacy/ ; it MUST be entered in the console listing in this chunk (draft-only console edit — allowed). The policy states what is collected (nothing), how it’s used, and how deletion is requested. Data Use Checkup surface stays minimal: no Platform SDK features beyond what distribution requires.
- Permission justification package: video of the core flow + text justification for
READ_MEDIA_IMAGES/READ_MEDIA_VIDEO(review-required; Meta’s own note — “access images/videos created by other apps” — is literally this app’s function). Request nothing the feature set doesn’t use (VRC Security.2). The SAF architecture (§3.6) is the standing insurance: if review denies the media permissions, the app ships on SAF grants alone with a degraded-but-working first run. - Copy protection lands in this chunk (§6) — all three layers, with their verification, before any store candidate is cut.
- Pricing: set $7.99 on the draft listing once Meta Payment Information is saved (§9, D-2). The Developer Distribution Agreement signature is Kev-only (§9, D-3).
- Listing assets: store covers/screenshots at Meta’s required sizes; listing copy in the honest language of §1 — the promise of §1.2 and the exclusions of §1.4, verbatim in spirit. No background-sync claims anywhere, including screenshots and captions.
- IARC rating questionnaire completed.
- Store-build hygiene (hard rules):
- The store build’s merged manifest MUST be audited by dump, not memory: no
QUERY_ALL_PACKAGES(P-8), no other prohibited permissions (REQUEST_INSTALL_PACKAGES,INSTALL_PACKAGES,MANAGE_DOCUMENTS,PACKAGE_USAGE_STATS,START_FOREGROUND_SERVICES_FROM_BACKGROUND), no legacy storage permissions (P-2). - Frozen v2.13-compatible branch for Quest 2/Pro; later Quest 3-only features device-targeted off it.
- Release discipline per §8.3.
- The store build’s merged manifest MUST be audited by dump, not memory: no
5.3 Fast-follows (post-launch, roadmap order)
Each ships as its own chunk under the same release discipline; the Quest 2/Pro frozen branch is kept compatible or a feature is device-targeted out explicitly. Transports plug into §3.6’s model: the decision engine and the verified-copy invariant do not change.6. Copy protection and integrity posture
Honest framing (from the roadmap, normative here): client-side checks raise friction; they do not make copying impossible. Anyone determined can patch an APK. The layers below exist to make the casual copy — the re-signed APK passed to a friend, the scrape-and-reupload — fail plainly, while never punishing a paying user. Capture Vault is the paid app ($7.99), so of the Quest products this is where entitlement matters most. Layer 1 — Meta entitlement verification at launch (the layer with real teeth). Verify the signed-in account owns Capture Vault, leaning on Meta’s account system rather than anything we invent. The verdict MUST be cached with a grace window: a paying user launching offline (or with Meta’s servers unreachable) is never locked out; entitlement re-checks in the background and only a persistent, confirmed non-ownership state degrades the app. Feasibility note (honest): the Meta Platform SDK route for a Flutter panel app is an open question — the File Handler integrity work left it as a stub interface for the same reason. Chunk 4 MUST resolve it (SDK bridge, or a documented alternative) before claiming this layer. Layer 2 — Signature integrity check at load. The app verifies its own signing-certificate SHA-256 against the Leverine release fingerprint (5bc0623a…cd9210) and fails closed with an honest message on mismatch — the standard pirate repack is a re-signed copy, and this is what stops it. Debug-signed builds are exempt (development must not fight the gate); the phone/Quest pattern is the one already proven in File Handler Quest’s integrity chunk (gate before any service starts; no file operations on a failed build).
Layer 3 — Activation codes, non-store flavours only. Sideload/personal builds (Kev’s own copies, tester builds) use the File Handler personal-build pattern: the build carries only the code’s SHA-256, first launch prompts, and the correct code binds to the device’s ANDROID_ID. Store builds rely on Layers 1–2; the activation path is compiled into non-store flavours only.
Settled NOT-to-do list (not up for re-litigation per chunk):
- No user accounts. Deliberate decision (Kev, 2026-12-03): company-wide accounts (the Rookie-style model — sign up, receipts and entitlements in one Leverine account) were considered and rejected. An account system is a forever commitment — auth, resets, support, custody of customer purchase data — that a solo company should not take on to protect a $7.99 utility. Revisit only as a feature of the paid Leverine Licensing service, where paying developer customers justify the upkeep. Capture Vault’s “no account” promise stands as written.
- No LVN- licence keys in the app. The Leverine licensing system stays out of mobile/Quest apps; Meta handles payment on this channel.
- No phone-home requirement for basic function. The app works fully offline on a local network — that is the privacy pitch, and copy protection doesn’t get to break it.
- No punishing offline use. Grace windows on every check; a check that can’t reach its authority degrades to “ask later,” not “lock out.”
7. Privacy and analytics posture
7.1 Privacy (architecture, not policy-washing)
- Collect nothing. No analytics server, no account, no telemetry. Captures never touch a Leverine server — there is no Leverine server in the design. Transfers stay on the local network or go direct to the user’s chosen destination.
- Use no Platform SDK features beyond what distribution requires → smallest possible Data Use Checkup surface (annual recertification still applies).
- Privacy policy is a launch blocker, treated early: live at https://leverine.com/capture-vault/privacy/ (HTTPS, publicly accessible without login, app-specific), stating what is collected (nothing), how it’s used, and how users request deletion. Entity wording on the page is “Leverine, Kemptville, Ontario, Canada” — to be aligned once Ontario business registration is confirmed (§9, D-7). Privacy.1 is the most commonly failed VRC; §5.2 puts it first.
- Listing copy states the architecture plainly: “Your captures never leave your local network or your chosen destination.” (Revisited honestly if FF-5 cloud destinations ship — §5.3.)
7.2 Analytics (per the company analytics plan, 2026-12-03)
- The app itself collects nothing — no telemetry, no usage reporting, no analytics SDK — and no chunk in this spec may add any. Adding in-app telemetry would be a product decision requiring Kev’s explicit approval and a privacy-policy rewrite, not an engineering default.
- Capture Vault’s numbers come entirely from the Meta Horizon developer dashboard: units sold, net revenue, refund rate (the quality signal for a utility — a spike after an update is a regression alarm), rating average and review count. Sideload-channel numbers come from GitHub release download counts, labelled by channel.
- These feed the weekly digest defined in the company plan (units, net revenue, best sellers, trend vs prior week), which stands up only when the first paid product goes live. A failed source renders as a named gap, never a silent zero. Nothing customer-facing depends on the digest.
- PIPEDA posture: aggregate business metrics only; customer-level records stay at the platforms (Meta holds the purchase records; Leverine holds none and wants none).
8. Testing and release discipline
8.1 Standing verification rules (every build, no exceptions)
- Clean build (
flutter cleanfirst) with--target-platform android-arm64; verifylibapp.sois present and arm64-v8a is the only ABI. - Dex check: the APK’s
classes.dexMUST containLcom/leverine/capturevault/MainActivity;(origin: §2.2). - Signer check: APK signer SHA-256 MUST equal the Leverine release fingerprint
5bc0623a…cd9210, verified against the keystore. - Manifest check: declared permissions dumped from the built APK (aapt), never asserted from memory (origin: §5.2 hygiene; Chunk 3’s build confirmed exactly the two media permissions).
- On-device launch + exit-info: install on the real headset, launch the resolved component, confirm the process survives and the activity resumes;
dumpsys activity exit-infoMUST show no new crash. - A checkpoint isn’t landed until its build is green (origin: §2.6) — green tests on one side of the channel prove nothing about the other.
8.2 The adversarial delete gate (permanent)
The §2.5 abuse matrix is a standing requirement, not a Chunk 3 event: any change touchingassessDelete, the log, or the delete routes MUST re-run the full matrix (no proof / failed hash / disagreeing hashes / switch off / changed original / pruned proof / partial consent / cross-file proof / failure-after-success) and keep every case refused. The delete flow does not ship in any daily-driver build on unit tests alone — the on-device pass (§8.4) is part of the gate. Data loss here breaks VRC Functional.4 and the product’s entire “your files are safe” pitch; this gate is not negotiable.
8.3 Release discipline (per release)
CHANGELOG entry, GitHub push, annotated tagv<version>, README badges current, CI green, plus all of §8.1. Version lives in pubspec.yaml (version:), mirrored in AppState.appVersion and the Settings About row — the version-pin tests enforce the mirror.
8.4 Device-test checklist — currently owed (Chunks 2–3)
To run on Kev’s Quest 2 (Horizon OS v210) in the next device session, in this order. Until these pass, Chunks 2–3 are “built,” not “verified.”- Install the staged 0.3.0 APK; launch; exit-info clean (§8.1.5).
- Grant media permissions from the Gallery; confirm the scan finds the headset’s real captures — the expected first catch is the two
com.oculus.vrshellscreenshots the filesystem survey found inOculus/Screenshots— grouped under the right labels, Unknown bucket behaving. - Take a new capture between two app opens; confirm only it is badged new on the second open (watermark behaviour, §3.5).
- SAF picker existence on v210 (P-3): does the tree picker appear at all? Grant a folder; kill and relaunch; confirm the grant re-validates at cold start; revoke it and confirm the
grantLostrepair state appears instead of a silent disappearance. -
renameDocumentbehaviour: does the Files provider honour it (the §3.4 finalise step depends on it)? DoescreateDocumentkeep the.partname verbatim? Both degrade to logged failures, not data loss — but the SAF destination’s real verdict is this test. - Real end-to-end offload: offload the headset’s actual captures to the app folder and to a granted folder; verify hashes; confirm duplicate skip on a second run; interrupt a copy mid-flight and confirm resume finishes byte-exact.
- Delete consent in a panel (P-4): with the switch ON and a verified copy in the log, run a batch delete — does the
createDeleteRequestIntentSender surface correctly from a 2D activity? Refuse it once (nothing deleted) and approve it once (exactly the confirmed set leaves the gallery; free-space report matches). Exercise the SAF delete route the same way. - Selected-photos mode (P-5): grant selected photos only; confirm the gallery is partial-but-honest.
- Cold-launch stopwatch (< 10 s, P-13) and a multi-GB HEVC recording end-to-end (list, thumbnail, offload, verify).
9. Open decisions register
Everything still owed a decision or an external step. “Blocks” means the named work cannot finish — not start — without it.Appendix A — Platform channel methods (as built, Chunk 3)
Channel:com.leverine.capturevault/captures (single MethodChannel, MainActivity.kt). Dart surface: CapturePlatform in lib/state/capture_platform.dart; members added after Chunk 2 carry default bodies so additional implementations (and test fakes) opt in — fakes that extends the interface inherit the defaults; fakes that implements it must provide the full surface (Chunk 3 journals, failures #1 in both checkpoints — recorded so the next builder doesn’t rediscover it).
checkPermissions · requestPermissions · scanCaptures · resolveLabels · loadThumbnail · loadWatermark · saveWatermark · pickFolderTree · listGrantedFolders · appFolderPath · statFile · hashUri · hashFile · copyFile · finalizeFile · discardPartial · loadPersisted · savePersisted · requestDelete · deleteViaSaf · freeSpaceBytes
Appendix B — Per-headset notes
End of specification v1.0. Amendments land as commits to this file with a journal note; the spec is wrong the moment it describes code that doesn’t exist, so §2 and the journals win any argument until the spec is updated.
Source: Leverine/Capture-Vault@66b31c5 —
docs/SPEC.md.