home-assistant / android

:iphone: Home Assistant Companion for Android
https://companion.home-assistant.io/
Apache License 2.0
2.26k stars 628 forks source link

Auto VPN connect on mobile app #4176

Open dolenec opened 8 months ago

dolenec commented 8 months ago

Is your feature request related to a problem? Please describe. My problem is that my HA is blocked from outside internet access and I need to open Wireguard VPN profile before I open HA mobile app.

Describe the solution you'd like

Describe alternatives you've considered, if any

Additional context

dshokouhi commented 8 months ago

last i remember wireguard required special 3rd party permissions that the app needs to add to the manifest which we are not going to do as changes added to the app need to be added in a way that is not 3rd party specific.

are there any non-VPN apps that let you do this today?

kquinsland commented 3 months ago

Wire guard does now have support for third party control.

The intent is here https://github.com/WireGuard/wireguard-android/blob/master/ui/src/main/java/com/wireguard/android/model/TunnelManager.kt#L228

And somebody has already hacked together a VPN first, ha second flow here https://community.home-assistant.io/t/using-tasker-to-establish-a-wireguard-tunnel-before-starting-the-home-assistant-companion-app/610210

dshokouhi commented 3 months ago

I'm pretty sure they still require their own permissions first. The reason why tasker works is because they have their permission added in the manifest.

kquinsland commented 3 months ago

I'm pretty sure they still require their own permissions first. The reason why tasker works is because they have their permission added in the manifest.

Ahhh. I vaguely remember reading through those threads years ago but assumed that drama had been resolved when I saw the "allow 3rd party control" setting in Wireguard app.

For reference, the manifest modifications are documented here.

... add to the manifest which we are not going to do as changes added to the app need to be added in a way that is not 3rd party specific.

For what it's worth, the adjusted manifest pattern seems to be the standard way of doing this on android. What's the reasoning for not doing so here?