Server &
Network Layer
The backbone of the application. A hybrid architecture combining a local HTTP control bridge with specialized WebSocket and TCP channels for real-time bidirectional communication.
Main Server (Windows)
Local Control & Bridge Server โข Dart Shelf โข JSON
Acts as the single source of truth, coordinating Android background services, ADB connections, and the Flutter UI.
Device & System Discovery
{
"status": "success"
}
{
"android": {
"android_id": "7b74e4bf673dec04",
"device_name": "OnePlus 11 5G",
"ip_address": "192.168.29.168",
"manufacturer": "OnePlus",
"product": "string",
"model": "CPH2447",
"wallpaper": "base64_string...",
"pairing_code": "739129",
"google_email": "user@example.com",
"google_display_name": "Adb Devices Manager",
"google_profile_image_base64": "base64_string...",
"device_fingerprint": "OnePlus/CPH2447/...",
"id": "19def77c"
}
}
Response
Model
{
"status": "success"
}
{
"status": "success",
"devices": [
{
"name": "OnePlus CPH2447",
"id": "OnePlus|CPH2447|qcom...",
"isAdbConnected": true,
"isAppConnected": false,
"isDefault": true,
"ip": "192.168.29.168",
"wifiName": "Mobile Network",
"lastConnected": "2025-12-17T23:03:40...",
"device_id": "19def77c",
"device_image_id": "2",
"device_model": "CPH2447",
"android_version": "16",
"manufacturer": "OnePlus",
"device_name": "OnePlus 11 5G",
"android_id": "7b74e4bf673dec04",
"manufacturer_name": null,
"product_name": null,
"model_name": null,
"wallpaper": "/9j/4AAQSkZJRg...",
"pairing_code": "739129",
"google_email": "user@example.com",
"google_display_name": "Adb Devices Manager",
"google_profile_image_base64": "/9j/4AAD//Z",
"device_fingerprint": "OnePlus/CPH2447/...",
"isAdbProgress": false,
"isAPPProgress": false,
"totalAppCount": null,
"installedApps": []
}
]
}
{
"status": "success",
"windows": {
"hostname": "DESKTOP-VA2142V",
"ip": "192.168.29.193",
"full_name": "DELL",
"microsoft_email": "user@example.com"
}
}
Media & Actions
{
"ip": "192.168.29.168",
"command": "fast", // or "high"
"getDeviceFullInfo": {
"id": "19def77c"
}
}
Response
Model
{
"status": "success",
"message": "Audio broadcast started",
"ip": "192.168.29.168",
"mode": "fast"
}
{
"id": "19def77c"
}
Response
Model
{
"status": "success",
"wallpaper": "/9j/4AAQSkZJRg.....QQSEf/2Q=="
}
{
"id": "19def77c"
}
Response
Model
{
"status": "success",
"google_email": "user@example.com",
"google_display_name": "Adb Devices Manager",
"google_profile_image_base64": "/9j/4AAD//Z"
}
Windows Integration & Device Control
{
"text": "Copied text message"
}
Response
Model
{
"status": "success",
"message": "Copied to clipboard"
}
{
"url": "https://example.com"
}
Response
Model
{
"status": "success",
"message": "URL opened"
}
{
"ip": "192.168.29.168"
}
Response
Model
{
"status": "success",
"functions": {
"Screen Mirroring": true,
"Audio Cast": false,
"Input Control": false
}
}
{
"ip": "192.168.29.168",
"mode": "Screen Mirroring"
}
Response
Model
{
"status": "success",
"message": "Function run"
}
App Bridge Socket
Persistent Connection โข Hardware Identity โข Logic Relay
The primary persistent channel between the Android background service and the desktop bridge. for multiple devices purpose we will use this socket only for live app connection
If, in any case, Windows shuts down, turns off, or becomes disconnected, the Android socket will also be disconnected automatically. Android App will Kill it self For Battery Optimization
Handshake & Device Identity
{
"type": "register",
"id": "Build.MANUFACTURER|Build.MODEL|...",
"ip": "$hidden_address"
}
Call Manager 1
Start call_manager.exe for each Ip
Core WebSocket server for real-time app communication. Enforces Single Active Connection per IP (except localhost), ensuring strict 1:1 state mapping.
Client โ Server Events
{
"type": "call_event",
"event_type": "incoming_call",
"caller_number": "+1234567890",
"device_ip": "$hidden"
}
Server Methods (Dart)
Call Manager 2
Localhost โข Controller for each call_manager.exe
A specialized, ephemeral socket server established only when the Call UI window is active. It ensures secure, 1:1 data syncing between the specific user context and the UI window.
Detailed Protocol Exchange
{
"type": "register_call_ui",
"id": "192.168.1.5_+1234567890",
"ip": "192.168.1.5",
"phoneNumber": "+1234567890",
"deviceDisplayName": "OnePlus 11 5G",
"callerName": "John Doe",
"isIncoming": "1"
}
{
"type": "call_update",
"ip": "192.168.1.5",
"number": "+1234567890"
}
AdbTcpServer (Dex)
Global TCP Service โข App Logic Sync
A global service providing deep integration for Android Dex mode. It broadcasts UI events, system toggles, and manages high-performance app audio streams across all connected clients.
System Control & Navigation
{
"type": "go home",
"ok": true
}
{
"type": "toggleBluetooth",
"status": true
}
App Audio Streaming Protocol
{
"type": "set_app_audio",
"app": "com.spotify.music",
"status": true
}
App Data Sync (Client โ Server)
{
"type": "sync_all_favorites",
"data": [
{ "name": "Spotify", "package": "com.spotify.music" },
{ "name": "YouTube", "package": "com.google.android.youtube" }
]
}
{
"type": "Side Bar click event",
"data": "open app"
}
{
"type": "add_new_recent_app",
"package": "com.whatsapp",
"label": "WhatsApp"
}
Main Server (Android)
Device-Side Server โข Local Network Only โข Secured
The Android device hosts a local HTTP server to handle requests from the Windows desktop app. All routes are local-network only and most require a security .
Health & Connection
{
"status": "success",
"timestamp": 1730000000000,
"message": "Server is running"
}
(For mutiple device support).
{
"status": "success",
"connected": true,
"server_ip": "192.168.x.x",
"timestamp": 1730000000000
}
{
"status": "success",
"message": "App will disconnect and close shortly.",
"timestamp": 1730000000000
}
Socket Services
{
"ip": "192.168.x.x"
}
Response
Model
{
"status": "success",
"timestamp": 1730000000000,
"message": "Socket service started successfully."
}
{
"ip": "192.168.x.x"
}
Response
Model
{
"status": "success",
"timestamp": 1730000000000,
"message": "Notification socket service started successfully."
}
File Transfer
<Raw File Bytes>
Response
Model
{
"status": "success",
"message": "File downloaded successfully",
"filePath": "/storage/emulated/0/Download/example.zip",
"fileSize": 12.5,
"duration": 3.2,
"speedMBps": 3.9
}
App Data API
/app_data โข Installed Apps & Metadata
{
"status": "success",
"count": 125,
"apps": [
{
"app_name": "WhatsApp",
"package_name": "com.whatsapp",
"version_name": "2.24.1",
"is_system": false,
"is_home_app": true,
"source_dir": "/data/app/~~xyz/base.apk",
"icon_base64": "iVBORw0KGgoAAA..."
}
]
}
{
"status": "success",
"total_app_count": 125
}
Call Settings API
/call_settings โข Call Logs, Control & Dialer Operations
{
"status": "success",
"count": 20,
"calls": [
{
"id": 42,
"name": "John Doe",
"number": "+911234567890",
"type": "incoming",
"timestamp": 1730000000000,
"duration_seconds": 120
}
]
}
?number=12345
Response
Model
{
"status": "success",
"count": 3,
"calls": [
{
"id": 12,
"name": "Unknown",
"number": "12345",
"type": "missed",
"timestamp": 1730000000000,
"duration_seconds": 0
}
]
}
?number=1234567890
Response
Model
{
"status": "success",
"message": "Placing call to 1234567890"
}
?id=42 (Optional, delete all if missing)
Response
Model
{
"status": "success",
"message": "Deleted call log with id: 42",
"rows_deleted": 1
}
{
"status": "success",
"message": "Call ended successfully"
}
{
"status": "success",
"message": "Answered incoming call"
}
Contacts API
/contacts โข Address Book Access
{
"status": "success",
"total_contacts": 50
}
{
"status": "success",
"count": 1,
"contacts": [
{
"id": "1",
"name": "Alice",
"numbers": ["+123456789"],
"photo_base64": "iVBORw0KGg..."
}
]
}
File Manager API
/file_manager โข Filesystem Operations
?path=/storage/emulated/0 (Optional)
Response
Model
{
"status": "success",
"path": "/storage/emulated/0",
"count": 10,
"files": [
{
"name": "DCIM",
"path": "/storage/emulated/0/DCIM",
"is_directory": true,
"size": 0,
"last_modified": 1730000000,
"type": "directory"
}
]
}
?path=/sdcard/note.txt
Response
Model
{
"status": "success",
"path": "/sdcard/note.txt",
"content": "Hello World"
}
?path=/sdcard/photo.jpg
Response
Model
{
"status": "success",
"info": { ...file_object... }
}
?path=/sdcard/trash
Response
Model
{
"status": "success",
"message": "Deleted: /sdcard/trash"
}
?old_path=...&new_path=...
Response
Model
{
"status": "success"
}
?path=/sdcard&name=NewFolder
Response
Model
{
"status": "success"
}
?query=invoice&path=/sdcard
Response
Model
{
"status": "success",
"query": "invoice",
"count": 5,
"results": [ ...file_objects... ]
}
?path=/sdcard/video.mp4
Response
Model
{
"status": "success",
"message": "Opened: /sdcard/video.mp4"
}
?src=...&dest=...&mode=copy|move
Response
Model
{
"status": "success",
"message": "Operation completed: copy"
}
Multipart: file=..., target_path=..., file_name=...
Response
Model
{
"status": "success",
"message": "Uploaded uploaded_file",
"saved_name": "uploaded_file",
"saved_path": "/storage/emulated/0/uploaded_file"
}
Photo Data API
/photo_data โข Media Library & Thumbnails
Provides deep access to the Android MediaStore gallery. Supports pagination, album filtering, and high-performance thumbnail generation on-the-fly.
?page=1&limit=30
Response
Model
{
"status": "success",
"page": 1,
"limit": 30,
"count": 30,
"photos": [
{
"name": "IMG_2024.jpg",
"path": "/sdcard/DCIM/Camera/...",
"folder_name": "Camera",
"date_taken": 1730000000000,
"size": "2.4 MB",
"thumbnail_base64": "iVBORw0KG..."
}
]
}
?path=/sdcard/DCIM/Camera/IMG_1.jpg
Response
Model
{
"status": "success",
"path": "/sdcard/DCIM...",
"image_base64": "/9j/4AAQ..."
}
{
"status": "success",
"total_photo_count": 1254
}
{
"status": "success",
"folder_count": 5,
"folders": [
{ "folder_name": "Camera" },
{ "folder_name": "Screenshots" }
]
}
?folder_name=Camera&page=1&limit=30
Response
Model
{
"status": "success",
"folder_name": "Camera",
"count": 30,
"photos": [ ... ]
}
?folder_name=Camera
Response
Model
{
"status": "success",
"total_folder_photos_count": 450
}
SMS API
/sms_settings โข Messaging & Conversations
Enables full interaction with the device's SMS database. Supports reading the entire inbox/sent history, sending new messages, and deleting records.
{
"status": "success",
"count": 150,
"messages": [
{
"address": "+1234567890",
"body": "Hello from ADB Manager",
"timestamp": 1730000000000,
"type": "inbox"
}
]
}
?number=+1234567890&message=Hello
Response
Model
{
"status": "success",
"sent_to": "+1234567890",
"message": "Hello"
}
?id=123
Response
Model
{
"status": "success",
"deleted_count": 1
}
FileUploadServer (File Transfer)
HTTP + WebSocket โข File Streaming โข Real-time Sync
A hybrid server combining HTTP file transfer endpoints with WebSocket for real-time device registration and state sync. Handles multipart uploads, binary streaming, and Flutter โ Server communication.
WebSocket Connection
{
"type": "register",
"name": "OnePlus 11 5G"
}
Server
Action
// Device added to controller.connectedDevices
// {socket, {name, ip}} stored for tracking
File Upload Routes
{
"Content-Type": "multipart/form-data; boundary=...",
"google_display_name": "User Display Name"
}
Response
Model
{
"success": true,
"file_name": "document.pdf",
"bytes": 1048576
}
{
"file_path": "C:\\Users\\DELL\\Downloads\\document.pdf"
}
Response
Headers
{
"Content-Type": "application/octet-stream",
"Content-Disposition": "attachment; filename=\"document.pdf\"",
"Content-Length": 1048576,
"Cache-Control": "no-cache, no-store, must-revalidate"
}
Flutter Integration
{
"file_paths": [
"C:\\Users\\DELL\\Documents\\file1.pdf",
"C:\\Users\\DELL\\Documents\\file2.jpg"
],
"is_send_to": true
}
Response
Model
{
"ok": true,
"received_count": 2,
"file_paths": [
"C:\\Users\\DELL\\Documents\\file1.pdf",
"C:\\Users\\DELL\\Documents\\file2.jpg"
]
}
Internal
Actions
// 1. Brings window to front via windowManager
// 2. Fetches available devices from Flask backend
// 3. Updates controller.fileList with new entries
// 4. Each file stored with status: "Ready"
"Toggled"
Behavior
// If window visible โ hide()
// If window hidden โ show() + focus()
Legacy Binary Upload (Flutter Client)
{
"filename": "report.pdf",
"content-length": 2097152,
"x-forwarded-for": "192.168.29.168"
}
Response
Model
{
"success": true,
"file_name": "report.pdf"
}
Static File Serving
{
".html": "text/html",
".css": "text/css",
".js": "application/javascript"
}
Asset
Location
"lib/html_files/{filename}"
Notification Server (HTTP)
UI Toggle Control โข Stream Events
A singleton HTTP server that manages notification UI visibility toggles. Exposes a stream controller for real-time UI state updates across the application.
HTTP Endpoints
{
"toggle_timestamp": 1703097600000
}
Response
Model
{
"status": "success",
"message": "Toggle notification UI processed successfully",
"timestamp": 1703097600123
}
Stream Event
Emitted
{
"type": "toggle_ui",
"timestamp": 1703097600123,
"request_timestamp": 1703097600000
}
Stream Controller
Stream<Map<String, dynamic>>
// Broadcast stream - multiple listeners supported
Event
Model
{
"type": "toggle_ui",
"timestamp": 1703097600123,
"request_timestamp": 1703097600000 // from request
}
Notification TCP Server
LAN Accessible โข JSON Line Protocol
A raw TCP socket server bound to the local network IP for receiving notification data from Android devices. Uses JSON line protocol (newline-delimited JSON) for reliable message parsing.
Client Connection Flow
// Server logs:
"๐ก Client connected: 192.168.29.168 (total=1)"
// Client stored in _clients list
// Buffer initialized for JSON line parsing
{
"type": "notification",
"title": "New Message",
"body": "You have a new notification",
"package": "com.whatsapp",
"timestamp": 1703097600000
}\n โ newline delimiter required
Stream
Output
// notificationsStream emits:
{
"type": "notification",
"title": "New Message",
"body": "You have a new notification",
...
}
// On client disconnect:
"๐ Disconnected: 192.168.29.168:54321"
"๐งน Cleaned up client (remaining=0)"
// โ ๏ธ If no clients remain โ exit(0)
"๐ช No clients remaining โ exiting immediately."
Outgoing Commands
{
"action": "dismiss",
"notification_id": "12345"
}\n
Broadcast Log
"๐ค Sent to 2 clients: {action: dismiss, ...}"
Media DataManager (HTTP)
Window Visibility โข Media Control
A singleton HTTP server for controlling the media playback window
visibility.
Integrates with window_manager to show/hide the media overlay UI.
{
"status": "success",
"message": "Media window visibility toggled",
"is_visible": true
}
Behavior
// If window is visible โ windowManager.hide()
// If window is hidden โ windowManager.show()
// Returns the NEW visibility state
Response
Model
(Error)
{
"status": "error",
"message": "Error toggling visibility: $error"
}
Media TCP Server
Media Sync โข Smart Caching
A high-performance TCP socket server for streaming media metadata from Android devices. Features intelligent caching, debounced updates, and IP-based client grouping for reliable playback state sync.
Client Connection & IP Grouping
// New client from same IP replaces old connection:
"๐ Client connected: 192.168.29.168:54321"
// _clientGroups[ip] = [newSocket]
// Previous sockets from same IP destroyed
Media Data Types
{
"type": "core_info",
"package_name": "com.spotify.music",
"title": "Blinding Lights",
"artist": "The Weeknd",
"album": "After Hours",
"is_playing": true,
"position": 45000,
"duration": 200000
}
{
"type": "app_icon",
"package_name": "com.spotify.music",
"icon_base64": "/9j/4AAQSkZJRgABAQAA..."
}
{
"type": "album_art",
"package_name": "com.spotify.music",
"art_base64": "/9j/4AAQSkZJRgABAQAA..."
}
{
"type": "remove_info",
"package_name": "com.spotify.music"
}
Callback Emitted
// onMediaUpdate called with:
{
"package_name": "com.spotify.music",
"type": "remove_info"
}
Smart Cache System
{
"com.spotify.music": {
"core_info": { /* title, artist, etc */ },
"app_icon": { /* icon_base64 */ },
"album_art": { /* art_base64 */ }
},
"com.google.android.youtube.music": { ... }
}
Merge
Behavior
// After 150ms debounce, all cached data merged:
{
"package_name": "com.spotify.music",
"title": "Blinding Lights",
"artist": "The Weeknd",
"icon_base64": "...",
"art_base64": "..."
}
// โ onMediaUpdate?.call(merged)
Outgoing Commands
// Play/Pause
{ "action": "play" }
{ "action": "pause" }
// Skip tracks
{ "action": "next" }
{ "action": "previous" }
// Seek to position
{ "action": "seek", "position": 60000 }
// Send to specific device:
sendCommandToIp("192.168.29.168", {
"action": "pause"
});
Disconnect Handling
// 1. Destroy all sockets for IP
// 2. Remove from _clientGroups
// 3. Clear entire _mediaCache
// 4. Emit remove_All event:
{
"package_name": "192.168.29.168",
"type": "remove_All"
}
// โ ๏ธ If no clients remain โ exit(0)