All of lore.kernel.org
 help / color / mirror / Atom feed
* Android app and command line
@ 2018-03-13  1:51 Jacob Schooley
  2018-03-16  2:38 ` Samuel Holland
  0 siblings, 1 reply; 3+ messages in thread
From: Jacob Schooley @ 2018-03-13  1:51 UTC (permalink / raw)
  To: wireguard

[-- Attachment #1: Type: text/plain, Size: 733 bytes --]

There is an option in the Android app to enable wg and wg-quick, which will
be extremely useful to me as most of my VPN stuff is taken care of with
Tasker. There are two major bugs with this however.

One is that the app doesn't automatically update the status of wireguard,
so the switch inside the app won't flip if I use wg-quick up or down until
I swipe off and reopen the app, and the quick settings toggle won't change.

The other is that if I run wg-quick up, then try to bring it down through
the app or the quick settings toggle, it says "Error bringing down tunnel:
Unable to configure tunnel (wg-quick returned 2)." So as of now it really
doesn't work well with tasker because I can't bring it down manually if I
need to.

[-- Attachment #2: Type: text/html, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Android app and command line
  2018-03-13  1:51 Android app and command line Jacob Schooley
@ 2018-03-16  2:38 ` Samuel Holland
  2018-04-14  2:03   ` Jason A. Donenfeld
  0 siblings, 1 reply; 3+ messages in thread
From: Samuel Holland @ 2018-03-16  2:38 UTC (permalink / raw)
  To: Jacob Schooley, wireguard

Hello,

On 03/12/18 20:51, Jacob Schooley wrote:
> There is an option in the Android app to enable wg and wg-quick, which will be
> extremely useful to me as most of my VPN stuff is taken care of with Tasker.
> There are two major bugs with this however.

Thanks for the report!

> One is that the app doesn't automatically update the status of wireguard, so the
> switch inside the app won't flip if I use wg-quick up or down until I swipe off
> and reopen the app, and the quick settings toggle won't change.

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.

> The other is that if I run wg-quick up, then try to bring it down through the
> app or the quick settings toggle, it says "Error bringing down tunnel: Unable to
> configure tunnel (wg-quick returned 2)." So as of now it really doesn't work
> well with tasker because I can't bring it down manually if I need to.

Hmm, that might actually be a bug. I'll look into that.

In the meantime, have you considered using Tasker to kill the app every time you
use wg-quick? Android will restart it and the quick tile will update, plus it
will refresh the state of all known tunnels within the app.

Regards,
Samuel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Android app and command line
  2018-03-16  2:38 ` Samuel Holland
@ 2018-04-14  2:03   ` Jason A. Donenfeld
  0 siblings, 0 replies; 3+ messages in thread
From: Jason A. Donenfeld @ 2018-04-14  2:03 UTC (permalink / raw)
  To: Samuel Holland; +Cc: Jacob Schooley, WireGuard mailing list

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?

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-04-14  1:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-13  1:51 Android app and command line Jacob Schooley
2018-03-16  2:38 ` Samuel Holland
2018-04-14  2:03   ` Jason A. Donenfeld

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.