I thank you all for the information. This is the only search result I could find on the topic as of 2013/10/08. I'm definitely a noob to Android internals. The main issue I had is that I kept using the short class names rather than the fully-qualified class names, e.g. OpenVPNDisconnect instead of net.openvpn.openvpn.OpenVPNDisconnect.
Here is what I figured out with Tasker after several hours of attention deficit-afflicted fiddling, searching, etc...
VPN profile name, as shown in OpenVPN Connect:
example.com/autologin
In the steps below, replace this with your own profile name.
For fields with no listed value here, leave the Tasker field blank (shows as "Optional").
In the first Extra field in the "To Connect" procedure below, the colon and everything in bold is written as intended.
To Connect:
* Misc >
Send Intent
- * Action: android.intent.action.VIEW
* Cat: None
* Mime Type:
* Data:
* Extra: net.openvpn.openvpn.AUTOSTART_PROFILE_NAME: example.com/autologin
* Extra:
* Package: net.openvpn.openvpn
* Class: net.openvpn.openvpn.OpenVPNClient
* Target: Activity
To Disconnect:
* Misc >
Send Intent
- * Action: android.intent.action.VIEW
* Cat: None
* Mime Type:
* Data:
* Extra:
* Extra:
* Package: net.openvpn.openvpn
* Class: net.openvpn.openvpn.OpenVPNDisconnect
* Target: Activity
Now, I have a profile set up to connect to my VPN when *not* connected to my home WiFi, and otherwise, to disconnect. :-)
OpenVPN Connect version: 1.1.12
Tasker version: 4.1u3
Android version: 4.1.2
Utilities involved in figuring this out (not required; not an endorsement):
- xShortcut Free reminded me about using fully-qualified class names, which was very helpful for me, but other than that, it wasn't necessary.
aLogcat would have been even more helpful if starting from scratch. It let me know some basic information about intents, all of which is listed in this thread, once I used TitaniumBackup to convert it to a system app. (Until then, it didn't really work.)
aapt, a PC utility, through a procedure described on Tasker's Intents page (http://tasker.dinglisch.net/userguide/en/intents.html), allowed me to process the OpenVPN Connect .apk to dig deeper into these things, but I didn't gain any useful insight from it in this case. It is part of android-apktool and is available here: https://code.google.com/p/android-apktool/