Enable/disable VPN web using Spotify

I’ve just downloaded Tasker, so I’m completely new to this. If you could be as noob-friendly as possible in your responses I would appreciate it.

My phone plan includes free data for Spotify streaming, but with my VPN turned on the data will be indistinguishable from everything else.

I want to set up Tasker to turn off my VPN when I’m using Spotify, and preferably turn it back on when I close it. My VPN is Avast Secureline.

If anyone could talk me through setting this up, I would be very grateful.

Thanks!

I do not know if Avast Secureline supports Tasker via plugins.

You could ask them if they have built in support for “intents” to connect/disconnect to created VPNs. Then you could use Tasker to run those intents.

I know OpenVPN has support for Tasker.

I tried looking at it’s manifest but I couldn’t figure out anything, here is a part of it which I think that could help someone else figuring out.

     <service

            android:name="com.avast.android.sdk.secureline.internal.vpn.OpenVpnService"
            android:permission="android.permission.BIND_VPN_SERVICE"
            android:exported="false">

            <intent-filter>

                <action
                    android:name="com.avast.android.sdk.secureline.VpnService.start"/>
                <action
                    android:name="com.avast.android.sdk.secureline.VpnService.stop"/>

            </intent-filter>

        </service>

Some VPN apps allow you to set apps to exclude from the VPN routing. If your VPN app has this feature, or your VPN service is compatible with a third-party VPN app, that would be preferable to letting Tasker handle your VPN connection. This also has the advantage of other apps’ data still going through the VPN tunnel while you’re using Spotify.

I know OpenVPN for Android has this feature. I’m sure other VPN apps do as well.

Thanks!

If Avast uses the OpenVPN protocol, would that make it possible in principle, if I could locate the necessary settings?

Edit: it does use OpenVPN.

Thank you! I didn’t event think of that approach. I have a rooted phone which might open up other possibilities.

Hopefully the “name” can be used as an intent.

Thanks!

Ooi: Avast does have a widget, is there a way of making that auto toggle with Spotify?

I can’t find the config files I need from Avast. It uses OpenVPN, but I have no way of connecting it to an OpenVPN client on Android.

It can use the protocol but the application needs to have the intent support or the tasker plugin.

Where do I get the avast config files? I only have android, no PC access. Or am I doing this wrong?