Skip to content

fix: handle real ProofMode bundles (iOS + Android)#1

Open
johnx25bd wants to merge 8 commits intomainfrom
fix/real-bundle-support
Open

fix: handle real ProofMode bundles (iOS + Android)#1
johnx25bd wants to merge 8 commits intomainfrom
fix/real-bundle-support

Conversation

@johnx25bd
Copy link
Copy Markdown
Contributor

Summary

  • CSV parser: auto-detects horizontal header+data format (real ProofMode output from writeMapToCSV) while preserving vertical key-value compat
  • Bundle parser: handles .devicecheck (iOS DeviceCheck attestation), skips .txt documentation files, matches media by known extensions instead of catch-all that misidentified non-media files
  • Signal aliases: added iOS-style field names (Wifi MAC, DeviceID Vendor, File Path, File Hash SHA256, File Modified, Proof Generated) and 2016-era legacy names (CurrentDateTime0GMT, SHA256, etc.)
  • SRS fix: EPSG:4326http://www.opengis.net/def/crs/OGC/1.3/CRS84 (service Zod schema requires URL)
  • Media extensions: added .tiff, .tif, .avif for professional cameras

Test plan

  • All 25 tests pass (20 existing + 5 new)
  • Typecheck clean
  • Test with real ProofMode iOS bundle (private, local only)
  • Test with real ProofMode Android bundle

Real ProofMode bundles from Android/iOS use writeMapToCSV which
outputs headers on the first row and values on the second, not
the vertical key-value format the parser assumed. Auto-detect
the format by counting columns and zip headers with values.
Add .devicecheck handling for iOS DeviceCheck attestations, skip
.txt documentation files, and match media files by known extensions
instead of a catch-all that misidentified non-media files.
iOS ProofMode uses space-separated names like "Wifi MAC" and
"File Hash SHA256" instead of dot-separated. Add aliases so
these normalize to the canonical form.
The service Zod schema validates SRS as a URL. CRS84 is the
correct OGC identifier for WGS84 longitude-latitude order
which matches our GeoJSON coordinate layout.
Cover the real-world formats: horizontal header+data CSV parsing,
iOS DeviceCheck attestation extraction, .txt file skipping, and
signal name alias normalization.
Add .tiff, .tif, .avif to media allowlist for professional cameras.
Add 2016-era ProofMode field aliases (CurrentDateTime0GMT, SHA256,
File, Modified, etc.) to support older sample bundles.
Tests parse real ProofMode bundles through the full pipeline:
- iOS bundle: horizontal CSV, DeviceCheck, OTS, PGP key, media
- 2016 Android sample: legacy field aliases, no GPS data

Private bundles are gitignored. The 2016 sample ZIP is from
the public proofmode-android/samples/ directory.
ProofModePlugin now implements sign(stamp, signer) using the
StampSigner abstraction, matching MockPlugin and WitnessChain.
Signer is required since this plugin doesn't manage keys.

createStampFromBundle now carries PGP.PublicKey and
PGP.MetadataSignature (base64) in signals as provenance evidence,
not just the HasPGPKey boolean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant