f684bf696d
* android: fix quick settings tile
https://github.com/tailscale/tailscale-android/pull/358 updated the Quick Settings tile to only depend on ipn state.
This was only partially correct in the sense that we made changes to only check for whether the state was > stopped
and not whether Tailscale was on.
This checks for two states, whether Tailscale is on, and whether the tile is ready to be used. The former requires
ipn state to be >= Starting, and the latter checks whether ipn state is > RequiresMachineAuth. Tile readiness determines
whether an intent is to open MainActivity or whether an intent to connect/disconnect VPN is sent. Whether Tailscale is on
or off determines whether the tile status is active or not.
We lazily initialize App to avoid starting Tailscale when unnecessary - for example, when viewing the QuickSettings tile, there's no need to start Tailscale's backend.
We also persistently store a flag indicating whether VPN can be started by quick settings tile: this allows us to start the VPN from the quick settings tile even when the
application was previously stopped.
Updates tailscale/tailscale#11920
Co-authored-by: kari-ts <kari@tailscale.com>
Co-authored-by: Percy Wegmann <percy@tailscale.com>
* android: simplify IPNService lifecycle
Reserves use of IPNReceiver only for external requests to start the VPN.
Updates tailscale/corp#19860
Signed-off-by: Percy Wegmann <percy@tailscale.com>
* Revert "android: temporarily remove quick settings tile"
This reverts commit
|
7 months ago | |
---|---|---|
.github | 7 months ago | |
.vscode | ||
android | 7 months ago | |
libtailscale | 7 months ago | |
metadata/en-US | 7 months ago | |
scripts | ||
tool | ||
version | ||
.gitignore | 8 months ago | |
Dockerfile | ||
LICENSE | ||
Makefile | 7 months ago | |
PATENTS | ||
README.md | 7 months ago | |
eclipse-formatter.xml | ||
flake.lock | ||
flake.nix | ||
go.mod | 7 months ago | |
go.sum | 7 months ago | |
go.toolchain.rev | 8 months ago |
README.md
Tailscale Android Client
Private WireGuard® networks made easy
Overview
This repository contains the open source Tailscale Android client.
Using
Preparing a build environment
There are several options for setting up a build environment. The Android Studio path is the most useful path for longer term development.
In all cases you will need:
- Go runtime
- Android SDK
- Android SDK components (
make androidsdk
will install them)
Android Studio
- Install a Go runtime (https://go.dev/dl/).
- Install Android Studio (https://developer.android.com/studio).
- Start Android Studio, from the Welcome screen select "More Actions" and "SDK Manager".
- In the SDK manager, select the "SDK Tools" tab and install the "Android SDK Command-line Tools (latest)".
- Run
make androidsdk
to install the necessary SDK components.
If you would prefer to avoid Android Studio, you can also install an Android
SDK. The makefile detects common paths, so sudo apt install android-sdk
is
sufficient on Debian / Ubuntu systems. To use an Android SDK installed in a
non-standard location, set the ANDROID_SDK_ROOT
environment variable to the
path to the SDK.
If you installed Android Studio the tools may not be in your path. To get the
correct tool path, run make androidpath
and export the provided path in your
shell.
Code Formatting
The ktmft plugin on the default setting should be used to autoformat all Java, Kotlin and XML files in Android Studio. Enable "Format on Save".
Docker
If you wish to avoid installing software on your host system, a Docker based development strategy is available, you can build and start a shell with:
make dockershell
Nix
If you have Nix 2.4 or later installed, a Nix development environment can be set up with:
alias nix='nix --extra-experimental-features "nix-command flakes"'
nix develop
Building
make apk
make install
Building a release
Use make tag_release
to bump the Android version code, update the version
name, and tag the current commit.
We only guarantee to support the latest Go release and any Go beta or release candidate builds (currently Go 1.14) in module mode. It might work in earlier Go versions or in GOPATH mode, but we're making no effort to keep those working.
Developing on a Fire Stick TV
On the Fire Stick:
- Settings > My Fire TV > Developer Options > ADB Debugging > ON
Then some useful commands:
adb connect 10.2.200.213:5555
adb install -r tailscale-fdroid.apk
adb shell am start -n com.tailscale.ipn/com.tailscale.ipn.MainActivity
adb shell pm uninstall com.tailscale.ipn
Bugs
Please file any issues about this code or the hosted service on the tailscale issue tracker.
Contributing
under_construction.gif
PRs welcome, but we are still working out our contribution process and tooling.
We require Developer Certificate of
Origin
Signed-off-by
lines in commits.
About Us
We are Tailscale. See https://tailscale.com/company for more about us and what we're building.
WireGuard is a registered trademark of Jason A. Donenfeld.