Skip to content

Conversation

@fhello23
Copy link
Contributor

@fhello23 fhello23 commented Aug 2, 2025

Description

Security Verification Feature Implementation

Overview

Implemented the security verification feature for Android to maintain parity with the iOS version. This feature allows users to verify the identity of peers they're chatting with by comparing cryptographic fingerprints through a secure channel.

Key Features Implemented

Security Verification Dialog

  • Created SecurityVerificationDialog composable that displays:
    • Peer's fingerprint and user's own fingerprint in readable format
    • Current encryption session status (encrypted, handshake in progress, etc.)
    • Ability to copy fingerprints to clipboard
    • Verification status (verified/unverified) with appropriate UI indicators
    • "MARK AS VERIFIED" button for user confirmation

Persistent Verification State

  • Added verified fingerprints tracking using SharedPreferences for persistence
  • Implemented JSON serialization for storing fingerprint sets
  • Automatic loading of verified fingerprints at app startup
  • Real-time UI updates when verification state changes
  • Integration with panic clear functionality to remove verified fingerprints

UI Integration

  • Made private chat header clickable to open security verification dialog
  • Added proper state management for showing/hiding dialog
  • Implemented dark mode support with consistent color scheme
  • Following same visual design and workflow as iOS FingerprintView

Verification Workflow

  1. User opens private chat and clicks peer's nickname
  2. Security verification dialog appears showing both fingerprints
  3. Initially shows "⚠️ NOT VERIFIED" status
  4. User compares fingerprints through secure channel
  5. User clicks "MARK AS VERIFIED" to confirm identity
  6. Status immediately updates to "✓ VERIFIED"
  7. Verification state persists across app sessions
  8. During panic clear, all verification data is removed

Files Modified/Added

  • SecurityVerificationDialog.kt - New composable dialog
  • ChatViewModel.kt - Added verification state management and persistence
  • ChatState.kt - Added verified fingerprints LiveData
  • ChatScreen.kt - Integrated dialog into main UI
  • ChatHeader.kt - Made peer nickname clickable to open verification

Parity with iOS

This implementation maintains 100% feature parity with the iOS FingerprintView, providing the same security verification workflow and user experience for Android users.

WhatsApp Image 2025-08-01 at 20 13 58

Checklist

@callebtc
Copy link
Collaborator

callebtc commented Aug 5, 2025

that is awesome. amazing PR!

@callebtc callebtc added enhancement New feature or request needs review Someone should look at it labels Aug 5, 2025
@fhello23
Copy link
Contributor Author

fhello23 commented Aug 5, 2025

Thanks! Happy to help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request needs review Someone should look at it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants