Page 1 of 3
Turning VPNs on/off without hassle
Posted: 04 Aug 2017 13:32
by gyst
I just made a flow for connecting/disconnecting my VPNs by shortcut if I want to.
Download
Version History:
----------------
25 Mar 2019
27 Mar 2018
23 Sep 2017
16 Aug 2017
04 Aug 2017
----------------
Brief explanation of the flow:
- Triggered by a Shortcut (trigger can be changed to whatever you like),
- checks for Automagic Accessibility service,
- launches VPN settings,
- get a list of the VPN connections,
- check if there is a connection already, if yes: disconnect, if no: popup single choice menu for selecting VPN,
- close VPN settings.
I have no idea if it's going to work out if your Android is below Nougat (7). But you can post your version of Android and let other's know if it's okay.
In case you don't use English as the main system (UI) language you need to adapt some strings in the Expression-condition (
Connected) and the Control UI-actions (
Connected,
Connecting,
Unsuccessful,
Cancel,
Disconnect,
VPN is connected).
Re: Turning VPNs on/off without hassle
Posted: 16 Aug 2017 15:39
by gyst
There is an updated version, which should support German as well (and names/vars and stuff are cleaned up a bit).
Additional languages are possible now if you like, but you need to adapt/extend the
DirectVPN Expression: syslang/translations in that case.
Btw, that's the only thing which should be adapted/changed if necessary.
Another brief explanation of the updated flow:
- Triggered by a Shortcut (trigger can be changed to whatever you like),
- checks system language, if language is not supported, output dialog,
- checks for Automagic Accessibility service, if not running, output dialog and launch accessibility settings,
- launches VPN settings,
- get a list of the VPN connections,
- check if there is a connection already, if yes: disconnect, if no: popup single choice menu for selecting VPN,
- close VPN settings.
Download here
Re: Turning VPNs on/off without hassle
Posted: 23 Sep 2017 16:32
by gyst
Another update, this time with a smaller code footprint for additional languages (in
DirectVPN Expression: syslang/translations).
Download
Re: Turning VPNs on/off without hassle
Posted: 16 Dec 2017 07:11
by SGET
Hello,
this is a really nice flow. I want to use it to set the ip via the settings. Do you know, how I get the value for the click command, so that I not click the vpn name itself?
Re: Turning VPNs on/off without hassle
Posted: 16 Dec 2017 09:29
by Desmanto
You can use Control UI - Show Overlay and navigate to the place where the IP setting is. The layout is different in each phone, so you have to tried it out by yourself.
Re: Turning VPNs on/off without hassle
Posted: 20 Mar 2018 17:14
by morpheus999
Hi.
I have only one VPN Connection. I donĀ“t have to choose a VPN Profile. What i have to change in the flow, to connect my VPN automatic ?
Sorry for my bad english.
Georg
Re: Turning VPNs on/off without hassle
Posted: 23 Mar 2018 10:24
by morpheus999
Hi.
Can i change the code, so i have to edit some code to input my VPN Name ?
The popup menu can be deleted ?
Re: Turning VPNs on/off without hassle
Posted: 26 Mar 2018 09:10
by gyst
Hi morpheus999, you don't need to change anything actually. Just get the
latest version which I already posted in September. I added a condition in order to check if there are multiple VPNs listed and if not skip the dialog.
Re: Turning VPNs on/off without hassle
Posted: 27 Mar 2018 12:06
by morpheus999
ok, then it doesnt work for me, because it askes every time to choose aa VPN Connection. But i have only one.
But i dont see a "condition" to choose if there are more then one...
Re: Turning VPNs on/off without hassle
Posted: 27 Mar 2018 14:11
by gyst
Oops, sorry, my bad.
Apparently I haven't released the version with the last changes.
Here is my latest version.