How to automate AdGuard for Android

Many people choose Android because they like having the ability to customize things and want to control their device completely. And it's totally normal if some of AdGuard users are not satisfied with its default behavior. Let's say, you want protection to stop when a certain app is launched, and then restart it again when the app is closed. This is a job for a tasker app.

AdGuard interface

There are a lot of tasker apps out there, for example Tasker, AutomateIt etc. AdGuard provides an interface that allows these apps to setup various automation rules.

Thanks to this interface, any app can send a special message (called "intent") that contains the name of the action and some additional data, if needed. AdGuard will look at this intent and perform the required actions.

Security concerns

Wouldn't it be a bit dangerous, you might ask — to let some random apps manage what AdGuard does? It would, and that's why a password is sent along with the intent. This password will be generated by AdGuard automatically, but you can, of course, change it at any tyme.

Available actions

So, ready to get your hands dirty? Here are actions that, when included in the intent, will be understood by AdGuard:

start — starts the protection, no extra data is needed;

stop — stops the protection, no extra data required;

pause — pauses the protection. The difference between this and stop is that a notification will appear that restarts the protection when you tap on it. No extra data required;

update — checks for available filter and app updates, no additional data is needed;


dns_filtering — turns DNS filtering on and off. Requires an extra flag:

enable:true or enable:false — enables or disables DNS filtering, accordingly.


dns_server — switches between DNS servers, you need to include additional data:

server:cloudflare — switches to a particular server by its short name;

NOTE: the full list of supported server names can be found inside AdGuard DNS settings under the "Secure DNS" tab

server:1.1.1.1,1.0.0.1 — switches to any custom DNS server;

server:sdns://AQIAAAAAAAAAFDE3Ni4xMDMu... (full string is too long) — switches to any custom DNS server via DNS-over-HTTPS, DNS-over-SSL or DNSCrypt;

server:system — resets DNS settings to default system DNS servers.


proxy_state – enables/disables the outbound proxy. Requires an extra flag:

enable:true or enable:false — activates or disactivates the outbound proxy, accordingly.


proxy_default – sets the proxy from the list of previously added ones as default. You need to include additional data:

server:[name] – where [name] is the name of the outbound proxy from the list.


Don't forget to include the password as an extra and mention package name and class! You need to do so for every intent!

Extra: password:*******

Package name: com.adguard.android

Class: com.adguard.android.receivers.AutomationReceiver

Example