net: request local network access for on-link servers

Android 17 blocks apps targeting API 37 from reaching directly connected
addresses without ACCESS_LOCAL_NETWORK, and a blocked TCP connect is
indistinguishable from a dead server. Resolve the configured host, check
it against the active network's link addresses, and ask for the
permission only when the server is actually on-link, so routed RFC1918
and VPN destinations do not trigger a prompt.
This commit is contained in:
austinried
2026-11-14 12:08:02 +00:00
parent d76f236f59
commit db3a797a5c
11 changed files with 282 additions and 16 deletions
+4
View File
@@ -289,6 +289,10 @@
<string name="delete_server_body">%1$s and its downloaded songs will be removed from this device.</string>
<string name="connection_ok">Connection OK</string>
<string name="connection_token_fallback">Server does not support token auth; using the password instead</string>
<string name="local_network_permission_title">Allow local network access</string>
<string name="local_network_permission_body">Android blocks apps from reaching devices on your local network until you allow it. Your server is on this network, so Subtracks needs the Nearby devices permission to sync and play. Allow it on the next prompt.</string>
<string name="local_network_permission_continue">Continue</string>
<string name="local_network_permission_denied">Local network access is blocked. Allow Nearby devices for Subtracks in Android settings to reach this server.</string>
<string name="connection_failed">Failed: %1$s</string>
<string name="save_failed">Could not save: %1$s</string>
<string name="active_server_delete_error">The active server can\'t be deleted; switch to another server first</string>