FORUMS
Remove All Ads from XDA

[Question] How to use Tasker to connect and disconnect VPN with "OpenVPN for Android"

53 posts
Thanks Meter: 6
 
By JasMan78, Member on 27th July 2016, 12:55 PM
Post Reply Email Thread
27th November 2017, 10:06 PM |#11  
Junior Member
Thanks Meter: 1
 
More
Quote:
Originally Posted by amplatfus

Hi,

Thank you for all info posted. I have done the connect part. But for disconnect nothing works. I have tried both below solution.
Could you please give a help?

Code:
am start -a android.intent.action.MAIN -net.openvpn.openvpn/activities.DisconnectVPN
and
Code:
Send Intent
Action: android.intent.action.VIEW
Cat: None
Extra: net.openvpn.openvpn.AUTOSTART_PROFILE_NAME: <Your VPN Name>
Package: net.openvpn.openvpn
Class: net.openvpn.openvpn.DisconnectVPN
Target: Activity
Thank you!



Hello, you can just use the same code that you used to connect the VPN but, replace your VPN name with a bogus name. When it attempts to connect to the bogus VPN it will disconnect from the existing.
The Following User Says Thank You to knightboy09 For This Useful Post: [ View ] Gift knightboy09 Ad-Free
22nd February 2018, 09:36 AM |#12  
Junior Member
Flag Moscow
Thanks Meter: 7
 
More
Hi, don't know if this is still relevant topic - but I've found a solution. But it requires root.
Just freeze/unfreeze openvpn app when needed - the command would be:

Run Shell pm disable de.blinkt.openvpn
or pm enable de.blinkt.openvpn

P.S. Running a fake vpn connection doesn't help unfortunately.
19th July 2018, 01:53 PM |#13  
Frederick888's Avatar
Junior Member
Thanks Meter: 1
 
More
Author of the app put a solution together later in 2017: https://github.com/schwabe/ics-openvpn/issues/591

And after digging into the patch, the valid configuration should be
Code:
Send Intent
Action:android.intent.action.MAIN
Cat:None
Extra:de.blinkt.openvpn.shortcutProfileName:PROFIL ENAME
Package:de.blinkt.openvpn
Class:de.blinkt.openvpn.api.DisconnectVPN
Target:Activity
I know this is an ancient question but I haven't seen anyone brought this up other than the GitHub issue. Hope it helps.
The Following User Says Thank You to Frederick888 For This Useful Post: [ View ] Gift Frederick888 Ad-Free
20th July 2018, 12:44 PM |#14  
Junior Member
Thanks Meter: 2
 
More
Here are my tasks:

Connect VPN (works!)
Send Intent
Action:android.intent.action.MAIN
Cat:None
Extra:de.blinkt.openvpn.shortcutProfileName:PROFIL ENAME
Package:de.blinkt.openvpn
Class:de.blinkt.openvpn.LaunchVPN
Target:Activity

Disconnect VPN (works!)
Send Intent
Action:android.intent.action.MAIN
Cat:None
Extra:de.blinkt.openvpn.shortcutProfileName:PROFIL ENAME
Package:de.blinkt.openvpn
Class:de.blinkt.openvpn.activities.api.DisconnectV PN
Target:Activity

Hope it will help you.
The Following 2 Users Say Thank You to Manolosun For This Useful Post: [ View ] Gift Manolosun Ad-Free
10th August 2018, 11:33 AM |#15  
Senior Member
Flag Shipley, West Yorkshire
Thanks Meter: 89
 
More
Quote:
Originally Posted by Frederick888

Author of the app put a solution together later in 2017: https://github.com/schwabe/ics-openvpn/issues/591

And after digging into the patch, the valid configuration should be

Code:
Send Intent
Action:android.intent.action.MAIN
Cat:None
Extra:de.blinkt.openvpn.shortcutProfileName:PROFIL ENAME
Package:de.blinkt.openvpn
Class:de.blinkt.openvpn.api.DisconnectVPN
Target:Activity
I know this is an ancient question but I haven't seen anyone brought this up other than the GitHub issue. Hope it helps.


Thank you for posting this
8th September 2018, 10:39 PM |#16  
Senior Member
Flag Krefeld
Thanks Meter: 22
 
More
Hi I'm looking for a similar guide for tasker for Samsungs S9 VPN comming from VpnCilla that unfortunately doesn't support L2TP/IPsec. Currently I believe I just need to know the right package name.

Looking forward for some new answer.
11th January 2019, 08:21 AM |#17  
Senior Member
Flag Krefeld
Thanks Meter: 22
 
More
Samsung VPN
Hi,

I also swtiched VPN app only to Samsung own VPN .

How would I use this with tasker to auto turn on/off for certain apps?
26th October 2019, 06:12 PM |#18  
Member
Flag San Jose
Thanks Meter: 9
 
More
Delete this.
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