Android app and command line
Jason A. Donenfeld
Jason at zx2c4.com
Sat Apr 14 04:03:31 CEST 2018
On Fri, Mar 16, 2018 at 3:38 AM, Samuel Holland <samuel at sholland.org> wrote:
> I've looked into this, and it is unfortunately quite difficult to do. The app
> can register to receive notification about network changes, but unfortunately
> there's no* way for the app to tell the Android connectivity service that the
> WireGuard tunnel exists, so Android can track its state. Even then, wg-quick on
> the command line wouldn't easily be able to tell the app about _new_ tunnels.
> *without using reflection to access internal framework classes.
Maybe reflection isn't so bad a solution when considering the
alternatives. But here are some other ideas:
We could actually just monitor the output of `ip monitor dev wg0` or
the like, and not get bogged down trying to wade through the java...
If you think it's possible for the android app to register some sort
of intent listening, we could make wg-quick.c broadcast it from the
command line via `am broadcast`. This might be easiest to pull off.
Upon receiving the broadcast, the app would then double check the
status of endpoints (`wg show interfaces`) and update the statuses
Interested in implementing this?
More information about the WireGuard