Page 1 of 1

Android OpenVPN Connect - get profiles

Posted: Tue Oct 10, 2017 9:26 am
by and
I'm developing an Android app and I need to interact with OpenVPN Connect. Using intents, I'm able to launch OpenVPN Connect and connect to a desired profile:

Code: Select all

Intent openVPN = new Intent("android.intent.action.VIEW");
openVPN.setPackage("net.openvpn.openvpn");
openVPN.setClassName("net.openvpn.openvpn", "net.openvpn.openvpn.OpenVPNClient");
openVPN.putExtra("net.openvpn.openvpn.AUTOSTART_PROFILE_NAME", "VPN_PROFILE_NAME");
startActivityForResult(openVPN, 0);
Unfortunately, this solution implies I must know the profile name to connect to; so what I'm looking for is a way to get from OpenVPN Connect the list of imported profiles.

How can I do that?

Thanks.

Andrea

Re: Android OpenVPN Connect - get profiles

Posted: Sat Oct 14, 2017 4:03 pm
by Karumansyah
Intent openVPN = new Intent("android.intent.action.VIEW");
openVPN.setPackage("net.openvpn.openvpn");
openVPN.setClassName("net.openvpn.openvpn", "net.openvpn.openvpn.OpenVPNClient");
openVPN.putExtra("net.openvpn.openvpn.AUTOSTART_PROFILE_NAME", "VPN_PROFILE_NAME");
startActivityForResult(openVPN, 0);

Re: Android OpenVPN Connect - get profiles

Posted: Mon Oct 16, 2017 8:09 am
by and
Hello Karumansyah,
your code is the same I wrote.
What I want to do is to programmatically get from OpenVPN Connect app the list of the imported profiles, in order to select one of these profiles and connect to it, thanks to the code I wrote (and you wrote again).
So you don't help me.

Andrea

Re: Android OpenVPN Connect - get profiles

Posted: Mon Oct 23, 2017 6:55 am
by and
Can someone tell me if it is possible to do what I need about profiles?
Thanks.

Andrea

Re: Android OpenVPN Connect - get profiles

Posted: Mon Oct 23, 2017 11:10 am
by TinCanTech

Re: Android OpenVPN Connect - get profiles

Posted: Mon Oct 23, 2017 12:40 pm
by and
Hello TinCanTech,
I suppose you are saying me to use shorcuts. Is it correct?

Andrea

Re: Android OpenVPN Connect - get profiles

Posted: Thu Oct 26, 2017 12:36 pm
by and
So TinCanTech, did you mean the use of shortcuts?

Andrea

Re: Android OpenVPN Connect - get profiles

Posted: Thu Oct 26, 2017 12:51 pm
by TinCanTech
and wrote:
Tue Oct 10, 2017 9:26 am
I'm developing an Android app
Then you need help from a developer .. Read the FAQ

Re: Android OpenVPN Connect - get profiles

Posted: Thu Oct 26, 2017 1:05 pm
by and
Dear TinCanTech,
I read the FAQ and I think the only relevant section (for my case) is:
Can I control the VPN from outside the app?
A: Yes, using shortcuts. Go to Menu / Add Shortcut to add a shortcut to your home page. Shortcuts can be created for:
connecting a specific profile,
disconnecting, and
launching the app
In the previous replies, I asked you if you meant that information: I don't understand why you wrote that sarcastic sentence. This is a support forum, then if you don't want to support me, please don't reply. Your sarcasm is useless.

Re: Android OpenVPN Connect - get profiles

Posted: Thu Oct 26, 2017 1:29 pm
by TinCanTech
My reply is not sarcastic at all .. and the answer you are looking for is in the FAQ.

Re: Android OpenVPN Connect - get profiles

Posted: Thu Oct 26, 2017 1:53 pm
by and
My apologies for thinking you were sarcastic.
However, I must admit I don't understand why you wrote:
Then you need help from a developer ..
I read the FAQ and I found that only passage about controlling the VPN from outside the OpenVPN Connect app.
But I can't use shortcuts...

You wrote the answer is in the FAQ. If I refer to shorcuts, the answer is: NO.

Do you confirm my theory?

Re: Android OpenVPN Connect - get profiles

Posted: Fri Nov 03, 2017 3:28 pm
by and
Please, can someone help me?