OpenVPN Connect intents changed?
-
- OpenVpn Newbie
- Posts: 1
- Joined: Thu Feb 15, 2018 5:37 pm
OpenVPN Connect intents changed?
I've been using Tasker to automatically connect/disconnect and add manual buttons for a while and it has been working great. After I updated the app yesterday my tasks no longer work.
Did the intents change? What do I need to do to fix it?
Here's what I used to set it up originally
Did the intents change? What do I need to do to fix it?
Here's what I used to set it up originally
-
- OpenVpn Newbie
- Posts: 2
- Joined: Thu Feb 15, 2018 7:15 pm
Re: OpenVPN Connect intents changed?
I am having the exact same problem. I got to work this morning and noticed that my Tasker task was no longer auto connecting me to my VPN. After some troubleshooting I believe that the intents have clanged with the new OpenVPN Connect android app update. I have yet to find a solution.
-
- OpenVpn Newbie
- Posts: 2
- Joined: Fri Feb 16, 2018 10:26 am
Re: OpenVPN Connect intents changed?
Please use following options for new version of OpenVPN Connect application:
1. CONNECT
a) Access Server module
Action: net.openvpn.openvpn.CONNECT
OR
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) OVPN Profile module
Action: net.openvpn.openvpn.CONNECT
OR
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
2. 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
1. CONNECT
a) Access Server module
Action: net.openvpn.openvpn.CONNECT
OR
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) OVPN Profile module
Action: net.openvpn.openvpn.CONNECT
OR
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
2. 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
-
- OpenVpn Newbie
- Posts: 2
- Joined: Thu Feb 15, 2018 11:41 pm
Re: OpenVPN Connect intents changed?
This worked, thanks!b) OVPN Profile module
Action: net.openvpn.openvpn.CONNECT
OR
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
-
- OpenVpn Newbie
- Posts: 2
- Joined: Fri Feb 16, 2018 6:25 pm
Re: OpenVPN Connect intents changed?
Thanks for the updated info. This appears to solve the problem for Tasker but now I need to figure out why OpenVPN immediately auto-reconnects after Tasker shuts down the connection.
I don't want OpenVPN running when I'm using cellular data.
I don't want OpenVPN running when I'm using cellular data.
-
- OpenVpn Newbie
- Posts: 2
- Joined: Fri Feb 16, 2018 10:26 am
Re: OpenVPN Connect intents changed?
Hi lcasale,
Cellular data issue - I think you can set restriction for using internet for OpenVPN connect application. You can use following article for doing this - https://www.makeuseof.com/tag/prevent-a ... a-android/
Reconnect issue - could you provide more information about this nuance. I cannot reproduce it on my device. You can share this information here or send it to our support - android@openvpn.net
Cellular data issue - I think you can set restriction for using internet for OpenVPN connect application. You can use following article for doing this - https://www.makeuseof.com/tag/prevent-a ... a-android/
Reconnect issue - could you provide more information about this nuance. I cannot reproduce it on my device. You can share this information here or send it to our support - android@openvpn.net
-
- OpenVpn Newbie
- Posts: 2
- Joined: Fri Feb 16, 2018 6:25 pm
Re: OpenVPN Connect intents changed?
It looks like I have the reconnect issue solved. It seems to be related to how the connection was first started. If you connect using the slider in the app then disconnecting via Tasker results in the app automatically reconnecting.
I was resorting to the slider because my CONNECT task wasn't initiating the connection properly. Then I noticed I had a typo in the "Class" field (on the DISCONNECT task too): I had included a second ".openvpn" in the URL.
Now that I've corrected that Tasker is able to start OpenVPN successfully and when it shuts down the connection stays shut down.
Thanks for your attention to this. I realize dealing with Tasker isn't your responsibility but it seems you realize a lot of us chose your application because it could be automated like this.
BTW: I was the one concerned about OpenVPN being active while on cellular data. The reason I don't want it running is because my provider (T-Mobile) doesn't count certain types of traffic such as streaming music and video against my data cap but if that data is routed through the VPN connection they can't see where it's coming from and exclude it. That's all. I mainly just use a VPN to protect myself on public wifi hot spots.
I was resorting to the slider because my CONNECT task wasn't initiating the connection properly. Then I noticed I had a typo in the "Class" field (on the DISCONNECT task too): I had included a second ".openvpn" in the URL.
Now that I've corrected that Tasker is able to start OpenVPN successfully and when it shuts down the connection stays shut down.
Thanks for your attention to this. I realize dealing with Tasker isn't your responsibility but it seems you realize a lot of us chose your application because it could be automated like this.
BTW: I was the one concerned about OpenVPN being active while on cellular data. The reason I don't want it running is because my provider (T-Mobile) doesn't count certain types of traffic such as streaming music and video against my data cap but if that data is routed through the VPN connection they can't see where it's coming from and exclude it. That's all. I mainly just use a VPN to protect myself on public wifi hot spots.
-
- OpenVpn Newbie
- Posts: 2
- Joined: Wed Feb 28, 2018 5:44 pm
Re: OpenVPN Connect intents changed?
May I jump in to this topic ?
Before upgrade of OpenVPN Connect to 3.0 I used the following code in my app to start and stop the VPN-Connection.
Documented here: yes, it was my post
startVPN brought OpenVPN Connect to the foreground startet VPN-connection and then put OpenVPN Connect to the background - almost perfect
stopVPN stopped the connection entirely in background - perfect.
Since version 3.0 this is no longer supported and I tried to adapt the information provided above in this topic.
Currently I use v3.0.2
After some tries my app is able to launch OpenVPN Connect but it does no autoconnect
Stopping the connection works too but OpenVPN Connect stays in foreground.
Here the code I tried with lots of variations:
Does anybody know what's wrong or missing ?
Any help is very much appreciated.
Bye the way:
I wouldn't mind getting a hint how to start the VPN connection completly in background.
See this post.
Before upgrade of OpenVPN Connect to 3.0 I used the following code in my app to start and stop the VPN-Connection.
Documented here: yes, it was my post
startVPN brought OpenVPN Connect to the foreground startet VPN-connection and then put OpenVPN Connect to the background - almost perfect
Code: Select all
private void startVPN() {
Intent openVPN = new Intent();
openVPN.setPackage("net.openvpn.openvpn");
openVPN.setClassName("net.openvpn.openvpn", "net.openvpn.openvpn.OpenVPNClient");
openVPN.putExtra("net.openvpn.openvpn.AUTOSTART_PROFILE_NAME", "my.company.com [openvpn]");
startActivity(openVPN);
}
Code: Select all
private void stopVPN() {
Intent openVPN = new Intent("android.intent.action.VIEW");
openVPN.setPackage("net.openvpn.openvpn");
openVPN.setClassName("net.openvpn.openvpn", "net.openvpn.openvpn.OpenVPNDisconnect");
startActivityForResult(openVPN, 0);
Currently I use v3.0.2
After some tries my app is able to launch OpenVPN Connect but it does no autoconnect
Stopping the connection works too but OpenVPN Connect stays in foreground.
Here the code I tried with lots of variations:
Code: Select all
private void startVPN() {
Intent openVPN = new Intent();
openVPN.setPackage("net.openvpn.openvpn");
openVPN.setClassName("net.openvpn.openvpn", "net.openvpn.unified.MainActivity");
openVPN.putExtra("net.openvpn.openvpn.AUTOSTART_PROFILE_NAME", "my.company.com [openvpn]");
openVPN.putExtra("net.openvpn.openvpn.AUTOCONNECT", "true");
startActivity(openVPN);
}
Code: Select all
private void stopVPN() {
Intent openVPN = new Intent("net.openvpn.openvpn.DISCONNECT");
openVPN.setPackage("net.openvpn.openvpn");
openVPN.setClassName("net.openvpn.openvpn", "net.openvpn.unified.MainActivity");
openVPN.putExtra("net.openvpn.openvpn.STOP", "true");
startActivityForResult(openVPN, 0);
Any help is very much appreciated.
Bye the way:
I wouldn't mind getting a hint how to start the VPN connection completly in background.
See this post.
-
- OpenVpn Newbie
- Posts: 2
- Joined: Thu Feb 15, 2018 7:15 pm
Re: OpenVPN Connect intents changed?
Thanks for the new info. It works the only issue I have is on disconnect the OpenVPN app stays in the foreground once disconnected. On connect it connects then minimizes perfectly. Is there any way to get the OpenVPN app to close or at least minimize after disconnecting? Thanks.
-
- OpenVpn Newbie
- Posts: 2
- Joined: Wed Feb 28, 2018 5:44 pm
Re: OpenVPN Connect intents changed?
@fmeyer1:
did you manage to get it working with Tasker or implemeted in an android app ?
I'm stil searching for the correct method to autoconnect and disconnect programatically with an own android app.
Was perfect before upgrade to 3.0
Since 3.0 I couldn't figure out how to do i.
did you manage to get it working with Tasker or implemeted in an android app ?
I'm stil searching for the correct method to autoconnect and disconnect programatically with an own android app.
Was perfect before upgrade to 3.0
Since 3.0 I couldn't figure out how to do i.
-
- OpenVpn Newbie
- Posts: 1
- Joined: Thu Jun 06, 2019 12:23 am
Re: OpenVPN Connect intents changed?
@Composit
I know it's been a while however in case it's useful--the following. For my version "OpenVPN Connect 3.0.5" I get better luck when passing the "net.openvpn.openvpn.AUTOCONNECT" and "net.openvpn.openvpn.STOP" extras as booleans instead of strings. The first time you connect and are redirected to the app you might have to accept some sort of permission/disclaimer for autoconnect, but it does autoconnect after the prompt and then in subsequent calls to the code without any prompts. In my setup it runs back to my app after autoconnect. Disconnect happens in the background as desired. In the following my profile in OpenVPN connect is named MYPROFILENAME however in my app I prepend PC and a space before the name which corresponds with the app section.
I know it's been a while however in case it's useful--the following. For my version "OpenVPN Connect 3.0.5" I get better luck when passing the "net.openvpn.openvpn.AUTOCONNECT" and "net.openvpn.openvpn.STOP" extras as booleans instead of strings. The first time you connect and are redirected to the app you might have to accept some sort of permission/disclaimer for autoconnect, but it does autoconnect after the prompt and then in subsequent calls to the code without any prompts. In my setup it runs back to my app after autoconnect. Disconnect happens in the background as desired. In the following my profile in OpenVPN connect is named MYPROFILENAME however in my app I prepend PC and a space before the name which corresponds with the app section.
Code: Select all
Intent openVPN = new Intent("net.openvpn.openvpn.CONNECT");
openVPN.setPackage("net.openvpn.openvpn");
openVPN.setClassName("net.openvpn.openvpn", "net.openvpn.unified.MainActivity");
openVPN.putExtra("net.openvpn.openvpn.AUTOSTART_PROFILE_NAME", "PC MYPROFILENAME ");
openVPN.putExtra("net.openvpn.openvpn.AUTOCONNECT", true);
openVPN.putExtra("net.openvpn.openvpn.APP_SECTION", "PC");
if (openVPN.resolveActivity(getActivity().getPackageManager()) != null) {
startActivity(openVPN);
}
Code: Select all
Intent openVPN = new Intent("net.openvpn.openvpn.DISCONNECT");
openVPN.setPackage("net.openvpn.openvpn");
openVPN.setClassName("net.openvpn.openvpn", "net.openvpn.unified.MainActivity");
openVPN.putExtra("net.openvpn.openvpn.STOP", true);
if (openVPN.resolveActivity(getActivity().getPackageManager()) != null) {
startActivityForResult(openVPN, 0);
}