FORUMS
Remove All Ads from XDA

VPN "always-on" with tasker most networks

370 posts
Thanks Meter: 82
 
By endrancer, Senior Member on 2nd October 2019, 10:29 PM
Post Reply Email Thread
In miui / android it seems that at least for my device/software version configuration it's not possible to set the build in function for vpn to "always-on" while on 3rd party app's there's such an option (which is depending on a use case i would say)

i have been browsing through the web to compose a tasker task to activate the VPN option on all (or all except home) networks and could not figure out to get it working.

most people seem to be using either

- tasker send intent function
- or similar attempts with shell am start (some intent formular)
- load application function
- tasker plugins (i would appreciate not using third party plugins)

however it seemed like whatever i tried, the option never triggered.

So inside Settings > VPN
i have setup the integrated VPN called Fritz (which is working manually obviously)
as well as another APP which has VPN Capabilities but is not the case to use...

In my Screenshot here, you can find the Setting which needs to be enabled / what i want to get done with tasker



Detail Page of Build in VPN (you can see there's no always on Option)


The other App listed there has other options which give settings like "always-on", "block connection without vpn" as seen here:


Anyone has enough experience to help me out?
3rd October 2019, 12:06 AM |#2  
ktmom's Avatar
Senior Member
Thanks Meter: 2,243
 
More
Looking around a bit, I think you are using the MyFRITZ!App to connect to a FRITZ!Box. Do I have that right?

I'm guessing that most of what your finding related to tasker and VPN is OpenVPN configurations. OpenVPN is programmed with Tasker integration in mind. Through tasker plugins, or by sending intents, it's possible to control OpenVPN.

I'm not finding similar integration for the MyFRITZ!App. The answer may be that you need to automate touches with AutoInput. Another option is to contact the developers of MyFRITZ!App and request intents to command the connection/disconnection which tasker could then use.
3rd October 2019, 02:30 AM |#3  
OP Senior Member
Flag Frankfurt am Main
Thanks Meter: 82
 
More
That's not the case here.

Yes myfritz app has vpn connectivity and it's properly set up, however I have also set up another vpn with the built-in vpn functions from Android. On miui this can be found on settings > Vpn .... Regardless of the myfritz app.

To demonstrate, I have uninstalled myfritz.
As seen in my screenshot the built-in settings are still available.

On miui the settings package seems to be available on android.net.vpn.settings which seems to be used in tasker with intents for other vpn clients such as vpncilla.

However it's not clear how tasker could access the toggle switch by intent.

I have no tasker plugin yet so if I had the choice I would want to get it done by intent or shell.Click image for larger version

Name:	Screenshot_2019-10-03-03-21-52-428_com.android.settings.jpg
Views:	26
Size:	42.8 KB
ID:	4833987

Gesendet von meinem MI 9 mit Tapatalk
4th October 2019, 12:00 AM |#4  
ktmom's Avatar
Senior Member
Thanks Meter: 2,243
 
More
I think the only solution is a possible work around using openVPN to access your VPN provider's servers. Then you can use an intent or plugin to manage OpenVPN.

Tasker can't manage what it doesn't have access to.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes