Q: Selective activation of VPN

General discussions about Automagic and automation in general

Moderator: Martin

Post Reply
ikoth
Posts: 2
Joined: 01 Oct 2013 09:03

Q: Selective activation of VPN

Post by ikoth » 01 Oct 2013 09:22

Hi all,

I'm looking for an automation solution that can activate a predefined VPN session, automatically, whenever I connect to a WiFi hotspot other than my home or work networks.

Could Automagic do that?

Cheers,

I.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Q: Selective activation of VPN

Post by Martin » 01 Oct 2013 17:07

Hi,

Automagic has no built-in actions to directly control VPN connections.
This thread discusses a possible solution by launching a shortcut to another app:
http://automagic4android.com/forum/view ... =vpn#p3205

Regards,
Martin

ikoth
Posts: 2
Joined: 01 Oct 2013 09:03

Re: Q: Selective activation of VPN

Post by ikoth » 01 Oct 2013 18:39

Thanks Martin, I'll give that a try.

Juido
Posts: 7
Joined: 26 Aug 2017 17:36

Re: Q: Selective activation of VPN

Post by Juido » 27 Aug 2017 20:27

Martin wrote:Hi,

Automagic has no built-in actions to directly control VPN connections.
This thread discusses a possible solution by launching a shortcut to another app:
http://automagic4android.com/forum/view ... =vpn#p3205

Regards,
Martin

Since this post is from 2013, any news updates regarding this matter ?

im trying for hours to get a specific VPN connection active but no luck so far...
Secure Settings or vpncilla app doesnt work anymore.. and i wasnt able to find an alternative solution yet...

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Q: Selective activation of VPN

Post by Desmanto » 28 Aug 2017 14:07

Juido wrote: Since this post is from 2013, any news updates regarding this matter ?

im trying for hours to get a specific VPN connection active but no luck so far...
Secure Settings or vpncilla app doesnt work anymore.. and i wasnt able to find an alternative solution yet...
What kind of VPN do you use? I only use 3rd party one-click connect vpn. So far, 3rd party one need to be turn on/off by using Control UI.
But there will be UI distraction for several seconds during the switch, because we need automagic to manually open the UI, using Control UI script to turn on/off the VPN.

OpenVPN should work, however I never tried it.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Juido
Posts: 7
Joined: 26 Aug 2017 17:36

Re: Q: Selective activation of VPN

Post by Juido » 28 Aug 2017 18:52

Desmanto wrote:
Juido wrote: What kind of VPN do you use?
atm i use a privat VPN provided by my home router, a Fritzbox 6490 and stock android build in vpn.

openvpn would work, but only works on a openvpn server.

i tried plugin method with security settings, but it doesnt work anymore on android 7, error unable to populate vpn list
same with vpncilla, it connects but there is no data flow.

i tried open shortcut, but i only get as far as the vpn settings, where i see the added connections

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Q: Selective activation of VPN

Post by Desmanto » 29 Aug 2017 15:27

So that's the limitation of openvpn. That's why some can't use it.

I don't know how your home router VPN setup. But probably it is not setup properly yet. Maybe need to change the VPN protocol, put it some key or maybe allow passthru for the VPN in the firewall.

I just try out saturn vpn free account, set it up using L2TP/IPSec. I try manually first, and it connects properly using the free username (i tried with PPTP, don't work).
(Maybe you should try this also to see if the VPN is working properly at your phone)

Then to connect it as a flow, I just launch App : com.android.settings - com.android.settings.Settings$VpnSettingsActivity
It brings me directly to VPN page, showing the saturn vpn account that I have just added.
Then I use Control UI to tap it, press the connect and looping until it shows connected. After connected, then just do whatever I want.
Example open browser and give some toast message that I am using VPN right now.

So you should try the manual first until it connects properly. After that, we can use automagic to automate it.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Juido
Posts: 7
Joined: 26 Aug 2017 17:36

Re: Q: Selective activation of VPN

Post by Juido » 30 Aug 2017 02:01

Desmanto wrote:Then I use Control UI to tap it, to automate it.
yeah, that's how I did it too. I just hope to avoid using the control UI because of the UI distraction you mentioned. also screen had to be on and unlocked for that.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Q: Selective activation of VPN

Post by Desmanto » 30 Aug 2017 12:03

Unfortunately there is no VPN related action, need to wait until it is implemented.
For mean time, Control UI is the best solution for built-in VPN.

I just remember there is a flow created for it already.
http://automagic4android.com/forum/view ... 39&p=18521
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Post Reply