Skip to content
EstopiaPublic

About

Material 3 Expressive Android app (Shizuku) & Rust Linux daemon for zero-drain Bluetooth hotspot failover

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nudge

Nudge is a Material 3 Expressive Kotlin Android app (inspired by nsh07/Tomato and sameerasw/essentials) and companion Linux Rust daemon (nudge-daemon) that automatically enables your phone's Wi-Fi Hotspot over Bluetooth when your computer loses internet connectivity, configures and connects NetworkManager to the hotspot, and shuts the hotspot off when primary internet returns.

Features

  • Material 3 Expressive UI: Built with Jetpack Compose (MaterialExpressiveTheme, MotionScheme.expressive()), dynamic Material You colors, optional AMOLED Pitch-Black surface mode, and segmented RoundedCardContainer groups (24.dp outer corners, 4.dp inner stack corners).
  • Shizuku System Integration (No Root Required):
    • Starts and stops Wi-Fi Tethering via android.net.ITetheringConnector (ShizukuBinderWrapper), sharing mobile data or Wi-Fi just like the system Settings toggle.
    • Automatically reads your live SoftAP SSID, passphrase, and security type via android.net.wifi.IWifiManager#getSoftApConfiguration().
  • Zero Idle Battery Drain:
    • Uses a hardware-backed Bluetooth Classic RFCOMM listening socket (listenUsingRfcommWithServiceRecord) with 0% idle CPU and zero persistent WakeLocks.
    • Acquires a short-lived micro-WakeLock (max 10s) only when an incoming Bluetooth connection interrupt wakes the socket.
  • Cryptographic Multi-Computer Security:
    • Each enrolled computer has an individual 256-bit secret key (HMAC-SHA256), replay-protected challenge-response handshake, and keystream-encrypted Wi-Fi passphrase transfer.
    • Reference-counted multi-computer leases: the hotspot stays active as long as any enrolled computer holds a lease, and automatically turns off when the last computer releases its lease (or after an idle client timeout).

Quick Start (One-Command Setup & Pairing)

Run install.sh on any new Linux computer:

./install.sh

What install.sh does:

  1. Builds and installs nudge-daemon to ~/.local/bin/nudge-daemon.
  2. Unblocks and powers on your local Bluetooth controller and detects your computer's hostname and Bluetooth MAC.
  3. Automatic ADB Mode (if your phone is plugged in via USB):
    • Builds and installs the Android APK if not yet installed (--install-apk forces a fresh APK build/install).
    • Starts the Shizuku server on your phone if it isn't running yet.
    • Automatically enrolls your computer in the Nudge app, reads the generated 256-bit HMAC secret & phone Bluetooth MAC, pairs/trusts the phone in BlueZ, and saves ~/.config/nudge/config.toml (chmod 600).
    • Run completely unattended with ./install.sh --auto.
  4. Wireless / Interactive Mode (./install.sh --wireless or when no phone is connected over USB):
    • Prompts you to paste the nudge-daemon pair ... command copied from the Nudge app (Enroll New Computer → Copy Linux CLI Command) or scan for nearby Bluetooth devices and enter the credentials interactively.
  5. Verifies the live Bluetooth RFCOMM challenge-response (nudge-daemon status) and installs/starts the systemd user service (~/.config/systemd/user/nudge-daemon.service).

Manual Commands

1. Build & Install the Android App

cd android
./gradlew assembleDebug
adb install -r app/build/outputs/apk/debug/app-debug.apk

2. Build the Linux Daemon & CLI

cd linux-daemon
cargo build --release

3. Pair & Enroll a Computer

  1. Pair your Linux computer and Android phone over Bluetooth (bluetoothctl).
  2. In the Nudge Android app, tap Enroll New Computer and copy the generated command:
    nudge-daemon pair --phone-mac "AA:BB:CC:DD:EE:FF" --id "<UUID>" --secret "<64-HEX>" --name "MyLaptop"
  3. Test triggering and releasing the hotspot:
    nudge-daemon trigger
    nudge-daemon status
    nudge-daemon release
  4. Run the automatic failover daemon:
    nudge-daemon run --interval-secs 5

About

Material 3 Expressive Android app (Shizuku) & Rust Linux daemon for zero-drain Bluetooth hotspot failover

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages