Add configurable deployment system with VPN and Tor support

Features:
- Hidden config.json in assets for per-deployment customization
- Configure target URL, app name, and branding
- Optional WireGuard VPN with auto-connect
- Optional Tor routing via Orbot
- Custom theme colors
- Configuration-driven app behavior

Configuration file location: app/src/main/assets/config.json
Example configuration: config.example.json

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-10-05 18:51:01 +01:00
parent a083606b9e
commit 94887f6cf7
9 changed files with 777 additions and 10 deletions

View File

@@ -0,0 +1,62 @@
package uk.silverlabs.silverdroid.config
import kotlinx.serialization.Serializable
/**
* Application configuration that can be customized per deployment
*/
@Serializable
data class AppConfig(
// App branding
val appName: String = "SilverDROID",
val appVersion: String = "1.0.0",
// Target URL configuration
val targetUrl: String,
val showUrlBar: Boolean = false,
val allowNavigation: Boolean = true,
// VPN configuration (optional)
val vpn: VpnConfig? = null,
// Tor configuration (optional)
val tor: TorConfig? = null,
// Theme customization
val theme: ThemeConfig = ThemeConfig()
)
@Serializable
data class VpnConfig(
val enabled: Boolean = false,
val autoConnect: Boolean = true,
val privateKey: String,
val address: String,
val dns: List<String> = emptyList(),
val peers: List<PeerConfig>
)
@Serializable
data class PeerConfig(
val publicKey: String,
val endpoint: String,
val allowedIps: List<String> = listOf("0.0.0.0/0"),
val persistentKeepalive: Int = 25
)
@Serializable
data class TorConfig(
val enabled: Boolean = false,
val autoConnect: Boolean = true,
val useBridges: Boolean = false,
val bridges: List<String> = emptyList(),
val socksPort: Int = 9050,
val controlPort: Int = 9051
)
@Serializable
data class ThemeConfig(
val primaryColor: String? = null,
val backgroundColor: String? = null,
val statusBarColor: String? = null
)