WireGuard Archive on lore.kernel.org
 help / 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 --]

<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hi there,</div><div><br></div><div>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.<br></div><div><br></div><div>Here is what worked do so far:</div><div>- Install the app</div><div>- Load a configuration for an interface<br></div><div><br></div><div>Here is what I still cannot do:</div><div>- Start the interface</div><div>- Automatically start it at boot<br></div><div><br></div><div>How to reproduce:<br></div><div>- Install the app:</div><div>  - On the FireTV:</div><div>    - activate the relevant developer options on the FireTV stick (adb and external sources)</div><div>  - On a workstation:</div><div>    - visit F-Droid [3] and download the apk</div><div>    adb start-server</div><div>    adb connect &lt;ip-address-of-firetv&gt;</div><div>    adb install com.wireguard.android_445.apk</div><div>- Load a configuration:</div><div>  - On a workstation:<br></div><div>    adb push wg0.conf /sdcard</div><div>  - On the FireTV:</div><div>    - navigated the menu to create a configuration from file, selected the file I pushed</div><div><br></div><div>Here is where I am stuck:</div><div>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 &lt;up&gt;, &lt;left&gt;, &lt;down&gt;, &lt;right&gt;. Unfortunately, once an interface is configured, I do not manage to navigate to the button to enable it.</div><div><br></div><div>And here are questions to the Wireguard Android devs:</div><div>- 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.</div><div>- In case Wireguard turns out to run on the FireTV, would you consider adding code to make the UI navigable?<br></div><div><br></div><div>Cheers,</div><div>Christophe-Marie<br></div><div><br></div><div>[1]: <a href="https://www.reddit.com/r/WireGuard/comments/9zmzgv/wireguard_on_a_fire_tv_stick/">https://www.reddit.com/r/WireGuard/comments/9zmzgv/wireguard_on_a_fire_tv_stick/</a></div><div>[2]: <a href="https://lists.zx2c4.com/pipermail/wireguard/2018-March/002448.html">https://lists.zx2c4.com/pipermail/wireguard/2018-March/002448.html</a></div><div>[3]: <a href="https://f-droid.org/en/packages/com.wireguard.android/">https://f-droid.org/en/packages/com.wireguard.android/</a><br></div></div></div></div></div></div>

[-- 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 --]

<div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I guess it allows also a full shell... adb shell ?<br></blockquote><div><br></div><div>Yes, adb shell works.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
No way to plug USB keyboard?<br></blockquote><div><br></div><div>A keyboard would not help, you can&#39;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]).<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Or better controller: <a href="https://www.youtube.com/watch?v=QfmuXuYI288" rel="noreferrer" target="_blank">https://www.youtube.com/watch?v=QfmuXuYI288</a><br></blockquote><div><br></div><div>This is their smartphone app, it does not give you better control of the UI, it is just a virtual remote.<br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<a href="https://git.zx2c4.com/wireguard-android/tree/app/src/main/AndroidManifest.xml#n49" rel="noreferrer" target="_blank">https://git.zx2c4.com/wireguard-android/tree/app/src/main/AndroidManifest.xml#n49</a><br></blockquote><div><br></div><div>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&#39;ll dig in the code to see how the payload needs to be provided.</div><div><br></div><div>[1]: <a href="https://www.amazon.com/gp/help/customer/display.html?nodeId=201739960">https://www.amazon.com/gp/help/customer/display.html?nodeId=201739960</a> &quot;<span>You cannot connect a keyboard or mouse to Fire TV Stick.&quot;</span></div></div></div></div></div>

[-- 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 --]

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

[-- 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 --]

<div dir="ltr"><div dir="ltr"><div>Hi again,</div><div><br></div><div>I managed to enable the interface by sending a tap event through the adb shell (&quot;input tap 1000 100&quot;), which brought the tunnel editor, from which it is possible to navigate to the enable button.</div><div><br></div><div>And the answer is... It works!</div><div><br></div><div>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.</div><div><br></div><div>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].<br></div><div><br></div><div>Cheers,</div><div>Christophe-Marie</div><div><br></div><div>[1]: <a href="https://developer.amazon.com/docs/fire-tv/remote-input.html">https://developer.amazon.com/docs/fire-tv/remote-input.html</a><br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Jan 9, 2019 at 12:07 AM Christophe-Marie Duquesne &lt;<a href="mailto:chmd@chmd.fr">chmd@chmd.fr</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Looks like the intent com.wireguard.android.action.SET_TUNNEL_UP does not do much. I tried to start the tunnel like this:<br></div><div dir="ltr"><br></div><div dir="ltr">am broadcast -a com.wireguard.android.action.SET_TUNNEL_UP -e tunnel wg0 -n com.wireguard.android/.model.TunnelManager</div><div dir="ltr"><br></div><div>After further investigation, the code to handle this intent is deactivated [1]. Any help would be appreciated!</div><div><br></div><div>[1]: <a href="https://git.zx2c4.com/wireguard-android/tree/app/src/main/java/com/wireguard/android/model/TunnelManager.java#n275" target="_blank">https://git.zx2c4.com/wireguard-android/tree/app/src/main/java/com/wireguard/android/model/TunnelManager.java#n275</a><br></div></div></div></div></div></div></div>
</blockquote></div>

[-- 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, back to index

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

WireGuard Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/wireguard/0 wireguard/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 wireguard wireguard/ https://lore.kernel.org/wireguard \
		wireguard@lists.zx2c4.com zx2c4-wireguard@archiver.kernel.org
	public-inbox-index wireguard


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/com.zx2c4.lists.wireguard


AGPL code for this site: git clone https://public-inbox.org/ public-inbox