Page 2 of 3

Re: Turning VPNs on/off without hassle

Posted: 29 Mar 2018 07:13
by morpheus999
Thanks !!

Works great !

Re: Turning VPNs on/off without hassle

Posted: 02 May 2018 13:02
by sitruk
Very nice! I am actualy working to automate my PIA VPN via the app. I never thought to do it directly from the Android VPN interface.

I am trying to understand your scripts so I can modify them to automatically connect to a specific VPN. Right now, if I run the flow while my VPN is connected it stil lasks me to select a VPN from the list. So I'm not sure if something is wonky on my phone. I have a Pixel XL, Oreo, Rooted, stock rom.

If you are able to provide any insight or assistance with modifying your flow it would be greatly appreciated.

Thank you

Re: Turning VPNs on/off without hassle

Posted: 02 May 2018 14:55
by gyst
sitruk wrote:Very nice! I am actualy working to automate my PIA VPN via the app. I never thought to do it directly from the Android VPN interface.

I am trying to understand your scripts so I can modify them to automatically connect to a specific VPN. Right now, if I run the flow while my VPN is connected it stil lasks me to select a VPN from the list. So I'm not sure if something is wonky on my phone. I have a Pixel XL, Oreo, Rooted, stock rom.

If you are able to provide any insight or assistance with modifying your flow it would be greatly appreciated.

Thank you
Hi sitruk, the flow should ask which VPN you want to connect to, well at least that is what I intended.
It should recognize by the text "connected" (in case of english) under the respective VPN entry that a connection (not via a 3rd party VPN app) already exists and if that is the case just disconnect the current connection.

If you have multiple VPN entries and always want to connect to a certain VPN entry, you should (in short terms) skip the last condition "VPNs != 1" and adjust the action "connect single VPN" according the id of the VPN entry (starting from top with 0).
A little more detailed:
  • Delete the (false) connection between the last two conditions (VPN connected and VPNs != 1)
  • Make a (false) connection between VPN connected and connect single VPN
  • Open action connect single VPN and adjust the line

    Code: Select all

    click(getElement(vpns,0));
    1st entry is 0, 2nd entry is 1 and so on...
Since I don't have an Android Oreo device, I'm not sure how exactly VPN settings or text elements are handled in Oreo, this could be (if applicable) an explanation that it doesn't work as intended for you.

Re: Turning VPNs on/off without hassle

Posted: 02 May 2018 15:21
by sitruk
gyst wrote:
sitruk wrote:Very nice! I am actualy working to automate my PIA VPN via the app. I never thought to do it directly from the Android VPN interface.

I am trying to understand your scripts so I can modify them to automatically connect to a specific VPN. Right now, if I run the flow while my VPN is connected it stil lasks me to select a VPN from the list. So I'm not sure if something is wonky on my phone. I have a Pixel XL, Oreo, Rooted, stock rom.

If you are able to provide any insight or assistance with modifying your flow it would be greatly appreciated.

Thank you
Hi sitruk, the flow should ask which VPN you want to connect to, well at least that is what I intended.
It should recognize by the text "connected" (in case of english) under the respective VPN entry that a connection (not via a 3rd party VPN app) already exists and if that is the case just disconnect the current connection.

If you have multiple VPN entries and always want to connect to a certain VPN entry, you should (in short terms) skip the last condition "VPNs != 1" and adjust the action "connect single VPN" according the id of the VPN entry (starting from top with 0).
A little more detailed:
  • Delete the (false) connection between the last two conditions (VPN connected and VPNs != 1)
  • Make a (false) connection between VPN connected and connect single VPN
  • Open action connect single VPN and adjust the line

    Code: Select all

    click(getElement(vpns,0));
    1st entry is 0, 2nd entry is 1 and so on...
Since I don't have an Android Oreo device, I'm not sure how exactly VPN settings or text elements are handled in Oreo, this could be (if applicable) an explanation that it doesn't work as intended for you.

Ahh, ok. I see. My VPN is configured in a 3rd party app but it is present in the UI (see screenshot). After making the suggested modifications, the flow appears to open the VPN settings and just hang on the "connect single VPN" action.

Re: Turning VPNs on/off without hassle

Posted: 04 May 2018 13:29
by gyst
The modifications I explained in my previous post only apply for the stock Android VPN configuration.
You have to check if the elements in the script from "connect single VPN" will work out for your use case, because it seems like there are some differences, and it can't break out of one of those (3) while-loops.
Show the overlay control and lookup/compare the elements/IDs with your VPN settings.

Re: Turning VPNs on/off without hassle

Posted: 13 Jun 2018 19:41
by morpheus999
Hi.

Now it dont work because of Android 8.0 API26...

Re: Turning VPNs on/off without hassle

Posted: 13 Jun 2018 20:56
by sitruk
My flow is still working on my Pixel XL with android 8 June update.

I just left the PIA notification visible and interact with that for disconnecting. I have PIA auto connect on launch so all I need to do is start the app to connect.

Re: Turning VPNs on/off without hassle

Posted: 14 Jun 2018 11:10
by morpheus999
sitruk wrote:My flow is still working on my Pixel XL with android 8 June update.

I just left the PIA notification visible and interact with that for disconnecting. I have PIA auto connect on launch so all I need to do is start the app to connect.

But you have to pay for VPN PIA

Re: Turning VPNs on/off without hassle

Posted: 14 Jun 2018 12:06
by sitruk
morpheus999 wrote:
sitruk wrote:My flow is still working on my Pixel XL with android 8 June update.

I just left the PIA notification visible and interact with that for disconnecting. I have PIA auto connect on launch so all I need to do is start the app to connect.

But you have to pay for VPN PIA
This is true.

Re: Turning VPNs on/off without hassle

Posted: 14 Jun 2018 15:21
by digitalstone
In case of using a good and reliable VPN, the rule of fist sounds pretty much like this:
Never settle for free VPN.

PIA VPN offers a great fully-featured 1-year service for the price of 1 month's worth of mobile phone use (2 years payment even less).
I'm not getting payed to say that :D I just take security serious and sharing my personal experience.

Note that they offer no dedicated IP address. More anonymous and safer, but no good if you want to make use of a home-server, ip-camera or other IoT.