Data Export & Reporting
Relevant source files
The following files were used as context for generating this wiki page:
- app/src/main/kotlin/com/shadowcheck/mobile/utils/ExportUtils.kt
- app/src/main/kotlin/com/shadowcheck/mobile/ui/screens/StatsScreen.kt
- app/src/main/kotlin/com/shadowcheck/mobile/rebuilt/ui/screens/SettingsScreen.kt
- app/src/main/kotlin/com/shadowcheck/mobile/ui/screens/settings/DatabaseStats.kt
- app/src/main/kotlin/com/shadowcheck/mobile/rebuilt/ui/screens/HeatmapScreen.kt
- app/src/main/kotlin/com/shadowcheck/mobile/rebuilt/ui/screens/NetworkDetailScreen.kt
The Data Export & Reporting system in ShadowCheck Mobile provides mechanisms for extracting, visualizing, and summarizing signals intelligence collected from WiFi, Bluetooth, and cellular networks. The system supports multiple industry-standard export formats and provides real-time database statistics and temporal analytics to assist in network surveillance and analysis.
Key reporting features include automated CSV, KML, and GeoJSON generation, as well as high-level statistical dashboards and temporal heatmaps for tracking device activity over time.
Data Export Engine
The export engine is centralized in the ExportUtils object, which provides static methods to convert database entities—WifiNetwork, BluetoothDevice, and CellularTower—into portable file formats.
Supported Export Formats
| Format | Description | Target Use Case |
|---|---|---|
| CSV | Comma-Separated Values containing ID, Signal, Frequency, and GPS. | Spreadsheet analysis and generic data processing. |
| KML | Keyhole Markup Language with categorized folders for WiFi, BT, and Cell. | Geographic visualization in Google Earth or GIS software. |
| GeoJSON | JSON-based geographic data structures. | Web mapping applications and Mapbox integration. |
Sources: app/src/main/kotlin/com/shadowcheck/mobile/utils/ExportUtils.kt:7-126, app/src/main/kotlin/com/shadowcheck/mobile/rebuilt/ui/screens/SettingsScreen.kt:137-147
Export Flow Logic
The following diagram illustrates the data flow from the local Room database through the export utility to the filesystem.
Explanation: This diagram shows the transition of network data from internal storage to external files via the ExportUtils module.
Sources: app/src/main/kotlin/com/shadowcheck/mobile/utils/ExportUtils.kt:12-113, app/src/main/kotlin/com/shadowcheck/mobile/rebuilt/ui/screens/SettingsScreen.kt:137-156
Database Reporting & Statistics
ShadowCheck provides granular reporting on database health and record counts. This is handled through dedicated UI components that query the ShadowCheckDatabase for unique and total observations.
Record Metrics
The system distinguishes between "Unique" sightings (distinct MAC addresses or Cell IDs) and "Total" observations (every instance a device was seen).
- WiFi Networks: Tracks unique SSIDs/BSSIDs and total signal snapshots.
- Bluetooth Devices: Monitors BLE and Classic Bluetooth device sightings.
- Cellular Towers: Aggregates data based on Cell ID and Operator Name.
Sources: app/src/main/kotlin/com/shadowcheck/mobile/ui/screens/StatsScreen.kt:25-45, app/src/main/kotlin/com/shadowcheck/mobile/ui/screens/settings/DatabaseStats.kt:45-75
Maintenance Reports
The DatabaseStatsScreen includes reporting on physical storage usage, including:
- Database Size: Formatted byte count of the SQLite file.
- Maintenance Actions: Reports on the removal of duplicates and database optimization (Vacuum).
Sources: app/src/main/kotlin/com/shadowcheck/mobile/ui/screens/settings/DatabaseStats.kt:85-115
Advanced Analytics & Visual Reporting
Beyond raw data extraction, the application includes visual reporting modules for temporal and signal analysis.
Temporal Heatmap
The HeatmapScreen generates a "Temporal Heatmap," which is a visual report of network activity organized by day of the week and hour of the day.
Explanation: The sequence of generating a temporal activity report based on historical signal timestamps.
Sources: app/src/main/kotlin/com/shadowcheck/mobile/rebuilt/ui/screens/HeatmapScreen.kt:47-90, app/src/main/kotlin/com/shadowcheck/mobile/rebuilt/ui/screens/HeatmapScreen.kt:180-213
Signal Strength Reporting
For individual devices, the system reports signal trends over time. The NetworkDetailScreen calculates and displays:
- Average Signal: Mean dBm across all sightings.
- Signal Range: Minimum and maximum detected signal levels.
- Trend Graph: A Canvas-based line chart representing signal fluctuations across the sighting history.
Sources: app/src/main/kotlin/com/shadowcheck/mobile/rebuilt/ui/screens/NetworkDetailScreen.kt:45-55, app/src/main/kotlin/com/shadowcheck/mobile/rebuilt/ui/screens/NetworkDetailScreen.kt:145-168
Implementation Details
CSV Export Structure
The CSV export uses a standardized header to allow for multi-type data in a single file.
// WiFi header
writer.write("Type,ID,Name,Signal,Frequency,Latitude,Longitude,Timestamp\n")
// WiFi data implementation
wifiNetworks.forEach { network ->
writer.write("WiFi,${network.bssid},${network.ssid},${network.signalLevel},${network.frequency},${network.latitude},${network.longitude},${network.timestamp}\n")
}
Sources: app/src/main/kotlin/com/shadowcheck/mobile/utils/ExportUtils.kt:18-25
Storage Formatting Utility
The reporting system uses a helper function to convert raw database bytes into human-readable strings for the Statistics UI.
Sources: app/src/main/kotlin/com/shadowcheck/mobile/ui/screens/settings/DatabaseStats.kt:156-163
Conclusion
The Data Export & Reporting module serves as the primary interface for extracting intelligence from ShadowCheck Mobile. By providing diverse export formats (CSV, KML, GeoJSON) and analytical visualizations (Heatmaps, Signal Graphs), the system enables both immediate field reporting and long-term surveillance analysis.