Settings & Preferences
Relevant source files
The following files were used as context for generating this wiki page:
- app/src/main/kotlin/com/shadowcheck/mobile/rebuilt/ui/screens/SettingsScreen.kt
- app/src/main/kotlin/com/shadowcheck/mobile/ui/screens/settings/SettingsScreen.kt
- app/src/main/kotlin/com/shadowcheck/mobile/rebuilt/ui/theme/ThemeConfig.kt
- app/src/main/kotlin/com/shadowcheck/mobile/ui/screens/settings/ThemeBuilderScreen.kt
- app/src/main/kotlin/com/shadowcheck/mobile/rebuilt/ui/screens/ComprehensiveThemeEditor.kt
- app/src/main/kotlin/com/shadowcheck/mobile/ui/screens/settings/DatabaseStats.kt
- app/src/main/kotlin/com/shadowcheck/mobile/ui/screens/settings/APIKeysScreen.kt
The Settings & Preferences module in ShadowCheck Mobile serves as the central hub for configuring application behavior, managing sensitive API credentials, and customizing the visual interface. It provides comprehensive controls for scanning intervals, map provider selection, and extensive database maintenance operations.
The system is designed with security as a priority, utilizing encrypted storage for sensitive data such as API tokens. Additionally, it features a robust theme engine that allows for granular control over the UI's appearance, ranging from simple dark mode toggles to a complex "Theme Studio" for per-element styling.
Sources: app/src/main/kotlin/com/shadowcheck/mobile/rebuilt/ui/screens/SettingsScreen.kt, app/src/main/kotlin/com/shadowcheck/mobile/ui/screens/settings/SettingsScreen.kt, app/src/main/kotlin/com/shadowcheck/mobile/ui/screens/settings/APIKeysScreen.kt
General Application Settings
General settings allow users to control how the application interacts with external services and handles background tasks.
Scanning and Map Configuration
Users can define the operational parameters for network signal collection. Key configurations include:
- Map Provider: Selection between "Mapbox" and "Google Maps" for spatial visualization.
- Scan Interval: A slider-controlled value (ranging from 1s to 10s) determining the frequency of sensor readings.
- Auto Scan: A toggle to enable or disable automated network discovery.
Sources: app/src/main/kotlin/com/shadowcheck/mobile/rebuilt/ui/screens/SettingsScreen.kt:61-96, app/src/main/kotlin/com/shadowcheck/mobile/ui/screens/settings/SettingsScreen.kt:45-66
Security and API Management
Sensitive credentials for third-party integrations (WiGLE, Mapbox, Google Maps) are managed through a dedicated interface. The application uses EncryptedSharedPreferences backed by the AndroidX Security library to ensure that API keys are stored securely on the device.
The diagram shows the secure flow of API key data from user input to encrypted storage.
Sources: app/src/main/kotlin/com/shadowcheck/mobile/rebuilt/ui/screens/SettingsScreen.kt:338-350, app/src/main/kotlin/com/shadowcheck/mobile/ui/screens/settings/APIKeysScreen.kt:130-155
Data Management and Maintenance
The application provides extensive tools for maintaining the local SQLite database, which tracks WiFi, Bluetooth, and cellular signals.
Database Operations
The system supports several maintenance tasks to ensure data integrity and storage efficiency:
- Database Statistics: Displays record counts for different network types and total database file size.
- Maintenance: Includes "Remove Duplicates" (optimization) and "Vacuum" (physical database reorganization).
- Purge Operations: Options to delete records lacking GPS coordinates or to perform a full "Clear All Data" wipe.
| Operation | Action | Target Data |
|---|---|---|
| Purge Sensor Data | database.sensorReadingDao().deleteAll() | Sensor readings only |
| Remove Duplicates | Optimization routine | Duplicate network records |
| Clear All Data | Full wipe | WiFi, BT, Cellular, Sightings |
Sources: app/src/main/kotlin/com/shadowcheck/mobile/rebuilt/ui/screens/SettingsScreen.kt:140-184, app/src/main/kotlin/com/shadowcheck/mobile/ui/screens/settings/DatabaseStats.kt:50-134
Export and Import
ShadowCheck supports interoperability with other SIGINT tools through standard data formats:
- Export: Supports CSV, KML, and GeoJSON formats for spatial analysis.
- Import: Specific support for WiGLE CSV data and general WiGLE database files.
Sources: app/src/main/kotlin/com/shadowcheck/mobile/rebuilt/ui/screens/SettingsScreen.kt:195-217, app/src/main/kotlin/com/shadowcheck/mobile/ui/screens/settings/SettingsScreen.kt:111-120
Visual Customization and Theming
The system features an advanced "Theme Studio" that allows real-time UI modification.
Theme Configuration Architecture
The ThemeConfig class acts as the central data structure, storing everything from primary colors to individual icon selections. These configurations are persisted in a dedicated theme_config SharedPreferences file.
The diagram illustrates the relationship between the global theme configuration and specific element styles.
Sources: app/src/main/kotlin/com/shadowcheck/mobile/rebuilt/ui/theme/ThemeConfig.kt:15-115
Comprehensive Theme Editor
The ComprehensiveThemeEditor provides a multi-tabbed interface for adjusting specific UI categories:
- Colors: Primary, Accent, Surface, Background, Error, and Text colors.
- Buttons/Cards: Corner radii, elevations, padding, and border widths.
- Typography: Heading, Body, and Caption sizes.
- Icons: Selection of specific icons for WiFi, Bluetooth, Cellular, etc.
- Elements: Per-screen customization for Home Cards, List Cards, and Sidebars.
The editor includes a Live Preview panel that reflects changes immediately using the LivePreview Composable.
Sources: app/src/main/kotlin/com/shadowcheck/mobile/rebuilt/ui/screens/ComprehensiveThemeEditor.kt:53-85, app/src/main/kotlin/com/shadowcheck/mobile/ui/screens/settings/ThemeBuilderScreen.kt:47-120
Summary
The Settings & Preferences module provides the infrastructure necessary for both the operational efficiency of the network scanner and the personalization of the user interface. By combining secure storage for API keys with detailed database maintenance tools and an extensive theme engine, the module ensures the application remains functional, secure, and adaptable to user needs.