zaneschepke / wgtunnel

An alternative Android client app for WireGuard VPN
https://zaneschepke.com/wgtunnel-docs
MIT License
923 stars 47 forks source link

[BUG] - Auto-tunneling on WiFi name not working #386

Open FingerlessGlov3s opened 1 month ago

FingerlessGlov3s commented 1 month ago

Describe the bug I've created a new WG tunnel, with the settings I've given the WiFi name I wish to use the tunnel on. Set as primary tunnel YES Set as mobile data tunnel NO WifiName is there with the cross on it. No regex Restart on ping fail (beta) NO

Smartphone (please complete the following information):

To Reproduce Steps to reproduce the behavior:

  1. Create WG tunnel
  2. Mark as pirmary tunnel
  3. Add Wifi name to the list
  4. Enable auto tunneling in the main app settings.
  5. Notification for auto tunnel appears

Expected behavior Auto connect to tunnel when that wifi is connected. Then disconnect once it leaves the WiFi

zaneschepke commented 1 month ago

Hello! This sounds like an issue with permissions. If you check the logs screen, do you see something that says found valid SSID?

It seems like you either do not have precise location + always allow location permission or you have location services disabled?

FingerlessGlov3s commented 1 month ago

Thanks for getting back to me.

Checked the app's permissions and showing as all the time and precise is enabled for location.

I tried exporting the logs, but its only exporting one log at a time. When I try scrolling up, it then throws me to the bottom with a new event saying that I finger swiped on the app 😅

zaneschepke commented 1 month ago

Do you have location services turned on?

You should be able to click the save floating action button and it will save a zip of logs to your downloads folder.

Yeah, I need to fix that scroll issue.😅 I'll add a fix for that.

FingerlessGlov3s commented 1 month ago

Location Services are definitely on and confirmed by using GPS in Maps app.

If go Support -> Read the logs -> Press the floating save icon, it doesn't do anything until I press a log, then when I press the save icon, it then saves that log to a txt file in Download. So is that also broken or did I do something wrong 😅

zaneschepke commented 1 month ago

I'll look into this issues with the logs export. Does the wifi name have any special characters? There is currently an issue open right now where some regex characters are causing issues.

FingerlessGlov3s commented 1 month ago

I'll look into this issues with the logs export. Does the wifi name have any special characters? There is currently an issue open right now where some regex characters are causing issues.

WiFi name was all letters and no spaces.

zaneschepke commented 1 month ago

If you get a chance to upgrade to the new version, the logs experience should be improved for the scrolling. It would then be helpful to get the logs or log message you see when your SSID changes.

FingerlessGlov3s commented 1 month ago

If you get a chance to upgrade to the new version, the logs experience should be improved for the scrolling. It would then be helpful to get the logs or log message you see when your SSID changes.

Did that version get published to the beta testers on the PlayStore? Don't want to use the APK, as I believe it stops it auto updating 😅

zaneschepke commented 1 month ago

No worries! It is in review right now for Google Play. It should be published soon!

zaneschepke commented 1 month ago

New version should now be out on Google Play.

FingerlessGlov3s commented 1 month ago

Just tested it, searched the logs for the SSID name when I changed wifi, and it doesn't appear in any of the log files I exported.

Is there any other key words to look for?

zaneschepke commented 1 month ago

The SSID name will not appear in the logs, but you will see a message saying valid SSID or invalid SSID. This will help us determine if there is a permission issue.

FingerlessGlov3s commented 1 month ago

Just toggled my wifi off and on to test, and there's no SSID in the logs I exported. Tried it twice now as well.

That's with Tunnel on untrusted wifi FALSE Tunnel on mobile data FALSE Tunnel on ethernet FALSE Restart on Ping Fail FALSE Start Auto-tunneling pressed to started it now reads Stop auto-tunneling, notification appeared

Then in the primary WG tunnel, I have the WiFi SSID listed.

AAGaming00 commented 1 month ago

Auto wifi tunneling also broke for me with the release of 3.5.3. the new dumpsys network detection says the SSID is "-"

FingerlessGlov3s commented 2 days ago

Just tested 3.6.0 still no luck. I opened the log in the app, and toggled WiFi off and on, and also switched WiFi networks via the WiFi applet in the notification area. Seeing no events to say the app even saw the WiFi change network. That's with just Auto Tunnelling Enabled.

Enabling Tunnel on untrusted WiFi, the profiles do get picked correctly and also if I put a trusted WiFi name in, it also disconnects the VPN while on that network. I can see the events happening in the logs.

So I can get the original auto WiFi feature working to auto connect on all untrusted WiFi, but I can't get it to only connect on certain WiFi names. Which you implemented back in September. As if it doesn't listen for those WiFi events unless the old setting is ticketed.

Or have I been doing this wrong and I need to use wildcards to whitelist all SSIDs, then do a invert wildcard on the WiFi networks that I don't trust?

cbrngrz commented 1 day ago

Having the same issue here. Galaxy S22 fwiw. Location services and permissions are enabled.

The auto tunneling works if using the global "on mobile data" or "untrusted wifi" options, but the specific wifi name on an individual tunnel does not work.

Edit: it appears that this only work when "tunnel on untrusted wifi" is enabled, and by not adding any wifi names to the list. It's a little inconvenient, but the workaround i found to work is by adding the wildcard to capture all * (turn on wildcards) in the list of trusted, and then exclude using ! the wifi names you wish to use specific tunnels on, and then adding those names to the individual tunnels.

Edit2: everything i mentioned above suddenly stopped working. Not basically no auto tunneling works. It's very finicky. It'll work for a while then have issues.