Commit Graph

17 Commits (1b42117791266251b41959fc18e6c6215a85f739)

Author SHA1 Message Date
kari-ts 1b42117791
use network callback to update DNS config when network changes (#147)
* use network callback to update DNS config when network changes

-Use requestNetwork, which gets the best network matching the passed in network request, to listen for changes to network and cache DNS config
-Call netmon.InjectEvent on network change to indicate a change
Follow-up will fix issue in netmon where IsMajorChangeFrom doesn't identify major changes when a network is added

Fixes #10107

* use network callback to update DNS config when network changes

-Use requestNetwork, which gets the best network matching the passed in network request, to listen for changes to network and cache DNS config
-Call netmon.InjectEvent on network change to indicate a change
Follow-up will fix issue in netmon where IsMajorChangeFrom doesn't identify major changes when a network is added

Updates tailscale/tailscale/#10107

hi

* hi

* .

* use network callback to update DNS config when network changes

-Use requestNetwork, which gets the best network matching the passed in network request, to listen for changes to network and cache DNS config
-Call netmon.InjectEvent on network change to indicate a change
Follow-up will fix issue in netmon where IsMajorChangeFrom doesn't identify major changes when a network is added

Updates tailscale/tailscale/#10107

* fixed missing connectivity manager
5 months ago
James Tucker 8e748afc47 android: update Android Gradle Plugin as recommended by Android Studio
Updates #cleanup
10 months ago
Brett Jenkins eb9599540c
Add intents (#87)
IPNReceiver: Add intents to connect and disconnect VPN

Added a new class IPNReceiver to listen to intents silently and connect and disconnect the VPN. This uses workers to avoid doing too much in the IPNReceiver which is to be avoided according to documentation.

Also includes a fix for vpn occasionally not starting. Think this was due to a race condition, but now only sets autoConnect to false when we know a connection is connecting or connected.

Fixes https://github.com/tailscale/tailscale/issues/3547
Updates https://github.com/tailscale/tailscale/issues/2481

Signed-off-by: Brett Jenkins <brett@brettjenkins.co.uk>
1 year ago
Denton Gentry d0c45c1de1 Revert "IPNReceiver: Add intents to connect and disconnect VPN (#84)"
Reverting according to discussion in
https://github.com/tailscale/tailscale/issues/3547#issuecomment-1465035410

This reverts commit 51a53e5472.
1 year ago
Brett Jenkins 51a53e5472
IPNReceiver: Add intents to connect and disconnect VPN (#84)
* IPNReceiver: Add intents to connect and disconnect VPN

Added a new class IPNReceiver to listen to intents silently and connect and disconnect the VPN
Also removed unneeded comment

Fixes: https://github.com/tailscale/tailscale/issues/3547

Signed-off-by: Brett Jenkins <brett@brettjenkins.co.uk>
1 year ago
Denton Gentry ac5e24a63d
build.gradle: update to SDK31 (#68)
Required for apps to update in the Play Store after November 1.

This requires:
- manifest must specify if Intents are exported.
- PendingIntent must declare FLAG_IMMUTABLE or MUTABLE

Signed-off-by: Denton Gentry <dgentry@tailscale.com>

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2 years ago
Brad Fitzpatrick 9101d9adc4 android: try to add a Android TV Leanback launcher icon
Maybe it works on Android TV, but this doesn't work on a Fire Stick.

Updates tailscale/tailscale#4179

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2 years ago
Aman Karmani d9c64011f5 android: make apk android tv compatible 2 years ago
Denton Gentry 5c9cec0064 retrieve current DNS servers.
Add getDnsConfigAsString() to retrieve the current DNS
configuration from the Android platform. This implements
several mechanisms to retrieve DNS information, suitable
for different Android versions:

Android 7 and later use ConnectivityManager getAllNetworks(),
then iterate over each network to retrieve DNS servers and
search domains using the LinkProperties.

Android 6 and earlier can only retrieve the currently active
interface using ConnectivityManager getActiveNetwork(), but have
two additional fallback options which leverage the system
properties available in older Android releases.

--------

Also changed how LinkChange notification works, switching from
the older BroadcastReceiver of a ConnectivityManager Intent to
the newer ConnectivityManager.registerNetworkCallback. We need
this because the onAvailable event is too early, we get notified
that LTE is up before its DNS servers have been set. We need
to wait for the onLinkPropertiesChanged event instead, which is
only available with registerNetworkCallback.

Fixes https://github.com/tailscale/tailscale/issues/2116
Updates https://github.com/tailscale/tailscale/issues/988

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
3 years ago
Elias Naur 84b484a954 android,cmd/tailscale: implement taildrop receive for Android < 10
Fixes tailscale/tailscale#2720
Fixes tailscale/tailscale#2296

Signed-off-by: Elias Naur <mail@eliasnaur.com>
3 years ago
Elias Naur 10ded1bad2 cmd/tailscale,java: implement file sharing
Fixes tailscale/tailscale#1809

Signed-off-by: Elias Naur <mail@eliasnaur.com>
3 years ago
Elias Naur 71a9bd537c com/tailscale/ipn,AndroidManifest.xml: make quick tile service passive
Active mode is more efficient, but otherwise equivalent to passive mode.
However, some Android versions don't implement active mode reliably. See
also

https://stackoverflow.com/questions/58035971/tileservice-requestlisteningstate-not-working-on-android-q-couldnt-find-tile-f
https://issuetracker.google.com/issues?q=requestListeningState

I can reproduce issue 1225 on an Android 10 emulator, but no longer with
this change applied.

For tailscale/tailscale#1225

Signed-off-by: Elias Naur <mail@eliasnaur.com>
3 years ago
Elias Naur 6eeb9d8ac4 AndroidManifest.xml: disable auto-backup of (encrypted) app data
Android 6.0 and later automatically backs up app data and allow the user
to restore it when setting up a new device. Unfortunately, the app data
is encrypted with a device specific master key, rendering the data
unreadable on the second device.

Apply the allowBackup=false hammer since we only store device-specific
(logs) and sensitive (private keys, authentication tokens) data for now.

Fixes tailscale/tailscale#732

Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur bae9b8394a android: add quick setting tile support
Fixes tailscale/tailscale#516

Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur 68834683ad AndroidManifest.xml: disable ChromeOS input emulation
Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur eb6c345667 android: mark the Activity prepared for multi-window configration changes
Updates tailscale/tailscale#431 (improves ChromeOS resizing)

Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur 5109987e18 all: initial commit
Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago