One of the most requested features in Blokada is a Tasker integration. Both Blokada 4 and Blokada 5 support Tasker integration.
Tasker with Blokada 4
Starting with Blokada 4.3, it was shipped and you can control the following:
- Turn on/off Blokada
- Enable/disable the set DNS server in Blokada
- Enable/disable Blokada Plus
You can automate the above things with anything that Tasker is capable to do. In my example below, I’ll turn off the DNS when I connect to my home network:
- In Blokada’s menu - DNS I enable one of the 3rd party DNS servers
- Then, open Tasker, I go to PROFILES , there tap on the + sign in the bottom right corner to create a new profile
- Give it a name
- I choose State , there Net , there Wifi Connected
- I choose my home’s SSID and save this profile
- Then Tasker gives me the option to choose one already existing task or I can create a new one. I choose New Task , give it a name
- Choose the + sign in the bottom right corner to add a new action
- Choose Plugin , there choose Blokada
- We arrive to the Configuration screen. Tap on the pencil in the top right corner
- Because I want to disable the set DNS server, I choose Blokada DNS . Notice that it is a switch. If it’s orange, that enables the DNS feature, if it is grey, it disables. On the Configuration screen you should see DNS - Turn off
- Save this task, go back to Tasker’s main screen and tap on the check mark in the top right corner
Note that Tasker’s default behaviour is that when the profile’s inverse is true (in this case you aren’t connected to your home wifi) the previous state will be restored (3rd party DNS server will be enabled).
The same way you can enable Blokada Plus if you are connected to a given network, you can turn off Blokada if a given application is running.
Tasker with Blokada 5
Starting with Blokada 5.16, Tasker integration is available. Here we have taken different approach that should be more future proof. This integration allows you to configure a command that Blokada should execute on a given Tasker action.
You simply need to enter the command to execute.
Commands
- on - Turns Blokada on. This is equivalent to tapping the power button in the app, meaning Blokada will configure in your latest configuration (ie if Blokada Plus was activated, it will activate also).
- off - Turns Blokada off. This is equivalent to tapping the power button in the app.
More commands will be added in future versions.