Les documents officiels ( https://docs.openvpn.net/connecting/connecting-to-access-server-with-Android/faq-regarding-openvpn-connect-Android/#How_do_I_use_tasker_with_OpenVPN_Connect_for_Android ) de l'État :
CONNECTER
a) Module serveur d'accès Action: net.openvpn.openvpn.CONNECT
OU
Action: android.intent.action.VIEW
Cat: None
Mime Type: {blank}
Data: {blank}
Extra: net.openvpn.openvpn.AUTOSTART_PROFILE_NAME:AS {your_profile_name}
Extra: net.openvpn.openvpn.AUTOCONNECT:true
Extra: net.openvpn.openvpn.APP_SECTION:AS
Package: net.openvpn.openvpn
Class: net.openvpn.unified.MainActivity
Target: Activity
b) Module Profil OVPN Action: net.openvpn.openvpn.CONNECT
OU
Action: android.intent.action.VIEW
Cat: None
Mime Type: {blank}
Data: {blank}
Extra: net.openvpn.openvpn.AUTOSTART_PROFILE_NAME:PC {your_profile_name}
Extra: net.openvpn.openvpn.AUTOCONNECT:true
Extra: net.openvpn.openvpn.APP_SECTION:PC
Package: net.openvpn.openvpn
Class: net.openvpn.unified.MainActivity
Target: Activity
DISCONNECT
Action: net.openvpn.openvpn.DISCONNECT
Cat: None
Mime Type: {blank}
Data: {blank}
Extra: net.openvpn.openvpn.STOP:true
Extra: {blank}
Extra: {blank}
Package: net.openvpn.openvpn
Class: net.openvpn.unified.MainActivity
Target: Activity
Exemple de code Java
String profile = "myvpn";
Intent openVPN = new Intent("android.intent.action.VIEW");
openVPN.setClassName("net.openvpn.openvpn", "net.openvpn.unified.MainActivity");
openVPN.putExtra("net.openvpn.openvpn.AUTOSTART_PROFILE_NAME", "PC "+profile);
openVPN.putExtra("net.openvpn.openvpn.AUTOCONNECT", true);
openVPN.putExtra("net.openvpn.openvpn.APP_SECTION", "PC");
activity.startActivity(openVPN);
Le formatage n'est pas correct mais j'espère que cela aidera quelqu'un.