Repository navigation
feat: target Android 17 and ask for local network access - #6977
Conversation
📱 QA build
The QA build installs alongside a released Nextcloud app, so you can keep Downloading the file requires a GitHub account, so open this link on the |
4bb0c96 to
07697ce
Compare
07697ce to
33e7a54
Compare
262e31b to
1c87541
Compare
|
from claude (did not have a look myself yet): |
1c87541 to
ac79fde
Compare
|
Thanks @mahibi, I checked each point against the code. The fixes are folded into a15c1c7 (
Checks: full gplay unit suite (1341 tests, 0 failures), ktlint, detekt, and lint (still 13 warnings). |
ac79fde to
ea613ee
Compare
|
Point 5 is now fully covered, in 35b6502 (
Checks: unit tests (1343, 0 failures), ktlint, detekt, lint (still 13 warnings). The branch is rebased on current master. |
|
taking over |
Apps targeting API 37 need ACCESS_LOCAL_NETWORK to reach the local network. Without it, a request to a server on the LAN never reaches it and times out after 45 s with no hint about a permission. Ask for it where it matters, and only on Android 17 and later: - on server selection, and for a scanned login QR code, when the server is a .local name or resolves to a private, link-local, CGNAT or unique local address - when the conversation list opens, for the current account, so existing accounts and servers that only resolve locally at home are covered too - on the first call, so peers on the same network can connect directly; calls still work through TURN without it, so a denial is not asked again When the permission is denied, a dialog explains why it's needed and offers to ask again, or to open the app settings once the system no longer shows its prompt. While the app targets API 36 the permission is granted implicitly through INTERNET, so nothing is asked before the targetSdk bump. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Verified on an Android 17 emulator with generic and gplay builds: local network access, voice messages and calls in the background, picture-in-picture, incoming calls on the lock screen and from the heads-up notification, push delivery, contact sync, Certificate Transparency against a public server, and the Robolectric tests on SDK 37. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
8b97998 to
796e2a0
Compare
|
I was not able to test as currently i have problems to run Android Studio Emulators. |
Raises
targetSdkfrom 36 to 37 (lintOldTargetApi, 14 → 13) and adds what Android 17 needs for that: the local network permission. Without it, a server on the LAN is unreachable: requests time out after 45 s with no hint about a permission (verified on an Android 17 emulator).📡 Local network permission (
ACCESS_LOCAL_NETWORK)Asked only on Android 17+, and only where it matters:
.localname or resolves to a private, link-local, CGNAT or unique local address. The resolved address is checked, not just the URL, so LAN host names are covered.When it's denied, a dialog explains why it's needed and offers to ask again, or to open the app settings once the system no longer shows its prompt (after two denials). Dismissing it on server selection shows an error instead of running into the timeout. Chrome asks for its own Nearby devices permission during browser login for a LAN server; there's deliberately no warning for that for now.
Servers besides Nextcloud: the conversation list also checks the account's high-performance backend (HPB) signaling server, which the chat connects to. A call checks the signaling, STUN and TURN servers from its signaling settings before connecting to them. So an HPB or TURN server on the LAN behind a public Nextcloud URL is covered. Not covered: a server reached over a VPN (e.g. Tailscale's
100.64.0.0/10) needs no permission, but is still asked for, because only the address is checked.Verified on the Android 17 emulator (gplay build of this branch,
RESTRICT_LOCAL_NETWORKenforced, server on10.0.2.2):run-as, app in the foreground) to10.0.2.2:8081times out after 8 s with the permission revoked and returns200 OKwith it granted. A request to the public1.1.1.1:80succeeds either way.cloud.nextcloud.com) and the permission denied: no prompt, browser login opens.ServerSelectionActivity.serverFromQr, unit-tested for both QR formats (nc://login/,nc://onetime-login/) and any element order, and then goes through the same check as a typed URL.🔍 Rest of the Android 17 changes
Checked against the codebase and on an Android 17 emulator (API 37, generic and gplay builds at target 37); no code change needed:
ContactsContractcolumn removal: contact sync still finds and updates linked contacts.🖼️ Screenshots
🚧 TODO
connectedAndroidTeston an API 37 emulator (gplay debug, 51 tests passed;LoginITandShareUtilsITare@Ignored in the code)🏁 Checklist
/backport to stable-xx.x🤖 AI (if applicable)