# dreamhax444/tracker_app architecture

> Architecture diagram of the GitHub repository dreamhax444/tracker_app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dreamhax444/tracker_app
- Repository: https://github.com/dreamhax444/tracker_app

## Overview

Trace Tracker is an Android daemon for fleet-device tracking and remote monitoring. The documented control flow begins with a controller sending signed commands through Supabase Realtime; the tracker verifies them and acknowledges receipt. It then either batches location telemetry back through Realtime or negotiates WebRTC media over the signaling channel, with audio/video sent peer-to-peer. The README also describes sensor remediation, battery-resilience behavior, and stealth-state synchronization. Source excerpts were not provided, so subsystem paths follow the tree and relationships rely on README documentation.

Main entry points: [`app/src/main/java/com/example/livelocationservice/LiveLocationService.kt`](https://github.com/dreamhax444/tracker_app/blob/main/app/src/main/java/com/example/livelocationservice/LiveLocationService.kt) (Tracker daemon), [`app/src/main/java/com/example/livelocationservice/webrtc/TrackerWebRtcManager.kt`](https://github.com/dreamhax444/tracker_app/blob/main/app/src/main/java/com/example/livelocationservice/webrtc/TrackerWebRtcManager.kt) (Peer connection), [`app/src/main/java/com/example/livelocationservice/command/CommandVerificationPipeline.kt`](https://github.com/dreamhax444/tracker_app/blob/main/app/src/main/java/com/example/livelocationservice/command/CommandVerificationPipeline.kt) (Command verification), [`app/src/main/java/com/example/livelocationservice/command/SignedCommandAcknowledgement.kt`](https://github.com/dreamhax444/tracker_app/blob/main/app/src/main/java/com/example/livelocationservice/command/SignedCommandAcknowledgement.kt) (Signed acknowledgements)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Daemon runtime"]
  node_service["Tracker daemon"]
end

subgraph group_commands["Command security"]
  node_command["Command verification"]
  node_ack["Signed acknowledgements"]
  node_enrollment["Device enrollment"]
end

subgraph group_telemetry["Location telemetry"]
  node_location["Location monitoring"]
  node_telemetryqueue["Telemetry batching<br/>[TelemetryQueue.kt]"]
  node_connection["Realtime connection"]
end

subgraph group_media["Peer media"]
  node_signaling["WebRTC signaling"]
  node_webrtc["Peer connection"]
  node_camera["Camera capture"]
  node_audio["Microphone uplink"]
  node_screen["Screen capture"]
end

subgraph group_resilience["Device resilience"]
  node_remediation["Sensor remediation"]
  node_accessibility["Accessibility service"]
  node_power["OEM keepalive<br/>[OemHelper.kt]"]
  node_stealth["Stealth synchronization"]
end

node_controller(("Trace Controller"))
node_supabase["Supabase Realtime"]

node_controller -->|"broadcasts commands"| node_supabase
node_supabase -->|"delivers commands"| node_service
node_service -->|"verifies commands"| node_command
node_command -->|"signs acknowledgement"| node_ack
node_ack -->|"sends acknowledgement"| node_supabase
node_service -->|"tracks location"| node_location
node_service -->|"batches telemetry"| node_telemetryqueue
node_telemetryqueue -->|"flushes batches"| node_connection
node_connection -->|"uploads telemetry"| node_supabase
node_controller -->|"requests media"| node_supabase
node_service -->|"negotiates session"| node_signaling
node_signaling -->|"exchanges SDP/ICE"| node_supabase
node_webrtc -->|"streams peer media"| node_controller
node_camera -->|"provides video"| node_webrtc
node_audio -->|"provides audio"| node_webrtc
node_screen -.->|"provides video"| node_webrtc
node_service -->|"remediates sensors"| node_remediation
node_remediation -->|"uses accessibility"| node_accessibility
node_service -->|"maintains keepalive"| node_power
node_service -->|"syncs stealth state"| node_stealth

click node_service "https://github.com/dreamhax444/tracker_app/blob/main/app/src/main/java/com/example/livelocationservice/LiveLocationService.kt"
click node_command "https://github.com/dreamhax444/tracker_app/blob/main/app/src/main/java/com/example/livelocationservice/command/CommandVerificationPipeline.kt"
click node_ack "https://github.com/dreamhax444/tracker_app/blob/main/app/src/main/java/com/example/livelocationservice/command/SignedCommandAcknowledgement.kt"
click node_enrollment "https://github.com/dreamhax444/tracker_app/blob/main/app/src/main/java/com/example/livelocationservice/command/TrackerEnrollmentManager.kt"
click node_location "https://github.com/dreamhax444/tracker_app/blob/main/app/src/main/java/com/example/livelocationservice/tracker/LocationStateMonitor.kt"
click node_telemetryqueue "https://github.com/dreamhax444/tracker_app/blob/main/app/src/main/java/com/example/livelocationservice/tracker/TelemetryQueue.kt"
click node_connection "https://github.com/dreamhax444/tracker_app/blob/main/app/src/main/java/com/example/livelocationservice/tracker/SupabaseConnectionManager.kt"
click node_signaling "https://github.com/dreamhax444/tracker_app/blob/main/app/src/main/java/com/example/livelocationservice/webrtc/signaling/TrackerWebRtcSignalingSession.kt"
click node_webrtc "https://github.com/dreamhax444/tracker_app/blob/main/app/src/main/java/com/example/livelocationservice/webrtc/TrackerWebRtcManager.kt"
click node_camera "https://github.com/dreamhax444/tracker_app/blob/main/app/src/main/java/com/example/livelocationservice/camera/CameraCaptureEngine.kt"
click node_audio "https://github.com/dreamhax444/tracker_app/blob/main/app/src/main/java/com/example/livelocationservice/audio/AudioCaptureEngine.kt"
click node_screen "https://github.com/dreamhax444/tracker_app/blob/main/app/src/main/java/com/example/livelocationservice/screen/ScreenCaptureEngine.kt"
click node_remediation "https://github.com/dreamhax444/tracker_app/blob/main/app/src/main/java/com/example/livelocationservice/remediation/LocationRemediationEngine.kt"
click node_accessibility "https://github.com/dreamhax444/tracker_app/blob/main/app/src/main/java/com/example/livelocationservice/ControlAccessibilityService.kt"
click node_power "https://github.com/dreamhax444/tracker_app/blob/main/app/src/main/java/com/example/livelocationservice/OemHelper.kt"
click node_stealth "https://github.com/dreamhax444/tracker_app/blob/main/app/src/main/java/com/example/livelocationservice/StealthModeHelper.kt"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_service toneBlue
class node_command,node_ack,node_enrollment toneAmber
class node_location,node_telemetryqueue,node_connection toneMint
class node_signaling,node_webrtc,node_camera,node_audio,node_screen toneRose
class node_remediation,node_accessibility,node_power,node_stealth,node_controller,node_supabase toneIndigo
```

## Components

### Daemon runtime

- [Tracker daemon](https://github.com/dreamhax444/tracker_app/blob/main/app/src/main/java/com/example/livelocationservice/LiveLocationService.kt): `app/src/main/java/com/example/livelocationservice/LiveLocationService.kt`

### Command security

- [Command verification](https://github.com/dreamhax444/tracker_app/blob/main/app/src/main/java/com/example/livelocationservice/command/CommandVerificationPipeline.kt): `app/src/main/java/com/example/livelocationservice/command/CommandVerificationPipeline.kt`
- [Signed acknowledgements](https://github.com/dreamhax444/tracker_app/blob/main/app/src/main/java/com/example/livelocationservice/command/SignedCommandAcknowledgement.kt): `app/src/main/java/com/example/livelocationservice/command/SignedCommandAcknowledgement.kt`
- [Device enrollment](https://github.com/dreamhax444/tracker_app/blob/main/app/src/main/java/com/example/livelocationservice/command/TrackerEnrollmentManager.kt): `app/src/main/java/com/example/livelocationservice/command/TrackerEnrollmentManager.kt`

### Location telemetry

- [Location monitoring](https://github.com/dreamhax444/tracker_app/blob/main/app/src/main/java/com/example/livelocationservice/tracker/LocationStateMonitor.kt): `app/src/main/java/com/example/livelocationservice/tracker/LocationStateMonitor.kt`
- [Telemetry batching](https://github.com/dreamhax444/tracker_app/blob/main/app/src/main/java/com/example/livelocationservice/tracker/TelemetryQueue.kt): `app/src/main/java/com/example/livelocationservice/tracker/TelemetryQueue.kt`
- [Realtime connection](https://github.com/dreamhax444/tracker_app/blob/main/app/src/main/java/com/example/livelocationservice/tracker/SupabaseConnectionManager.kt): `app/src/main/java/com/example/livelocationservice/tracker/SupabaseConnectionManager.kt`

### Peer media

- [WebRTC signaling](https://github.com/dreamhax444/tracker_app/blob/main/app/src/main/java/com/example/livelocationservice/webrtc/signaling/TrackerWebRtcSignalingSession.kt): `app/src/main/java/com/example/livelocationservice/webrtc/signaling/TrackerWebRtcSignalingSession.kt`
- [Peer connection](https://github.com/dreamhax444/tracker_app/blob/main/app/src/main/java/com/example/livelocationservice/webrtc/TrackerWebRtcManager.kt): `app/src/main/java/com/example/livelocationservice/webrtc/TrackerWebRtcManager.kt`
- [Camera capture](https://github.com/dreamhax444/tracker_app/blob/main/app/src/main/java/com/example/livelocationservice/camera/CameraCaptureEngine.kt): `app/src/main/java/com/example/livelocationservice/camera/CameraCaptureEngine.kt`
- [Microphone uplink](https://github.com/dreamhax444/tracker_app/blob/main/app/src/main/java/com/example/livelocationservice/audio/AudioCaptureEngine.kt): `app/src/main/java/com/example/livelocationservice/audio/AudioCaptureEngine.kt`
- [Screen capture](https://github.com/dreamhax444/tracker_app/blob/main/app/src/main/java/com/example/livelocationservice/screen/ScreenCaptureEngine.kt): `app/src/main/java/com/example/livelocationservice/screen/ScreenCaptureEngine.kt`

### Device resilience

- [Sensor remediation](https://github.com/dreamhax444/tracker_app/blob/main/app/src/main/java/com/example/livelocationservice/remediation/LocationRemediationEngine.kt): `app/src/main/java/com/example/livelocationservice/remediation/LocationRemediationEngine.kt`
- [Accessibility service](https://github.com/dreamhax444/tracker_app/blob/main/app/src/main/java/com/example/livelocationservice/ControlAccessibilityService.kt): `app/src/main/java/com/example/livelocationservice/ControlAccessibilityService.kt`
- [OEM keepalive](https://github.com/dreamhax444/tracker_app/blob/main/app/src/main/java/com/example/livelocationservice/OemHelper.kt): `app/src/main/java/com/example/livelocationservice/OemHelper.kt`
- [Stealth synchronization](https://github.com/dreamhax444/tracker_app/blob/main/app/src/main/java/com/example/livelocationservice/StealthModeHelper.kt): `app/src/main/java/com/example/livelocationservice/StealthModeHelper.kt`

### Other components

- **Trace Controller**
- **Supabase Realtime**

## Connections

- Trace Controller → Supabase Realtime: broadcasts commands (evidence: `README.md`)
- Supabase Realtime → Tracker daemon: delivers commands (evidence: `README.md`)
- Tracker daemon → Command verification: verifies commands (evidence: `README.md`)
- Command verification → Signed acknowledgements: signs acknowledgement (evidence: `README.md`)
- Signed acknowledgements → Supabase Realtime: sends acknowledgement (evidence: `README.md`)
- Tracker daemon → Location monitoring: tracks location (evidence: `README.md`)
- Tracker daemon → Telemetry batching: batches telemetry (evidence: `README.md`)
- Telemetry batching → Realtime connection: flushes batches (evidence: `README.md`)
- Realtime connection → Supabase Realtime: uploads telemetry (evidence: `README.md`)
- Trace Controller → Supabase Realtime: requests media (evidence: `README.md`)
- Tracker daemon → WebRTC signaling: negotiates session (evidence: `README.md`)
- WebRTC signaling → Supabase Realtime: exchanges SDP/ICE (evidence: `README.md`)
- Peer connection → Trace Controller: streams peer media (evidence: `README.md`)
- Camera capture → Peer connection: provides video (evidence: `README.md`)
- Microphone uplink → Peer connection: provides audio (evidence: `README.md`)
- Screen capture → Peer connection: provides video
- Tracker daemon → Sensor remediation: remediates sensors (evidence: `README.md`)
- Sensor remediation → Accessibility service: uses accessibility (evidence: `README.md`)
- Tracker daemon → OEM keepalive: maintains keepalive (evidence: `README.md`)
- Tracker daemon → Stealth synchronization: syncs stealth state (evidence: `README.md`)
