clawdnode-android/STATUS.md

4.1 KiB

ClawdNode Android - Status Report

Last Updated: 2026-03-02
Version: 0.1.0
Branch: main (clean, up to date with origin)

What's Complete

Core Architecture

  • Gateway Protocol v3 Implementation - Full WebSocket handshake with challenge/response
  • NodeService - Foreground service managing gateway connection
  • GatewayClient - WebSocket client with auto-reconnect
  • Protocol Messages - Complete event/command data classes

Notification System

  • NotificationListener - Captures all notifications
  • Forwards to Gateway - app, package, title, text, available actions
  • Action triggering - Can reply to messages, trigger actions
  • Dismiss notifications - Remote dismissal support

Call Screening

  • CallScreener - Intercepts incoming calls before ring
  • Sends to Gateway - callId, number, contact lookup
  • VoiceCallService - InCallService for active call control

Voice Features

  • TTS initialized - Can speak into calls
  • STT wired up - Speech recognition for caller transcription
  • Answer/Reject/Hangup - Full call control

Security

  • TokenStore - EncryptedSharedPreferences for credentials
  • DeviceIdentity - Device ID + key signing for challenges
  • AuditLog - Local action logging

Network

  • Cleartext HTTP enabled - For Tailscale/local IP development
  • WebSocket with OkHttp - Proper ping/pong, reconnect logic

UI

  • MainActivity - Gateway config, permission management, live log
  • Live connection log - Real-time WebSocket debug output
  • Permission flow - Notification listener, call screening role, runtime permissions

🔧 TODOs Found in Code

File Line TODO Status
VoiceCallService.kt - Calculate actual call duration Fixed
CallScreener.kt - Contact lookup Fixed
GatewayClient.kt - Queue events for retry when disconnected Fixed
NodeService.kt - Screenshot capture via MediaProjection Pending

📋 What's Ready for Testing

  1. APK Build - Run ./gradlew assembleDebug
  2. Install on phone - adb install app/build/outputs/apk/debug/app-debug.apk
  3. Configure Gateway - Enter Tailscale IP:18789 and token
  4. Grant permissions - Follow UI prompts
  5. Test notifications - Send yourself a message, see if gateway receives it
  6. Test call screening - Call the phone, check gateway logs

🧪 Testing Checklist

Basic Connectivity

  • App installs and starts
  • Gateway URL/token saved successfully
  • WebSocket connects (watch live log)
  • "Connected to Gateway" shows ✓
  • Auto-reconnect works after disconnect

Notifications

  • WhatsApp message → gateway receives event
  • SMS → gateway receives event
  • Gateway can trigger "Reply" action
  • Gateway can dismiss notification

Calls

  • Incoming call → gateway receives node.call.incoming
  • Gateway can send call.answer → phone answers
  • TTS greeting plays after answer
  • STT captures caller speech → node.call.audio
  • Gateway can send call.hangup

🚀 Next Steps (Priority Order)

  1. Build & Install APK - Test basic gateway connectivity
  2. Test notification forwarding - Simplest feature to verify
  3. Test call screening event - Does incoming call show in gateway?
  4. Test call answer with TTS - Does the phone answer and speak?
  5. Implement contact lookup - Minor enhancement
  6. Implement screenshot - MediaProjection requires user consent flow

📝 Gateway Side Integration

The gateway needs handlers for:

  • node.notification events
  • node.call.incoming events
  • node.call.audio events
  • node.call.ended events

And must send:

  • node.invoke with command: notification.action, call.answer, etc.

🔗 Commands Reference

// Answer call
{"method":"node.invoke","params":{"command":"call.answer","args":{"callId":"tel:+1234567890","greeting":"Hello!"}}}

// Reply to notification
{"method":"node.invoke","params":{"command":"notification.action","args":{"id":"com.whatsapp:123:..","action":"Reply","text":"On my way!"}}}