Easer icon indicating copy to clipboard operation
Easer copied to clipboard

VPN support

Open imsodin opened this issue 6 years ago • 8 comments

I'd like to automatically connect to a certain VPN when connecting to a specific Wifi, thus I'd very much appreciate it if support for an operation to connect to VPN could be added.

imsodin avatar Jul 01 '19 10:07 imsodin

That's interesting. I suspect Android might have some limitation on automatically enabling VPNs, but I'll try to find if there is a way.

renyuneyun avatar Jul 14 '19 11:07 renyuneyun

Plus one for this. To be able to use the built-in vpn in the android settings and openvpn app would be awesome...

Seferi avatar Jul 26 '19 11:07 Seferi

You can use OpenVPN for Android.

Select Launch App as an operation.

App: de.blinkt.openvpn
Class Name: de.blinkt.openvpn.api.ConnectVPN (or DisconnectVPN)
Extras:
  Key: de.blinkt.openvpn.api.profileName
  Value: <your_openvpn_profilename>

fluks avatar Sep 08 '19 18:09 fluks

@fluks I wouldn't mind using this approach. Do you know how to find Class and Extras for other VPN apps? Also my scenario is: as soon as I get disconnected from particular wifi I want to turn on VPN, I'm assuming reverse scenario needs to be activated?

wisemonkey avatar Dec 20 '19 17:12 wisemonkey

Do you know how to find Class and Extras for other VPN apps?

I think the app needs to have a feature to let other apps control it. If a VPN app has made it available, it reads in the documentation. That's my guess.

Also my scenario is: as soon as I get disconnected from particular wifi I want to turn on VPN, I'm assuming reverse scenario needs to be activated?

Yes. I really can't help you with that, unfortunately I find the UX very confusing, sorry about that, renyuneyun, otherwise this is a good program. I hope the maintainer or others can improve it somehow.

fluks avatar Dec 24 '19 22:12 fluks

It would be great if I could use this app for VPN wireguard to:

  1. activate VPN as soon as you leave your home network
  2. deactivate VPN as soon as you are connected to the home network again
  3. and if the app would support two VPN connections one for the private and one for the work profile of Android (if you don't know the work profile see the app "Shelter")

ovz93br43v7 avatar Jun 07 '20 12:06 ovz93br43v7

for wireguard, there is TunnelManager$IntentReceiver. the following Broadcast profiles should work:

Enable VPN -- action: com.wireguard.android.action.SET_TUNNEL_UP, extras key: tunnel, value: <TUNNEL_NAME> Disable VPN -- action: com.wireguard.android.action.SET_TUNNEL_DOWN, extras key: tunnel, value: <TUNNEL_NAME>

however, i believe Easer must request permission com.wireguard.android.permission.CONTROL_TUNNELS

see also: https://www.reddit.com/r/tasker/comments/fn6wou/wireguard_now_supports_control_by_remote_apps/fl93kw8/?utm_source=reddit&utm_medium=web2x&context=3

khimaros avatar May 11 '21 14:05 khimaros

i see there is a separate issue for wireguard here: https://github.com/renyuneyun/Easer/issues/361 -- initial support is in the beta release

khimaros avatar May 11 '21 14:05 khimaros