Phase 5.1: kids' Android client (Accessibility block overlay + tamper alert)
Add android/, a normal Gradle/Kotlin project with its own wrapper. It blocks by interruption: an Accessibility Service watches the foreground package and a full-screen overlay covers any listed app while the device is locked (FR-16). No Device Owner, no factory reset, no managed profile. The client subscribes to the retained restrict/<device>/config topic on the 8883 TLS plane, keeps the last config on disk so a broker-less device keeps its rules (FR-14), and reports tampering on its own status topic (FR-17): a disabled service, a revoked overlay permission, or a force-stop seen on the next start. The Control Service now parses the tamper field and raises an Apprise alert, so it reaches Sam. The block path and the tamper alert are proven on the headless pixel35 emulator on .27; see android/README.md and android/tools/emu-proof.sh. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -279,3 +279,30 @@ func TestBuildConfigAllowlistIsolation(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestParseStatusTamper(t *testing.T) {
|
||||
payload := []byte(`{"online":true,"app":"com.android.settings",` +
|
||||
`"tamper":{"kind":"accessibility_disabled","detail":"service turned off",` +
|
||||
`"at":"2026-10-13T08:00:00Z"},"at":"2026-10-13T08:00:01Z"}`)
|
||||
st, err := ParseStatus(payload)
|
||||
if err != nil {
|
||||
t.Fatalf("ParseStatus: %v", err)
|
||||
}
|
||||
if !st.HasTamper() {
|
||||
t.Fatal("HasTamper = false, want true")
|
||||
}
|
||||
if st.Tamper.Kind != "accessibility_disabled" {
|
||||
t.Errorf("kind = %q", st.Tamper.Kind)
|
||||
}
|
||||
if st.Tamper.Detail != "service turned off" {
|
||||
t.Errorf("detail = %q", st.Tamper.Detail)
|
||||
}
|
||||
|
||||
plain, err := ParseStatus([]byte(`{"online":false}`))
|
||||
if err != nil {
|
||||
t.Fatalf("ParseStatus plain: %v", err)
|
||||
}
|
||||
if plain.HasTamper() {
|
||||
t.Error("plain status reported a tamper")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user