From aac709ec418893405743d09ddf0cfb112f9e4033 Mon Sep 17 00:00:00 2001 From: chahinebrini Date: Mon, 11 May 2026 16:59:58 +0200 Subject: [PATCH] =?UTF-8?q?fix(android):=20forceDisable=20disarms=20the=20?= =?UTF-8?q?tamper-lock=20=E2=80=94=20protection=20stayed=20enforced=20afte?= =?UTF-8?q?r=20cooldown?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the cooldown elapsed and forceDisable() stopped the VPN, the tamper_armed SharedPref flag was left set → the AccessibilityService kept enforcing protection (e.g. blocked the user from turning the a11y service off in system Settings) → the user couldn't actually get out of protection despite the cooldown elapsing. forceDisable() now calls disarmTamperLock() before disable(). Co-Authored-By: Claude Opus 4.7 (1M context) --- apps/rebreak-native/lib/protection.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/rebreak-native/lib/protection.ts b/apps/rebreak-native/lib/protection.ts index 9895b82..e9d7912 100644 --- a/apps/rebreak-native/lib/protection.ts +++ b/apps/rebreak-native/lib/protection.ts @@ -129,8 +129,17 @@ export const protection = { return RebreakProtection.activateFamilyControls(); }, - /** Schaltet alle Layer ab. NUR aufrufen wenn JS-Layer Cooldown verifiziert. */ - forceDisable() { + /** Schaltet alle Layer ab + disarmed den Tamper-Lock. NUR aufrufen wenn JS-Layer Cooldown verifiziert. */ + async forceDisable() { + // Tamper-Lock ZUERST disarmen — sonst setzt der AccessibilityService den Schutz + // nach dem Cooldown weiter durch (blockt z.B. das Ausschalten des a11y-Service in den + // System-Settings) → der User kommt nicht aus dem Schutz raus, obwohl der Cooldown + // abgelaufen ist. (Android-Bug-Fix.) + try { + await RebreakProtection.disarmTamperLock(); + } catch (e) { + console.warn("[protection] disarmTamperLock failed:", e); + } return RebreakProtection.disable(); },