androidbin

package
v1.105.0-pre Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2026 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package androidbin makes Tailscale binaries work when run as raw (non-GUI app) executables on Android, such as under Termux, adb, or a rooted shell. Android denies app UIDs the NETLINK_ROUTE socket and /proc/net (Issue 2293, golang/go#40569), so net.Interfaces always fails and netmon cannot start. The Android app solves this from Java via netmon.RegisterInterfaceGetter, but a standalone binary has no Java to lean on.

This package registers a netmon fallback that reports a single synthetic interface whose addresses are discovered by asking the kernel to route an outbound UDP socket (which sends no packets and is permitted). That's enough for magicsock to discover local endpoints, though it can't see the full multi-interface picture. The fallback runs only when nothing was registered with RegisterInterfaceGetter, net.Interfaces failed, and runtime detection says the process is on Android, so it's inert on regular Linux.

It also pulls in the androiddns feature, which fixes name resolution with no /etc/resolv.conf, and points Go's CA root loader at Android's system certificate store in GOOS=linux builds (see cacerts.go), which otherwise find no roots and fail all TLS verification.

Like androiddns, the package builds on GOOS=linux as well as GOOS=android, because static linux binaries are commonly run under Android kernels. This is an optional feature, included by default in tailscaled builds on Linux and Android; build with the ts_omit_androidbin tag to omit it. It is not linked into tsnet by default; tsnet apps and other programs opt in with a blank import of this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL