Help converting an Intent I grabbed into Tasker?

1,135 views
Skip to first unread message

Walter Francis

unread,
Sep 25, 2012, 4:58:59 PM9/25/12
to tas...@googlegroups.com
I've tried to figure out how to do this intent, but I can't figure it out.  There was probably a better way to do this, but basically I created a shortcut in Nova launcher, then grabbed the shortcut data from it.  This is a shortcut to launch a specific OpenVPN connection in OpenVPN for Android.  The dev so far isn't interested in writing a Tasker plugin and hasn't made it clear yet how to launch a connection.

The shortcut in Nova works great, I'd love it to work in Tasker too.

The shortcut looks like this, I've trimmed some, and garbagetyped the UUID (so don't pay attention to the notation of it etc).  Let me know if I trimmed too much?

#Intent;action=android.intent.action.MAIN;component=de.blinkt.openvpn/.LaunchVPN;S.de.blinkt.openvpn.shortcutProfileUUID=sdfsadf-sdfa-dfdf-dsfdsaf-dfdsfdafsd;end'

How would I do this in Tasker's Intent dialog?  Thanks!

Walter Francis

unread,
Sep 25, 2012, 5:16:37 PM9/25/12
to tas...@googlegroups.com
FYI the code that's used is here:


Although not being an Android dev, I'm not quite sure what to do.

Matt R

unread,
Sep 25, 2012, 7:42:35 PM9/25/12
to tas...@googlegroups.com
Did you try the AutoShortcut plugin (https://play.google.com/store/apps/details?id=com.joaomgcd.autoshortcut)?  If that doesn't work, I'm still pretty new to using intents, but here's my best guess how it should be input in tasker:
 
Action: android.intent.action.MAIN
Cat: (leave none)
Mime Type: (leave blank)
Data: (leave blank)
Extra: de.blinkt.openvpn.shortcutProfileUUID=sdfsadf-sdfa-dfdf-dsfdsaf-dfdsfdafsd (removed that "S." at the beginning, seems weird)
Extra: de.blinkt.openvpn.shortcutProfileName=(whatever?***)
Package: de.blinkt.openvpn
Class: de.blinkt.openvpn.LaunchVPN
Target: Activity (I think. Try the other two if it doesn't work)
 
If you can't get that working, I'm a bit more comfortable starting intents from shell.  In Tasker, choose action Script -> Run Shell and for command put:
am start -a android.intent.action.MAIN --es de.blinkt.openvpn.shortcutProfileUUID=sdfsadf-sdfa-dfdf-dsfdsaf-dfdsfdafsd --es de.blinkt.openvpn.shortcutProfileName=(whatever?***) -n de.blinkt.openvpn/.LaunchVPN
 
***From the java code it looks like you should have another EXTRA called de.blinkt.openvpn.shortcutProfileName, but I don't see it in the shortcut intent in your first post.
 
Matt

Walter Francis

unread,
Sep 26, 2012, 8:01:16 AM9/26/12
to tas...@googlegroups.com


On Tuesday, September 25, 2012 7:42:35 PM UTC-4, Matt R wrote:
Did you try the AutoShortcut plugin (https://play.google.com/store/apps/details?id=com.joaomgcd.autoshortcut)?  If that doesn't work, I'm still pretty new to using intents, but here's my best guess how it should be input in tasker:

Matt, as always, you have the answer.  That did it in 5 seconds, thank you!  i did also try the intent, but I must have something wrong because it launches it but says it can't find the profile.  But obviously the AutoShortcut plugin, which I was unaware of, worked great, thank you!

Matt R

unread,
Jan 8, 2013, 4:49:45 PM1/8/13
to tas...@googlegroups.com
On Tuesday, January 8, 2013 7:51:24 AM UTC-8, Dan Lo wrote:
Using this app I was able to use Llama to start the OpenVPN app.  However, just like if I open that app interactively, it asks me if I want to trust the application every single time.  Is there a way to bypass this?

What app?  Tasker? 

Tasker can possibly accept the dialog by navigating/selecting in the UI with the dpad actions (requires root).

Matt

Dan Lo

unread,
Jan 8, 2013, 5:03:17 PM1/8/13
to tas...@googlegroups.com
I was referring to AutoShortcuts app from the Play Store.

Wietse van Buitenen

unread,
Jul 30, 2013, 8:23:20 AM7/30/13
to tas...@googlegroups.com
sorry to drag up an old topic but I needed the exact same thing :)
the example from Matt R helped me on my way and now I can start a VPN connection with OpenVPN for Android with an intent from Tasker 
Action: android.intent.action.MAIN
Cat: None
Extra: de.blinkt.openvpn.shortcutProfileName:myvpn
Package: de.blinkt.openvpn
Class: de.blinkt.openvpn.LaunchVPN
Target: Activity

I still use CLI openvpn for my tap interface but needed a tun for the non-rooted ones :)
thanks Matt!

Wojciech Mzyk

unread,
Sep 20, 2013, 6:47:26 AM9/20/13
to tas...@googlegroups.com
Thank You for this tips.
Ive managed to connect when im not in range of my home wifi.
How do i disconnect openvpn when im connected to my wifi?
Reply all
Reply to author
Forward
0 new messages