celzero / rethink-app

DNS over HTTPS / DNS over Tor / DNSCrypt client, WireGuard proxifier, firewall, and connection tracker for Android.
https://rethinkfirewall.com/
Apache License 2.0
2.75k stars 137 forks source link

Always-on VPN and Airplane mode #1157

Open ignoramous opened 8 months ago

ignoramous commented 8 months ago

A user writes,

What I noticed with RethinkDNS: If the "Continuously active VPN" option is active, apps such as K-9 Mail constantly try to establish a push connection - even when the device is in flight mode. The apps probably think there is still a connection to the Internet via VPN, although there definitely isn't one. This calls for a fix from RethinkDNS.

ignoramous commented 8 months ago

Thunderbird: https://github.com/thunderbird/thunderbird-android/issues/7408

Elemental: https://github.com/vector-im/element-android/issues/8359

Feeder: https://github.com/spacecowboy/Feeder/discussions/155

ignoramous commented 2 months ago

On Android 8 and below: In airplane mode (or when no network has internet), VpnService.setUnderlyingNetworks(emptyArray()) (docs) signals to apps (ex: Chrome) that there is absolutely no way to connect.

On Android 9 and above: Neither VpnService.setUnderlyingNetworks(emptyArray()) nor setting just the default gateway (but not the DNS) works.

ItsIgnacioPortal commented 2 weeks ago

For anyone interested, I'm willing to engineer fix for this for USD$30 (Not an android-system fix, but a RethinkDNS-specific fix). https://github.com/sponsors/ItsIgnacioPortal/

ignoramous commented 2 weeks ago

For anyone interested, I'm willing to engineer fix for this for USD$30 (Not an android-system fix, but a RethinkDNS-specific fix).

Thanks. Please note that it is no guarantee Rethink will merge that fix.

ItsIgnacioPortal commented 2 weeks ago

For anyone interested, I'm willing to engineer fix for this for USD$30 (Not an android-system fix, but a RethinkDNS-specific fix).

Thanks. Please note that it is no guarantee Rethink will merge that fix.

The fix I have in mind won't modify any RethinkDNS code.