chahinebrini 4a013bc43b feat(android-protection): präzise Tamper-Lock + a11y-Onboarding-Guide
Tamper-Lock von Keyword-Scanning auf präzise Einzel-Surfaces umgebaut:
blockt nur ReBreaks eigene Screens (Admin-Deaktivierung via DeviceAdminAdd,
a11y-Ausschalten, VPN-Trennen/Surface), nie Listen oder fremde Apps.

- Deny-Removal = Admin-only: OS graut Uninstall+Force-Stop für aktiven
  Device-Admin aus; einziger Bypass (Admin deaktivieren) bleibt a11y-gesperrt.
  Andere Apps verwalten/force-stoppen/deinstallieren bleibt komplett frei.
- a11y-Onboarding: passiver Bottom-Overlay-Hinweis + Settings-Reset auf
  Startseite nach Aktivierung + 1s-Delay vor App-Rückkehr.
- VPN-Trennen-Dialog + a11y-Ausschalten neu abgedeckt.
- a11y-Service-Icon im Plugin (klar als ReBreak erkennbar).

Verifiziert auf A50 per logcat: alle 4 Surfaces blocken, Listen + fremde
Apps frei, keine False-Positives.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-08 04:05:41 +02:00

124 lines
2.8 KiB
TypeScript

/**
* Web-Stub. Ergibt im Browser keinen funktionalen Schutz — der Filter ist
* inhärent device-bound. Verhindert nur dass Imports auf Web crashen.
*/
import { registerWebModule, NativeModule } from 'expo';
import type {
ActivateResult,
DeviceLayers,
DisableResult,
HealthProbeResult,
RebreakProtectionEvents,
SyncBlocklistResult,
} from './RebreakProtection.types';
class RebreakProtectionModuleWeb extends NativeModule<RebreakProtectionEvents> {
async activate(): Promise<ActivateResult> {
return { allLayersOn: false, missingLayers: [] };
}
async disable(): Promise<DisableResult> {
return { allLayersOff: true };
}
async getDeviceState(): Promise<DeviceLayers> {
return { blocklistCount: 0, blocklistLastSyncAt: null };
}
// iOS Layer 2 — webContent-Filter. Auf Web inhärent ohne Funktion.
async applyWebContentFilter() {
return { enabled: false, appliedCount: 0, region: '', error: 'web_stub' };
}
async clearWebContentFilter() {
return { cleared: false, error: 'web_stub' };
}
async syncWebContentDomains() {
return { updated: false };
}
async syncBlocklist(): Promise<SyncBlocklistResult> {
return { updated: false, count: 0 };
}
async runHealthProbe(): Promise<HealthProbeResult> {
return {
outcome: 'offline',
reason: 'web_stub',
durationMs: 0,
target: '',
};
}
async openSystemSettings(): Promise<void> {
// no-op
}
// Android-only stubs (Web nutzt keinen davon, aber Type-Compat).
async isAccessibilityEnabled() {
return { enabled: false };
}
async openAccessibilitySettings() {
return { opened: false };
}
async hasUsageAccess() {
return { granted: false };
}
async openUsageAccessSettings() {
return { opened: false };
}
async hasOverlayPermission() {
return { granted: false };
}
async openOverlayPermissionSettings() {
return { opened: false };
}
async dismissAccessibilityHint() {
// no-op
}
async openPowerDialog() {
return { opened: false };
}
async armTamperLock() {
return { armed: false };
}
async disarmTamperLock() {
return { armed: false };
}
async getProtectionStatus() {
return {
vpnEnabled: false,
accessibilityEnabled: false,
blocklistCount: 0,
tamperArmed: false,
};
}
async reconcileVpn() {
return { restarted: false };
}
async reconcileUrlFilter() {
return { recreated: false };
}
async requestDeviceAdmin() {
return { launched: false };
}
async isDeviceAdminActive() {
return { active: false };
}
async removeDeviceAdmin() {
return { removed: false };
}
async probeContentFilter() {
return { enabled: false, error: 'web_stub' };
}
async isNeFilterActive() {
return { enabled: false };
}
}
export default registerWebModule(RebreakProtectionModuleWeb, 'RebreakProtection');