Skip to content

Add permission for local network access and request it at API 37 - #1527

Open
Matapii wants to merge 5 commits into
wallabag:masterfrom
Matapii:android-17-issue
Open

Add permission for local network access and request it at API 37#1527
Matapii wants to merge 5 commits into
wallabag:masterfrom
Matapii:android-17-issue

Conversation

@Matapii

@Matapii Matapii commented Jul 22, 2026

Copy link
Copy Markdown

Related to issue #1516

Add permission for local network access and request it at API 37. Tested successfully on Pixel 7.

Would be happy if the change makes it to master to make the app working again on Android 17.

@Matapii
Matapii marked this pull request as ready for review July 22, 2026 20:12
@tcitworld

Copy link
Copy Markdown
Member

Can't we ask for it only if needed if the endpoint is in the local network ?

@tcitworld
tcitworld requested a review from Strubbl July 23, 2026 07:06
@Strubbl

Strubbl commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

I added some code to test if the URL of wallabag is in the local network and only then request that permission. I have no Android 17 device, so it would be nice if someone could test this change.

@Matapii

Matapii commented Jul 23, 2026

Copy link
Copy Markdown
Author

I added some code to test if the URL of wallabag is in the local network and only then request that permission. I have no Android 17 device, so it would be nice if someone could test this change.

If you do not want to build it by yourself, this is my debug build if you want to test this: app-debug.apk.zip

Thanks for the update. I have tested the changes on an Pixel 7. After installing the app and immediately after the initial launch of it, the app is asking for the permission. I suppose this is not the intended behavior, maybe the default value of the URL in the settings is triggering this behavior.

However, after granting the permission the app works again on Android 17.

…d not directly at start with the default URL
@Strubbl

Strubbl commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Yes, thanks for testing. Good point. The URL default is only "https://" which might lead to the permission request trigger (InetAddress.getAllByName("") with empty string resolves to localhost https://docs.oracle.com/javase/8/docs/api/java/net/InetAddress.html#getAllByName-java.lang.String-). I move the check to the end of the configuration, when the config is okay.

@Matapii

Matapii commented Jul 23, 2026

Copy link
Copy Markdown
Author

I have tested #1527 (comment). Good news is that the app is now starting up without asking for the permission right away. But the app is also not asking for it during the connection setup procedure, so that the original issue occurs. Nevertheless, the permission can be activated manually via android settings.

@Strubbl

Strubbl commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Strange, it should ask right after the setup procedure, when the configuration is ok, see MainActivity.java line 957.

Android 🙈

@Strubbl

Strubbl commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

I decoupled the check from the connection wizard/config dialog. If it still does not work reliably, maybe you have got an idea?

app-debug.apk.zip

@Matapii

Matapii commented Jul 24, 2026

Copy link
Copy Markdown
Author

Added the check into ConnectionWizardActivity.java‎ and verified that android permission dialog pops up during the connection wizard. After allowing the local connection, the app is able to connect and sync. Pls let me know if this is the correct place or whether there are any other blockers for the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants