Implement CameraX GPG key import and QR export on Android #106

Open
opened 2026-08-17 19:15:15 +00:00 by hugo · 0 comments
Owner

Goal

Transfer ASCII-armored GPG public and private keys through single- or multipart QR codes using Android-native camera/display adapters.

Scope

  • Use CameraX Preview and ImageAnalysis with the runtime camera permission for scanning; pass normalized frame bytes/planes and orientation to Rust-owned QR decoding and multipart-envelope parsing.
  • Render Rust-provided QR matrices in Compose Canvas for export; Kotlin must not construct payloads or re-encode key armor.
  • Preserve exact armored bytes. Parsing, fingerprinting, public/secret matching, passphrase validation, duplicate handling, import transaction, and default-key selection remain in crates/storage.
  • Present progress for duplicate/out-of-order/missing frames and allow safe pause/cancel across rotation, fold, permission interruption, and app background.
  • Require explicit security confirmation plus storage-derived fingerprint/identity before importing or displaying private material.
  • Apply FLAG_SECURE, brightness/keep-screen-on only while needed, and immediate masking on background/lock; never copy armor to clipboard, save it to photos, cache camera frames, or log payloads.
  • Handle permission denial/permanent denial, unavailable camera, invalid/incomplete/mismatched armor, duplicate key, interrupted import, and process death safely.
  • Prove compatibility with existing ASCII-armored GPG fixtures and QR envelope versions.

Acceptance criteria

  • Single and multipart fixtures reconstruct byte-for-byte and import transactionally.
  • Invalid/incomplete/mismatched data cannot replace valid keys/config.
  • Camera analysis stays responsive and bounded on low-memory devices and changing fold orientations.
  • Private export/import is never visible in recents/screenshots and leaves no ordinary Android persistence.
  • Kotlin contains no QR payload, GPG parser, fingerprint, matching, or import policy.

Depends on Rust/UniFFI packaging, lifecycle security, biometric authentication, and onboarding. Part of #87.

## Goal Transfer ASCII-armored GPG public and private keys through single- or multipart QR codes using Android-native camera/display adapters. ## Scope - Use CameraX Preview and ImageAnalysis with the runtime camera permission for scanning; pass normalized frame bytes/planes and orientation to Rust-owned QR decoding and multipart-envelope parsing. - Render Rust-provided QR matrices in Compose Canvas for export; Kotlin must not construct payloads or re-encode key armor. - Preserve exact armored bytes. Parsing, fingerprinting, public/secret matching, passphrase validation, duplicate handling, import transaction, and default-key selection remain in `crates/storage`. - Present progress for duplicate/out-of-order/missing frames and allow safe pause/cancel across rotation, fold, permission interruption, and app background. - Require explicit security confirmation plus storage-derived fingerprint/identity before importing or displaying private material. - Apply `FLAG_SECURE`, brightness/keep-screen-on only while needed, and immediate masking on background/lock; never copy armor to clipboard, save it to photos, cache camera frames, or log payloads. - Handle permission denial/permanent denial, unavailable camera, invalid/incomplete/mismatched armor, duplicate key, interrupted import, and process death safely. - Prove compatibility with existing ASCII-armored GPG fixtures and QR envelope versions. ## Acceptance criteria - Single and multipart fixtures reconstruct byte-for-byte and import transactionally. - Invalid/incomplete/mismatched data cannot replace valid keys/config. - Camera analysis stays responsive and bounded on low-memory devices and changing fold orientations. - Private export/import is never visible in recents/screenshots and leaves no ordinary Android persistence. - Kotlin contains no QR payload, GPG parser, fingerprint, matching, or import policy. Depends on Rust/UniFFI packaging, lifecycle security, biometric authentication, and onboarding. Part of #87.
hugo added this to the 06 - Implement an Android version of the software milestone 2026-08-17 19:15:15 +00:00
hugo added the enhancement label 2026-08-17 19:15:15 +00:00
Sign in to join this conversation.