Skip to content

[WIP] Implement Play Integrity attestation and expand proof companion…#790

Merged
prathieshna merged 2 commits into
temp/next-prod-release-8th-june-2026from
feature/proofmode-c2pa-based-on-new-requirements
Jul 12, 2026
Merged

[WIP] Implement Play Integrity attestation and expand proof companion…#790
prathieshna merged 2 commits into
temp/next-prod-release-8th-june-2026from
feature/proofmode-c2pa-based-on-new-requirements

Conversation

@prathieshna

Copy link
Copy Markdown

… file generation.

Specific changes:

Proof Generation & Metadata:

  • Expanded ProofCompanionGenerator to generate .csv proof files and corresponding PGP signatures (.csv.asc) alongside existing JSON proofs.
  • Added a dynamically generated HowToVerifyProofData.txt to the proof bundle with instructions for manual GPG, OpenTimestamps, and Play Integrity verification.
  • Refactored metadata extraction into buildProofFields to include richer device and network information (e.g., Brand, Model, Network Type, IPv4/IPv6, CellInfo) directly from CaptureMetadata.
  • Updated CameraViewModel to pass live capture metadata to the proof generator, ensuring sensor and device fields are preserved without relying solely on EXIF.

Google Play Integrity (GST):

  • Introduced SafetyNetHelper with flavor-specific implementations:
    • GMS: Requests a Play Integrity token (GST) using a nonce derived from the media hash and saves it to a .gst file.
    • FOSS: Provides a no-op stub for environments without Google Mobile Services.
  • Added com.google.android.play:integrity dependency to the GMS build configuration.

Networking & Utilities:

  • Updated OpenTimestamps (OTS) submission to use application/octet-stream for raw hash uploads.
  • Implemented CSV escaping logic to handle special characters and line breaks in metadata fields.
  • Included the new .csv, .gst, and instruction files in the list of companions prepared for upload.

… file generation.

Specific changes:

**Proof Generation & Metadata:**
- Expanded `ProofCompanionGenerator` to generate `.csv` proof files and corresponding PGP signatures (`.csv.asc`) alongside existing JSON proofs.
- Added a dynamically generated `HowToVerifyProofData.txt` to the proof bundle with instructions for manual GPG, OpenTimestamps, and Play Integrity verification.
- Refactored metadata extraction into `buildProofFields` to include richer device and network information (e.g., Brand, Model, Network Type, IPv4/IPv6, CellInfo) directly from `CaptureMetadata`.
- Updated `CameraViewModel` to pass live capture metadata to the proof generator, ensuring sensor and device fields are preserved without relying solely on EXIF.

**Google Play Integrity (GST):**
- Introduced `SafetyNetHelper` with flavor-specific implementations:
    - **GMS:** Requests a Play Integrity token (GST) using a nonce derived from the media hash and saves it to a `.gst` file.
    - **FOSS:** Provides a no-op stub for environments without Google Mobile Services.
- Added `com.google.android.play:integrity` dependency to the GMS build configuration.

**Networking & Utilities:**
- Updated OpenTimestamps (OTS) submission to use `application/octet-stream` for raw hash uploads.
- Implemented CSV escaping logic to handle special characters and line breaks in metadata fields.
- Included the new `.csv`, `.gst`, and instruction files in the list of companions prepared for upload.

@github-advanced-security github-advanced-security AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

detekt found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@prathieshna prathieshna merged commit 7e51a3c into temp/next-prod-release-8th-june-2026 Jul 12, 2026
2 checks passed
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.

2 participants