Skip to content

Project Description Dhvani

Project Description Dhvani is an intelligent, on-device Android application designed to protect vulnerable users from real-time phone and UPI (Unified Payments Interface) scams.

Core trick

Call audio streams to Gemini Live for scoring, while on-device Gemma scores offline; fused risk locks UPI apps.

Tags

Description

Project Description Dhvani is an intelligent, on-device Android application designed to protect vulnerable users from real-time phone and UPI (Unified Payments Interface) scams. Operating on a Sense → Decide → Act → Check architectural framework, the app silently monitors active phone calls and incoming SMS messages, leveraging a hybrid local/cloud AI approach to intercept fraudulent activity before a user can be tricked into transferring funds. The Problem It Solves Social engineering and telephonic financial fraud (impersonation scams, fake lottery wins, panic-induced transfers) are skyrocketing. Existing spam-blocking tools only flag known numbers before a call, leaving users entirely unprotected once a conversation begins. Dhvani bridges this gap by providing active, real-time intervention during the call itself—safeguarding users who are actively being manipulated. How It Works Sense: A background service (CallMonitoringCoordinator and AudioCaptureManager) securely captures real-time call audio alongside incoming SMS messages (detecting OTPs or fraudulent payment requests). Decide: The application runs a continuous evaluation loop. It streams live transcripts to the cloud via Gemini Live for heavy-duty threat scoring while simultaneously running an offline, on-device threat assessment using Gemma (via Google AI Edge LiteRT-LM) to ensure resilience and low latency. Act: If the fused risk score crosses a critical threshold, the app takes immediate control via an Android Accessibility Service. It instantly locks down all UPI payment applications, drops a full-screen threat overlay warning to break the scammer's psychological hold, and triggers haptic alerts. Check: The loop validates that the application lock is successfully maintained. If it detects an bypass attempt, it automatically dispatches an emergency SMS alert to a trusted contact or next of kin. Built natively in Kotlin using Jetpack Compose, LiteRT, and robust Android system-level APIs, Dhvani acts as a bulletproof digital guardian for real-time mobile transaction security.
its-wasp/dhvani★ 00 forksKotlinCreated Jul 11, 2026 · last push Jul 11, 2026

README excerpt

# Dhwani

On-device Android app that defends against real-time phone/UPI scam calls. It listens to active calls, detects fraud with AI, and automatically **locks UPI payment apps** before the victim can be tricked into paying.

## What it does

1. Runs a silent foreground service during calls.
2. Captures call audio and analyzes it two ways:
   - **Gemini Live** (cloud, `GEMINI_API_KEY`) for streaming transcript + threat scoring.
   - **Gemma** (on-device via LiteRT-LM) for offline audio threat assessment.
3. Fuses signals from audio transcripts and incoming **SMS** (e.g. OTP / payment messages).
4. When a scam is detected, it **enforces**: blocks UPI apps via an Accessibility Service, shows a full-screen threat overlay, vibrates, and can send an emergency SMS.

## Architecture (Sense → Decide → Act → Check)

- **Sense** — `service/`, `fusion/`, `live/`: capture audio + call state (`CallMonitoringCoordinator`, `AudioCaptureManager`), transcribe/analyze (`LiveThreatAnalyzer`, `FlashLiveClient`), and listen to SMS (`SmsNotificationListener`, `SmsParser`).
- **Decide** — `agent/`: `SenseDecideActCheckLoop` builds a `SenseContext` and asks a `LocalAgentEngine` (`GemmaAgentEngine` / `HeuristicLocalAgentEngine`) for an `AgentDecision` (risk score + `shouldLock`).
- **Act** — `enforcement/` via `DhwaniToolSet`: `EnforcementController` + `ThreatAccessibilityService` lock UPI apps; `ThreatOverlayActivity` warns the user.
- **Check** — verifies the lock held; if not, fires an emergency

Team