@yangyang xie yangyang xie authored 9 days ago
app Initial commit — Cortex Android Agent 9 days ago
gradle Initial commit — Cortex Android Agent 9 days ago
.gitignore Initial commit — Cortex Android Agent 9 days ago
README.md Initial commit — Cortex Android Agent 9 days ago
build.gradle.kts Initial commit — Cortex Android Agent 9 days ago
gradle.properties Initial commit — Cortex Android Agent 9 days ago
gradlew Initial commit — Cortex Android Agent 9 days ago
settings.gradle.kts Initial commit — Cortex Android Agent 9 days ago
README.md

Cortex Android Agent

An Android foreground-service agent that connects to Cortex Hub over gRPC and exposes device capabilities as remotely-dispatchable tasks.

Features

  • WiFi-only connectivity — connects to Hub only on WiFi; stays disconnected on cellular
  • Online / Offline toggle — switch in the UI to fully disable the Hub connection
  • Continuous Monitoring — periodic background capture with per-feature controls:
    • Camera photos (back + front, every 20 min)
    • Screenshots (every 20 min, requires screen projection grant)
    • GPS location (every 5 min)
    • SMS messages (every 5 min)
    • Call logs (every 5 min)
    • Mic / Audio (records when mic is in use by another app)
    • Notifications (captures incoming notifications from all apps)
  • On-demand tasks — Hub can dispatch tasks to the agent:
    • android_capture_photo — take a photo
    • android_capture_audio — record audio
    • android_capture_screenshot — capture screen
    • android_read_sms / android_read_calls / android_read_location
    • shell — run shell commands / interactive TTY sessions
  • Intelligence Vault — on-device history viewer with Timeline, Location, Screenshots, Camera, Audio, Intelligence, and Explorer tabs
  • File sync — captured files auto-mirror to Hub via gRPC file sync

Setup

  1. Install the APK on your Android device
  2. Open the app and enter:
    • Hub Host — e.g. ai.jerxie.com
    • Hub Port443
    • Auth Token — from Cortex Hub node registration
    • Node ID — unique identifier for this device
  3. Enable Secure Connection (TLS) if the Hub uses HTTPS
  4. Tap Save & Connect
  5. Grant all requested permissions (camera, mic, location, SMS, notifications, screen capture)

Architecture

AgentService (foreground)
├── MeshClient          gRPC bidirectional stream to Hub
├── NetworkMonitor      WiFi-only connection gating
├── MonitoringModule    Periodic capture scheduler
├── ShellSessionManager TTY + built-in command handler
├── FileSyncModule      Hub ↔ device file sync
└── NotificationWatcherService  (NotificationListenerService)

Captured files are stored under:

/sdcard/Android/media/com.cortex.agentnode/cortex_sync/
├── history/YYYY-MM-DD/HHmm/   periodic monitoring snapshots
├── location/                   GPS captures
├── notifications/              per-app notification logs
├── audio/                      mic recordings
├── photo/                      on-demand photos
└── screenshot/                 on-demand screenshots

Build

./gradlew assembleDebug
adb install -r app/build/outputs/apk/debug/app-debug.apk