#!/system/bin/sh # ============================================================ # Focus Mode Configuration # ============================================================ # IMPORTANT: You MUST set HOME_LAT and HOME_LON in config_secrets.sh # before deploying. # Get them from Google Maps: right-click your apartment → coords # ============================================================ # --- Home location (loaded from config_secrets.sh, not tracked by git) --- SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" . "$SCRIPT_DIR/config_secrets.sh" # --- Radius in meters --- export RADIUS=150 # --- Hysteresis buffer in meters (prevents rapid toggling at boundary) --- export HYSTERESIS=30 # --- Location check interval in seconds --- # When focus mode is ON (at home): check very frequently for near-instant # detection of leaving home (phone is charging anyway). # When focus mode is OFF (away): check less often to save battery. export CHECK_INTERVAL_FOCUS=10 export CHECK_INTERVAL_NORMAL=120 # --- Log file --- export LOG_FILE="/data/local/tmp/focus_mode/focus_mode.log" export LOG_MAX_LINES=500 # --- State file (tracks which apps were disabled by focus mode) --- STATE_DIR="/data/local/tmp/focus_mode" export DISABLED_APPS_FILE="$STATE_DIR/disabled_by_focus.txt" export MODE_FILE="$STATE_DIR/current_mode.txt" # ============================================================ # WHITELISTED APPS # These apps will ALWAYS remain enabled, even in focus mode. # Package names verified against installed packages on 2026-02-22. # ============================================================ export WHITELIST=" # --- User-requested productive apps --- com.stronglifts.app com.ichi2.anki com.metrolist.music com.kuhy.pomodoro_app # --- Google system apps (add by name even though they show as system) --- com.google.android.apps.maps com.google.android.calendar # --- Notes & productivity --- net.cozic.joplin # --- Navigation & transit (needed when going out) --- net.osmand de.schildbach.oeffi com.kolejeslaskie.mss # --- Banking (must always work) --- pl.mbank pl.pkobp.iko # --- Security & root tools (must always work) --- com.topjohnwu.magisk moe.shizuku.privileged.api me.phh.superuser com.beemdevelopment.aegis com.azure.authenticator oracle.idm.mobile.authenticator com.kunzisoft.keepass.libre # --- Email & communication --- com.microsoft.office.outlook com.google.android.gm ch.protonmail.android com.microsoft.teams # --- Manga reader --- eu.kanade.tachiyomi.sy # --- Development --- com.github.android " # ============================================================ # BLOCKED SYSTEM APPS # System apps that should be disabled in focus mode. # These are NOT covered by third-party package blocking. # ============================================================ export BLOCKED_SYSTEM_APPS=" # --- Browsers --- com.android.chrome com.chrome.beta com.chrome.dev com.chrome.canary com.sec.android.app.sbrowser com.opera.browser com.opera.mini.native com.brave.browser com.vivaldi.browser com.microsoft.emmx com.kiwibrowser.browser com.duckduckgo.mobile.android " # --- System / essential packages that must NEVER be disabled --- # These are matched as prefixes (startswith). # You generally don't need to edit this list. export SYSTEM_NEVER_DISABLE=" com.android.launcher com.android.launcher3 com.android.settings com.android.systemui com.android.phone com.android.dialer com.android.contacts com.android.mms com.android.messaging com.android.providers com.android.inputmethod com.android.shell com.android.packageinstaller com.android.permissioncontroller com.android.bluetooth com.android.nfc com.android.wifi com.android.certinstaller com.android.vpndialogs com.android.se com.android.emergency com.android.camera com.android.camera2 com.android.documentsui com.android.externalstorage com.android.keychain com.android.location com.android.networkstack com.android.captiveportallogin com.google.android.gms com.google.android.gsf com.google.android.ext.services com.google.android.ext.shared com.google.android.webview com.google.android.trichromelibrary com.google.android.inputmethod.latin com.google.android.setupwizard com.google.android.packageinstaller com.google.android.permissioncontroller com.google.android.deskclock com.google.android.dialer com.google.android.contacts com.google.android.apps.messaging android com.mediatek com.qualcomm "