wireguard.lists.zx2c4.com archive mirror
 help / color / mirror / Atom feed
* [Android] Wireguard on the Amazon FireTV stick
@ 2019-01-08 10:26 Christophe-Marie Duquesne
  2019-01-08 10:47 ` Kalin KOZHUHAROV
  0 siblings, 1 reply; 5+ messages in thread
From: Christophe-Marie Duquesne @ 2019-01-08 10:26 UTC (permalink / raw)
  To: wireguard


[-- Attachment #1.1: Type: text/plain, Size: 2009 bytes --]

Hi there,

I tried to run Wireguard on the FireTV stick. The only other relevant
reference I found for doing this was on reddit [1], where people
recommended to use TunSafe. TunSafe is unfortunately still closed-souce
(AFAIK), and the wireguard developers have already expressed negative
opinions against it [2], so I would rather use the official app instead. I
am reporting here so that people interested in doing the same thing find
this thread and know what has been attempted.

Here is what worked do so far:
- Install the app
- Load a configuration for an interface

Here is what I still cannot do:
- Start the interface
- Automatically start it at boot

How to reproduce:
- Install the app:
  - On the FireTV:
    - activate the relevant developer options on the FireTV stick (adb and
external sources)
  - On a workstation:
    - visit F-Droid [3] and download the apk
    adb start-server
    adb connect <ip-address-of-firetv>
    adb install com.wireguard.android_445.apk
- Load a configuration:
  - On a workstation:
    adb push wg0.conf /sdcard
  - On the FireTV:
    - navigated the menu to create a configuration from file, selected the
file I pushed

Here is where I am stuck:
The FireTV stick can only be navigated with their remote control, which has
a very basic keypad allowing to move from button to button with <up>,
<left>, <down>, <right>. Unfortunately, once an interface is configured, I
do not manage to navigate to the button to enable it.

And here are questions to the Wireguard Android devs:
- Could you let me know which Intent is sent when one enables the
interface? I would like to try to enable the interface from adb.
- In case Wireguard turns out to run on the FireTV, would you consider
adding code to make the UI navigable?

Cheers,
Christophe-Marie

[1]:
https://www.reddit.com/r/WireGuard/comments/9zmzgv/wireguard_on_a_fire_tv_stick/
[2]: https://lists.zx2c4.com/pipermail/wireguard/2018-March/002448.html
[3]: https://f-droid.org/en/packages/com.wireguard.android/

[-- Attachment #1.2: Type: text/html, Size: 2880 bytes --]

[-- Attachment #2: Type: text/plain, Size: 148 bytes --]

_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

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

* Re: [Android] Wireguard on the Amazon FireTV stick
  2019-01-08 10:26 [Android] Wireguard on the Amazon FireTV stick Christophe-Marie Duquesne
@ 2019-01-08 10:47 ` Kalin KOZHUHAROV
  2019-01-08 12:53   ` Christophe-Marie Duquesne
  0 siblings, 1 reply; 5+ messages in thread
From: Kalin KOZHUHAROV @ 2019-01-08 10:47 UTC (permalink / raw)
  To: Christophe-Marie Duquesne; +Cc: wireguard

On Tue, Jan 8, 2019 at 11:27 AM Christophe-Marie Duquesne <chmd@chmd.fr> wrote:
>
> Hi there,
>
> I tried to run Wireguard on the FireTV stick. The only other relevant reference I found for doing this was on reddit [1], where people recommended to use TunSafe. TunSafe is unfortunately still closed-souce (AFAIK), and the wireguard developers have already expressed negative opinions against it [2], so I would rather use the official app instead. I am reporting here so that people interested in doing the same thing find this thread and know what has been attempted.
>
Great!

> Here is where I am stuck:
> The FireTV stick can only be navigated with their remote control, which has a very basic keypad allowing to move from button to button with <up>, <left>, <down>, <right>. Unfortunately, once an interface is configured, I do not manage to navigate to the button to enable it.
>
I guess it allows also a full shell... adb shell ?
No way to plug USB keyboard?
Or better controller: https://www.youtube.com/watch?v=QfmuXuYI288

> And here are questions to the Wireguard Android devs:
> - Could you let me know which Intent is sent when one enables the interface? I would like to try to enable the interface from adb.
>
https://git.zx2c4.com/wireguard-android/tree/app/src/main/AndroidManifest.xml#n49
?

Kalin.
_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

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

* Re: [Android] Wireguard on the Amazon FireTV stick
  2019-01-08 10:47 ` Kalin KOZHUHAROV
@ 2019-01-08 12:53   ` Christophe-Marie Duquesne
  2019-01-08 23:07     ` Christophe-Marie Duquesne
  0 siblings, 1 reply; 5+ messages in thread
From: Christophe-Marie Duquesne @ 2019-01-08 12:53 UTC (permalink / raw)
  To: Kalin KOZHUHAROV; +Cc: wireguard


[-- Attachment #1.1: Type: text/plain, Size: 965 bytes --]

>
> I guess it allows also a full shell... adb shell ?
>

Yes, adb shell works.


> No way to plug USB keyboard?
>

A keyboard would not help, you can't focus the area I need with the arrows.
You need a mouse. It is also impossible to connect a Bluetooth mouse on the
Fire TV stick (only on the regular Fire TV [1]).


> Or better controller: https://www.youtube.com/watch?v=QfmuXuYI288
>

This is their smartphone app, it does not give you better control of the
UI, it is just a virtual remote.


>
> https://git.zx2c4.com/wireguard-android/tree/app/src/main/AndroidManifest.xml#n49
>

So I guess the correct intent would be
com.wireguard.android.action.SET_TUNNEL_UP, but I guess I need to provide
the name of the interface as a payload? Thanks for the pointer, I'll dig in
the code to see how the payload needs to be provided.

[1]: https://www.amazon.com/gp/help/customer/display.html?nodeId=201739960 "You
cannot connect a keyboard or mouse to Fire TV Stick."

[-- Attachment #1.2: Type: text/html, Size: 2101 bytes --]

[-- Attachment #2: Type: text/plain, Size: 148 bytes --]

_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

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

* Re: [Android] Wireguard on the Amazon FireTV stick
  2019-01-08 12:53   ` Christophe-Marie Duquesne
@ 2019-01-08 23:07     ` Christophe-Marie Duquesne
  2019-01-09 18:11       ` Christophe-Marie Duquesne
  0 siblings, 1 reply; 5+ messages in thread
From: Christophe-Marie Duquesne @ 2019-01-08 23:07 UTC (permalink / raw)
  To: Kalin KOZHUHAROV; +Cc: wireguard


[-- Attachment #1.1: Type: text/plain, Size: 475 bytes --]

Looks like the intent com.wireguard.android.action.SET_TUNNEL_UP does not
do much. I tried to start the tunnel like this:

am broadcast -a com.wireguard.android.action.SET_TUNNEL_UP -e tunnel wg0 -n
com.wireguard.android/.model.TunnelManager

After further investigation, the code to handle this intent is deactivated
[1]. Any help would be appreciated!

[1]:
https://git.zx2c4.com/wireguard-android/tree/app/src/main/java/com/wireguard/android/model/TunnelManager.java#n275

[-- Attachment #1.2: Type: text/html, Size: 862 bytes --]

[-- Attachment #2: Type: text/plain, Size: 148 bytes --]

_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

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

* Re: [Android] Wireguard on the Amazon FireTV stick
  2019-01-08 23:07     ` Christophe-Marie Duquesne
@ 2019-01-09 18:11       ` Christophe-Marie Duquesne
  0 siblings, 0 replies; 5+ messages in thread
From: Christophe-Marie Duquesne @ 2019-01-09 18:11 UTC (permalink / raw)
  To: Kalin KOZHUHAROV; +Cc: wireguard


[-- Attachment #1.1: Type: text/plain, Size: 1389 bytes --]

Hi again,

I managed to enable the interface by sending a tap event through the adb
shell ("input tap 1000 100"), which brought the tunnel editor, from which
it is possible to navigate to the enable button.

And the answer is... It works!

I could verify that, when using a browser on the Fire TV, my public address
was the one of my VPN server. Quite handy if you want to take your stick on
holidays and still be able to watch content from your home country, for
example.

This is obviously hacky. In order to be usable, the app would need to
handle the navigation key events. I noticed that It already handles
KEYCODE_BACK, so I guess this could go together. Amazon has a section about
it on their documentation [1].

Cheers,
Christophe-Marie

[1]: https://developer.amazon.com/docs/fire-tv/remote-input.html

On Wed, Jan 9, 2019 at 12:07 AM Christophe-Marie Duquesne <chmd@chmd.fr>
wrote:

> Looks like the intent com.wireguard.android.action.SET_TUNNEL_UP does not
> do much. I tried to start the tunnel like this:
>
> am broadcast -a com.wireguard.android.action.SET_TUNNEL_UP -e tunnel wg0
> -n com.wireguard.android/.model.TunnelManager
>
> After further investigation, the code to handle this intent is deactivated
> [1]. Any help would be appreciated!
>
> [1]:
> https://git.zx2c4.com/wireguard-android/tree/app/src/main/java/com/wireguard/android/model/TunnelManager.java#n275
>

[-- Attachment #1.2: Type: text/html, Size: 2302 bytes --]

[-- Attachment #2: Type: text/plain, Size: 148 bytes --]

_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

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

end of thread, other threads:[~2019-01-09 18:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-08 10:26 [Android] Wireguard on the Amazon FireTV stick Christophe-Marie Duquesne
2019-01-08 10:47 ` Kalin KOZHUHAROV
2019-01-08 12:53   ` Christophe-Marie Duquesne
2019-01-08 23:07     ` Christophe-Marie Duquesne
2019-01-09 18:11       ` Christophe-Marie Duquesne

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).