Development discussion of WireGuard
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Samuel Holland <samuel@sholland.org>
Cc: Jacob Schooley <jacob.schooley+wgvpn@gmail.com>,
	WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: Re: Android app and command line
Date: Sat, 14 Apr 2018 04:03:31 +0200	[thread overview]
Message-ID: <CAHmME9rdmJvTyr-mGRUaZK=NmRMqPt4-W6AjybD4UH9Q=wGGow@mail.gmail.com> (raw)
In-Reply-To: <2598be63-11f3-1e91-a52a-f82f47274eed@sholland.org>

On Fri, Mar 16, 2018 at 3:38 AM, Samuel Holland <samuel@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
accordingly.

Interested in implementing this?

      reply	other threads:[~2018-04-14  1:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-13  1:51 Jacob Schooley
2018-03-16  2:38 ` Samuel Holland
2018-04-14  2:03   ` Jason A. Donenfeld [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHmME9rdmJvTyr-mGRUaZK=NmRMqPt4-W6AjybD4UH9Q=wGGow@mail.gmail.com' \
    --to=jason@zx2c4.com \
    --cc=jacob.schooley+wgvpn@gmail.com \
    --cc=samuel@sholland.org \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).