AdguardTeam / AdguardForAndroid

Open bug tracker for Android version of AdGuard.
https://adguard.com/
1.22k stars 86 forks source link

Firewall incorrectly determines active network: Wi-Fi or LTE #4925

Open VladisLoveZh opened 10 months ago

VladisLoveZh commented 10 months ago

Please answer the following questions for yourself before submitting an issue.

AdGuard version

4.1

Environment

- OS:any
- Device:any
- Firmware:any

Root access

What filters do you have enabled?

AdGuard Base filter

What Stealth Mode options do you have enabled?

Hide your search queries

Issue Details

Steps to reproduce:

  1. Configure AdGuard Firewall
  2. Enable Wi-Fi and Cellular network, (Android system will use Wi-FI)
  3. Disable cellular connection for a particular app
  4. Launch the app
  5. Firewall with use Cellular network for the app
  6. App won't connect despite Wi-FI is allowed to use and actually ON

Expected Behavior

Firewall correctly determines the network type: Wi-FI or cellular, and uses them accordingly as per Firewall settings.

Actual Behavior

AdGuard's Firewall unable to determine the network type if both Wi-FI and Cellular are on, hence, wrong firewall rule is applied for an app

Screenshots

Screenshot 1:

Additional Information

CRM ticket: 771438

nlbwqmz commented 1 month ago

I have the same issue with my android phone.

nlbwqmz commented 1 month ago

I thought it would be possible to raise the priority of the issue, which caused the user to become pointless to connect to wifi and had to turn off the firewall.

nlbwqmz commented 4 weeks ago

Is there any progress on this issue? I think the firewall function is very good, but it would be a pity if it can't be used because of this problem.

TPS commented 3 weeks ago

I can run my devices exclusively on wifi (though I have LTE & 5g available), so might need more app/device/ROM/OS details. The info filled out above (as any/any) is clearly wrong & unhelpful.

nlbwqmz commented 3 weeks ago

Sorry, let me add.

Looking forward to your good news!

TPS commented 3 weeks ago

Sorry, let me add.

  • AdGuard version: v4.5 Nightly 6
  • OS version: ColorOS 14.0.0.800 (Android 14)
  • Device: OnePlus ace 2 pro

Looking forward to your good news!

Interestingly, I run successfully on stock 1+ N200 5g on Android 12, so quite similar, but I'm wondering if it's an 1+ OS version update thing. My most current device runs Android 14 sucessfully as well, but isn't 1+.

nlbwqmz commented 3 weeks ago

Can you help analyze the logs? Starting at 11:25 on June 11th, I reproduced this operation (using Bilibili app as an example, the same is true for other apps).

  1. The wifi and mobile network are turned on at the same time
  2. Turn on the firewall (default configuration, no custom configuration)
  3. open bilibili app
  4. Firewall logs show that Bilibili is using a mobile network(Expect to use wifi)
  5. Turn off the mobile network
  6. refresh bilibili app
  7. Firewall logs show that Bilibili is using WiFi
  8. Add custom firewall settings: prohibit Bilibili from using the mobile network and prohibit Bilibili from using the mobile network when the screen is off
  9. Bilibili cannot connect to the Internet adguard_logs_4.5.22_1106_112646.zip
nlbwqmz commented 2 weeks ago

Excuse me, is this issue being dealt with?

lancelotly commented 2 weeks ago

The same issue as @nlbwqmz . I'm on Xiaomi venus, running Android 14, with security_patch = 2024-05-05. IPv6 is supported on my WiFi. I saw that during the network change in the final, the type changed to "network type: Any" according to the log. Maybe this caused the issue? 🤔

18:36:51.836 [connectivity-state-update-pool-11-thread-1] INFO  w.d - Network info changed, old: [internet state: Available, network type: Cellular, tethering: false, roaming: false], new: [internet state: Available, network type: Any, network name: null, roaming: false]
...
18:37:23.703 [connectivity-state-update-pool-11-thread-1] INFO  w.d - Network info changed, old: [internet state: Available, network type: Any, network name: null, roaming: false], new: [internet state: Available, network type: WiFi, networkName: null]
...
18:37:23.738 [DefaultDispatcher-worker-5] INFO  Protection Manager - Parameters from DNS filtering are not the same, let's restart the DNS Proxy
...
18:39:54.555 [connectivity-state-update-pool-11-thread-1] INFO  w.d - Network info changed, old: [internet state: Available, network type: WiFi, networkName: null], new: [internet state: Available, network type: Any, network name: null, roaming: false]

cellularToWiFi-Android14.log

P.S., in the "Rethink" DNS app, it has a feature to toggle "Use all available networks". image