Multi-Router Support

Save credentials for multiple routers and switch between them seamlessly.

WRTune supports managing multiple OpenWRT routers from a single app. Each routerโ€™s data is fully isolated.

Saving Routers ๐Ÿ”—

When logging in, enable the โ€œSave credentialโ€ checkbox (enabled by default). Your router is added to the saved routers list.

The login page shows a dropdown (โ–ผ) on the IP field to access saved routers, or tap the lock icon on the password field.

Saved Routers Sheet ๐Ÿ”—

From the login page:

  • Tap a saved router โ€” Auto-fills the form and connects with stored credentials
  • Swipe left to remove โ€” Shows confirmation dialog, then cascade-deletes all data for that router

Router Switcher ๐Ÿ”—

From the dashboard (tap the logout/power button):

  • Shows the currently connected router plus other saved routers
  • Tap another router โ€” Switches to it with auto-login using stored credentials
  • Logout โ€” Clears the current session, returns to login, keeps saved routers
  • Remove โ€” Cascade-deletes all data for that router

Data Isolation ๐Ÿ”—

Every per-router setting uses a {ip}_ prefix in SharedPreferences and FlutterSecureStorage. This means:

  • Passwords, session tokens, and credentials are scoped per router
  • Client caches, feature preferences, and settings donโ€™t mix between routers
  • Removing a router via cascade delete removes all 25+ child keys in one operation

Key Scoping Examples ๐Ÿ”—

Key PatternPurpose
{ip}_router_usernameSSH/HTTP username
{ip}_router_passwordSSH/HTTP password (SecureStorage)
{ip}_last_connectedLast login timestamp
{ip}_show_statisticsStatistics tab visibility
{ip}_adh_enabledAdGuard Home toggle
nlbwmon_installed_{ip}nlbwmon capability cache
wrtune_wol_recent_{ip}Recent WOL MACs

Legacy Migration ๐Ÿ”—

If you upgraded from an older single-router version, WRTune runs a silent migration:

  1. Reads old unscoped keys (e.g., router_ip, router_password)
  2. Copies values to new scoped keys ({old_ip}_*)
  3. Sets saved_router_ips = [old_ip], active_router_ip = old_ip
  4. Deletes old unscoped keys

Your router data is preserved and you start fresh with multi-router support enabled.