feat: quatre modes réseau distincts (liste noire explicite)

Le serveur distingue désormais open / blocklist / allowlist / cut. La liste
noire (services bloqués par le DNS) devient un mode à part entière et ne
s'applique plus que dans ce mode. DataControl affiche le libellé du nouveau
mode sur le tableau de bord, la notification et le journal.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R9CBCVP5oDu2sfoYPisNCQ
This commit is contained in:
tuxgyverandClaude Opus 4.8 committed 2026-10-25 21:50:36 +01:00
1 parent c66302a2bd
commit 665d6e2cb3
7 files changed
+13 -4

No files matched your search

@@ -248,6 +248,7 @@ class AppGuardService : AccessibilityService() {
return when (snap.serverMode) {
"cut" -> "BLOQUÉ (Internet coupé par le serveur) [$net]" to true
"allowlist" -> "LIMITÉ (liste blanche du serveur) [$net]" to true
"blocklist" -> "filtré (liste noire du serveur) [$net]" to false
else -> "filtré par le serveur (accès libre) [$net]" to false
}
}
@@ -166,7 +166,8 @@ class DataMonitorService : LifecycleService() {
val dataState = when {
!settings.controlEnabled -> if (percent >= WARNING_THRESHOLD) DataState.WARNING else DataState.OK
settings.serverMode != "open" -> DataState.CUT
// « blocklist » laisse tout passer (sauf la liste noire DNS) : traité comme « open », pas comme coupé.
settings.serverMode == "allowlist" || settings.serverMode == "cut" -> DataState.CUT
latestTransport == NetworkTransport.WIFI -> DataState.WIFI
percent >= WARNING_THRESHOLD -> DataState.WARNING
else -> DataState.OK
@@ -295,6 +296,7 @@ class DataMonitorService : LifecycleService() {
val modeLabel = when (snapshot.serverMode) {
"cut" -> getString(R.string.mode_cut)
"allowlist" -> getString(R.string.mode_allowlist)
"blocklist" -> getString(R.string.mode_blocklist)
else -> getString(R.string.mode_open)
}
val (emoji, stateLabel, color) = when {
@@ -211,6 +211,7 @@ fun DashboardScreen(systemActions: SystemActions) {
val modeText = when (snapshot.serverMode) {
"cut" -> stringResource(R.string.mode_cut)
"allowlist" -> stringResource(R.string.mode_allowlist)
"blocklist" -> stringResource(R.string.mode_blocklist)
else -> stringResource(R.string.mode_open)
}
val tunnelText = when {
+1
View File
@@ -127,6 +127,7 @@
<string name="family_guard_enable">Activer le service</string>
<!-- v0.2 : tunnel WireGuard et serveur familyd -->
<string name="mode_open">Accès libre</string>
<string name="mode_blocklist">Liste noire (certains services bloqués)</string>
<string name="mode_allowlist">Liste blanche seulement</string>
<string name="mode_cut">Internet coupé</string>
<string name="dashboard_tunnel">Tunnel</string>