AdBlocker Quick Settings Tile [AppFactory apk and Tasker XML]

Search This thread

mkhcb

Senior Member
Nov 2, 2012
342
361
Often times, I see myself having to disable AdAway to use a Google Shopping or a Slickdeals link. This involved a process of exiting my browser, launching AdAway, disabling AdAway, going back to the browser, opening the desired link and then re-enable AdAway through the same process of exiting the browser to open AdAway again. Surely there was a simpler method! Attached below, I have posted a Tasker xml file that adds a Quick Setting tile to your system and allows users to enable/disable their AdBlocker. This uses the same sources as AdAway, but works independent of the app. Therefore, you don't need AdAway for this to work.

I have also included a compiled APK, using Tasker's AppFactory, for you fiscal conservatives who don't want to buy Tasker.
Coming soon: A unique icon....


To note, if you are using systemless root, like MagiskSU, you must enable systemless hosts in the settings of MagiskSU/root client.

Special thanks to my telegram pals Armando and Esperanza, for their help in testing the task.
Another special thanks to Armando for the app icon.

For those afraid of the download button, a copy of the xml file can be found below:
Code:
<TaskerData sr="" dvi="1" tv="5.1m">
	<Task sr="task2">
		<cdate>1496603118566</cdate>
		<edate>1518881841270</edate>
		<id>2</id>
		<nme>AdBlocker</nme>
		<pri>100</pri>
		<Kid sr="Kid">
			<launchID>2</launchID>
			<pkg>rxb.srv.ila</pkg>
			<vnme>v11</vnme>
			<vnum>11</vnum>
		</Kid>
		<Action sr="act0" ve="7">
			<code>342</code>
			<Int sr="arg0" val="5"/>
			<Str sr="arg1" ve="3">/sdcard/AdBlocker/status/status.txt</Str>
			<Str sr="arg2" ve="3">%old_status</Str>
			<Int sr="arg3" val="0"/>
		</Action>
		<Action sr="act1" ve="7">
			<code>37</code>
			<ConditionList sr="if">
				<Condition sr="c0" ve="3">
					<lhs>%old_status</lhs>
					<op>2</op>
					<rhs>false</rhs>
				</Condition>
			</ConditionList>
		</Action>
		<Action sr="act10" ve="7">
			<code>512</code>
			<Int sr="arg0" val="1"/>
		</Action>
		<Action sr="act11" ve="7">
			<code>548</code>
			<Str sr="arg0" ve="3">Enabling AdBlocker</Str>
			<Int sr="arg1" val="0"/>
		</Action>
		<Action sr="act12" ve="7">
			<code>162</code>
			<Int sr="arg0" val="1"/>
			<Str sr="arg1" ve="3">AdBlocker</Str>
			<Int sr="arg2" val="0"/>
		</Action>
		<Action sr="act13" ve="7">
			<code>118</code>
			<Str sr="arg0" ve="3">https://adaway.org/hosts.txt</Str>
			<Str sr="arg1" ve="3"/>
			<Str sr="arg2" ve="3"/>
			<Str sr="arg3" ve="3"/>
			<Str sr="arg4" ve="3"/>
			<Int sr="arg5" val="10"/>
			<Str sr="arg6" ve="3"/>
			<Str sr="arg7" ve="3">/sdcard/AdBlocker/adaway.txt</Str>
			<Int sr="arg8" val="0"/>
		</Action>
		<Action sr="act14" ve="7">
			<code>118</code>
			<Str sr="arg0" ve="3">http://winhelp2002.mvps.org/hosts.txt</Str>
			<Str sr="arg1" ve="3"/>
			<Str sr="arg2" ve="3"/>
			<Str sr="arg3" ve="3"/>
			<Str sr="arg4" ve="3"/>
			<Int sr="arg5" val="10"/>
			<Str sr="arg6" ve="3"/>
			<Str sr="arg7" ve="3">/sdcard/AdBlocker/mvps.txt</Str>
			<Int sr="arg8" val="0"/>
		</Action>
		<Action sr="act15" ve="7">
			<code>118</code>
			<Str sr="arg0" ve="3">http://hosts-file.net/.%5Cad_servers.txt</Str>
			<Str sr="arg1" ve="3"/>
			<Str sr="arg2" ve="3"/>
			<Str sr="arg3" ve="3"/>
			<Str sr="arg4" ve="3"/>
			<Int sr="arg5" val="10"/>
			<Str sr="arg6" ve="3"/>
			<Str sr="arg7" ve="3">/sdcard/AdBlocker/hphosts.txt</Str>
			<Int sr="arg8" val="0"/>
		</Action>
		<Action sr="act16" ve="7">
			<code>118</code>
			<Str sr="arg0" ve="3">http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext</Str>
			<Str sr="arg1" ve="3"/>
			<Str sr="arg2" ve="3"/>
			<Str sr="arg3" ve="3"/>
			<Str sr="arg4" ve="3"/>
			<Int sr="arg5" val="10"/>
			<Str sr="arg6" ve="3"/>
			<Str sr="arg7" ve="3">/sdcard/AdBlocker/yoyos.txt</Str>
			<Int sr="arg8" val="0"/>
		</Action>
		<Action sr="act17" ve="7">
			<code>123</code>
			<Str sr="arg0" ve="3">sort -u /sdcard/AdBlocker/*.txt > /etc/hosts</Str>
			<Int sr="arg1" val="0"/>
			<Int sr="arg2" val="1"/>
			<Str sr="arg3" ve="3"/>
			<Str sr="arg4" ve="3"/>
			<Str sr="arg5" ve="3"/>
		</Action>
		<Action sr="act18" ve="7">
			<code>410</code>
			<Str sr="arg0" ve="3">/sdcard/AdBlocker/status/status.txt</Str>
			<Str sr="arg1" ve="3">2</Str>
			<Int sr="arg2" val="0"/>
			<Int sr="arg3" val="0"/>
		</Action>
		<Action sr="act19" ve="7">
			<code>548</code>
			<Str sr="arg0" ve="3">AdBlocker Enabled</Str>
			<Int sr="arg1" val="0"/>
		</Action>
		<Action sr="act2" ve="7">
			<code>548</code>
			<Str sr="arg0" ve="3">Creating Directories</Str>
			<Int sr="arg1" val="0"/>
		</Action>
		<Action sr="act20" ve="7">
			<code>43</code>
			<ConditionList sr="if">
				<Condition sr="c0" ve="3">
					<lhs>%status</lhs>
					<op>2</op>
					<rhs>2</rhs>
				</Condition>
			</ConditionList>
		</Action>
		<Action sr="act21" ve="7">
			<code>512</code>
			<Int sr="arg0" val="1"/>
		</Action>
		<Action sr="act22" ve="7">
			<code>548</code>
			<Str sr="arg0" ve="3">Disabling AdBlocker</Str>
			<Int sr="arg1" val="0"/>
		</Action>
		<Action sr="act23" ve="7">
			<code>162</code>
			<Int sr="arg0" val="1"/>
			<Str sr="arg1" ve="3">AdBlocker</Str>
			<Int sr="arg2" val="1"/>
		</Action>
		<Action sr="act24" ve="7">
			<code>123</code>
			<Str sr="arg0" ve="3">truncate -s0 /etc/hosts</Str>
			<Int sr="arg1" val="0"/>
			<Int sr="arg2" val="1"/>
			<Str sr="arg3" ve="3"/>
			<Str sr="arg4" ve="3"/>
			<Str sr="arg5" ve="3"/>
		</Action>
		<Action sr="act25" ve="7">
			<code>123</code>
			<Str sr="arg0" ve="3">echo "127.0.0.1 localhost
::1 localhost" >> /etc/hosts</Str>
			<Int sr="arg1" val="0"/>
			<Int sr="arg2" val="1"/>
			<Str sr="arg3" ve="3"/>
			<Str sr="arg4" ve="3"/>
			<Str sr="arg5" ve="3"/>
		</Action>
		<Action sr="act26" ve="7">
			<code>410</code>
			<Str sr="arg0" ve="3">/sdcard/AdBlocker/status/status.txt</Str>
			<Str sr="arg1" ve="3">1</Str>
			<Int sr="arg2" val="0"/>
			<Int sr="arg3" val="0"/>
		</Action>
		<Action sr="act27" ve="7">
			<code>548</code>
			<Str sr="arg0" ve="3">AdBlocker Disabled</Str>
			<Int sr="arg1" val="0"/>
		</Action>
		<Action sr="act28" ve="7">
			<code>38</code>
		</Action>
		<Action sr="act3" ve="7">
			<code>409</code>
			<Str sr="arg0" ve="3">/sdcard/AdBlocker</Str>
			<Int sr="arg1" val="0"/>
			<Int sr="arg2" val="0"/>
		</Action>
		<Action sr="act4" ve="7">
			<code>409</code>
			<Str sr="arg0" ve="3">/sdcard/AdBlocker/status</Str>
			<Int sr="arg1" val="0"/>
			<Int sr="arg2" val="0"/>
		</Action>
		<Action sr="act5" ve="7">
			<code>410</code>
			<Str sr="arg0" ve="3">/sdcard/AdBlocker/status/status.txt</Str>
			<Str sr="arg1" ve="3">1</Str>
			<Int sr="arg2" val="0"/>
			<Int sr="arg3" val="0"/>
		</Action>
		<Action sr="act6" ve="7">
			<code>135</code>
			<Int sr="arg0" val="0"/>
			<Int sr="arg1" val="1"/>
			<Str sr="arg2" ve="3"/>
		</Action>
		<Action sr="act7" ve="7">
			<code>43</code>
		</Action>
		<Action sr="act8" ve="7">
			<code>417</code>
			<Str sr="arg0" ve="3">/sdcard/AdBlocker/status/status.txt</Str>
			<Str sr="arg1" ve="3">%status</Str>
		</Action>
		<Action sr="act9" ve="7">
			<code>37</code>
			<ConditionList sr="if">
				<Condition sr="c0" ve="3">
					<lhs>%status</lhs>
					<op>2</op>
					<rhs>1</rhs>
				</Condition>
			</ConditionList>
		</Action>
		<Img sr="icn" ve="2">
			<uri>content://com.android.providers.downloads.documents/document/478</uri>
		</Img>
	</Task>
</TaskerData>

If you are using the tasker xml, please navigate to: Tasker> Preferences> Action> and add "AdBlocker" to the 2nd quick settings task.


Per request, here is a telegram group for feature discussion: http://t.me/taskerAdBlocker
 

Attachments

  • Screenshot_20180213-181415.jpg
    Screenshot_20180213-181415.jpg
    140 KB · Views: 10,560
  • Screenshot_20180213-180753.jpg
    Screenshot_20180213-180753.jpg
    217 KB · Views: 10,545
  • Screenshot_20180213-180834.jpg
    Screenshot_20180213-180834.jpg
    172.5 KB · Views: 10,538
  • Screenshot_20180213-180925.jpg
    Screenshot_20180213-180925.jpg
    201.5 KB · Views: 10,003
  • Screenshot_20180213-180936.jpg
    Screenshot_20180213-180936.jpg
    154.5 KB · Views: 9,653
  • AdBlocker.11.apk
    2.5 MB · Views: 2,648
  • AdBlocker.16.apk
    2.5 MB · Views: 997
  • Screenshot_20180302-221441.jpg
    Screenshot_20180302-221441.jpg
    171.7 KB · Views: 6,746
  • AdBlocker.20.apk
    2.5 MB · Views: 8,014
  • AdBlocker.tsk.xml
    8.5 KB · Views: 3,601
Last edited:

mkhcb

Senior Member
Nov 2, 2012
342
361

Attachments

  • Screenshot_20180213-180741.jpg
    Screenshot_20180213-180741.jpg
    139.4 KB · Views: 3,772
  • Screenshot_20180213-180753.jpg
    Screenshot_20180213-180753.jpg
    217 KB · Views: 3,705
  • Screenshot_20180213-180925.jpg
    Screenshot_20180213-180925.jpg
    201.5 KB · Views: 3,713
  • Screenshot_20180213-180936.jpg
    Screenshot_20180213-180936.jpg
    154.5 KB · Views: 3,502
  • Screenshot_20180213-180834.jpg
    Screenshot_20180213-180834.jpg
    172.5 KB · Views: 3,453
  • Screenshot_20180213-181415.jpg
    Screenshot_20180213-181415.jpg
    140 KB · Views: 3,372
Last edited:

bagarwa

Senior Member
Feb 18, 2012
1,193
2,748
Bothell
play.google.com
I have a Pixel 2XL, stock Android 8.1 Feb, Magisk 15.4. I do have AdAway installed + enabled and I have systemless hosts enabled in the settings of Magisk Manager.

I imported the AdBlocker task via your xml to my Tasker. Tapped the check mark of the task configuration screen, got the "Applied" toast msg. And yet, I don't see an AdBlocker QS tile in the QS edit panel.

I went to the AdBlocker task configuration page again and tapped the run ( |> ) button at bottom left. The task ran, I got the "AdBlocker enabled" toast. I get "Disabled" in AdAway app. I tap the run button again, I get the "AdBlocker disabled" toast. AdAway still says "Disabled".

And still no AdBlocker QS tile in the QS edit panel.

I'm guessing I'm doing something wrong. Could you please let me know what?
 

buffal0b1ll

Senior Member
Sep 5, 2012
2,643
4,367
Baltimore
Google Pixel 2
Google Pixel 2 XL
I have a Pixel 2XL, stock Android 8.1 Feb, Magisk 15.4. I do have AdAway installed + enabled and I have systemless hosts enabled in the settings of Magisk Manager.

I imported the AdBlocker task via your xml to my Tasker. Tapped the check mark of the task configuration screen, got the "Applied" toast msg. And yet, I don't see an AdBlocker QS tile in the QS edit panel.

I went to the AdBlocker task configuration page again and tapped the run ( |> ) button at bottom left. The task ran, I got the "AdBlocker enabled" toast. I get "Disabled" in AdAway app. I tap the run button again, I get the "AdBlocker disabled" toast. AdAway still says "Disabled".

And still no AdBlocker QS tile in the QS edit panel.

I'm guessing I'm doing something wrong. Could you please let me know what?
Drag the first Unset Tasker tile up to the active QS tiles section. This works independent of AdAway so don't expect the status to toggle back to enabled in AdAway when the tile activates AdBlocking. I found that I had to close and reopen chrome to test that the ad blocking was indeed turned off (probably because of caching). And then again after turning it back on. It works a treat. Now to decide if I want to give up AdAway webserver functionality and use this tile as my Adblock solution as a daily driver.
 
Last edited:

buffal0b1ll

Senior Member
Sep 5, 2012
2,643
4,367
Baltimore
Google Pixel 2
Google Pixel 2 XL
@mkhcb this is brilliant. I've always wanted an AdAway toggle and this is the next best thing:) Maybe even better!
I copied line 11 and inserted it as new line 22 to make the disable action collapse the quick settings panel too. I hope you'll consider adding to your version here too.
Thanks again!
 

Attachments

  • Screenshot_20180214-211206.png
    Screenshot_20180214-211206.png
    182.9 KB · Views: 1,302
Last edited:
  • Like
Reactions: mkhcb

mkhcb

Senior Member
Nov 2, 2012
342
361
I have a Pixel 2XL, stock Android 8.1 Feb, Magisk 15.4. I do have AdAway installed + enabled and I have systemless hosts enabled in the settings of Magisk Manager.

I imported the AdBlocker task via your xml to my Tasker. Tapped the check mark of the task configuration screen, got the "Applied" toast msg. And yet, I don't see an AdBlocker QS tile in the QS edit panel.

I went to the AdBlocker task configuration page again and tapped the run ( |> ) button at bottom left. The task ran, I got the "AdBlocker enabled" toast. I get "Disabled" in AdAway app. I tap the run button again, I get the "AdBlocker disabled" toast. AdAway still says "Disabled".

And still no AdBlocker QS tile in the QS edit panel.

I'm guessing I'm doing something wrong. Could you please let me know what?

Go to Tasker settings/preferences> Action> make sure #2 says AdBlocker
 
  • Like
Reactions: bagarwa

mkhcb

Senior Member
Nov 2, 2012
342
361
Soryy i did not get the process. Could anybody pls provide Steps to implement?
Do you own a copy of Tasker?

@mkhcb this is brilliant. I've always wanted an AdAway toggle and this is the next best thing:) Maybe even better!
I copied line 11 and inserted it as new line 22 to make the disable action collapse the quick settings panel too. I hope you'll consider adding to your version here too.
Thanks again!
Thanks for picking that up! Away from my computer now but, I'll eventually update the main post.
 

ainurrofiq

Senior Member
Jan 6, 2015
438
110
@mkhcb
After re-enable adblocking, the ads still exist, do I need to reboot it? To completely enable adblocking?

Edit :
I need to download host from adaway again to make it full working , no need to reboot.
Thanks dev,
I hope next update will let the toggle seamlessly change the adblocking. Without even touching adaway again, :good:
 
Last edited:

Desmanto

Senior Member
Apr 2, 2014
416
451
Xiaomi Mi 10T / 10T Pro
Thanks for the idea. I have actually want to do this already for a long time. But always forgot it when I have leisure time to do it. Since I rarely need to disable the adblock.

I just take a peek at your xml. I have already my own concept actually. I simply create another non blocking hosts file and rename it to "hosts.clean". Then query the size of current hosts file using du command. If it is bigger than 100 bytes (true, which means adblocking), rename the current hosts file to "hosts.block". Then rename "hosts.clean" to hosts. Thus replacing the hosts with non-blocking one. Give toast that adblock has been disabled.

False branch will reverse it, rename hosts to "hosts.clean" and "hosts.block" to hosts, enabling the ad blocking. Toast adblock has been enabled.

It is so fast, just realize we don't even need to flush the dns cache. I don't redownload the hosts file, as I don't update the hosts file too frequently. Future expansion, probably I will make timeout for reverting back to hosts file. Example only disable the adblock for 15 minutes and reverting back after timeout. But it is good for now.

The core concept only require 5 elements in Automagic.
attachment.php
 

Attachments

  • Screenshot_2018-02-15-12-15-38_Half_Clean.png
    Screenshot_2018-02-15-12-15-38_Half_Clean.png
    71.5 KB · Views: 1,460
  • Like
Reactions: ainurrofiq

yan_saputra

Senior Member

whosucks

Member
Oct 19, 2016
32
20
Really cool task, I didn't even KNOW Tasker had its own programmable Quick Setting Tiles. I just added a proper icon cause i'm anal and a date check so I didn't have to download the hosts files every time.
 

Attachments

  • Screenshot_20180215-041920.png
    Screenshot_20180215-041920.png
    26 KB · Views: 448

buffal0b1ll

Senior Member
Sep 5, 2012
2,643
4,367
Baltimore
Google Pixel 2
Google Pixel 2 XL
@mkhcb
After re-enable adblocking, the ads still exist, do I need to reboot it? To completely enable adblocking?

Edit :
I need to download host from adaway again to make it full working , no need to reboot.
Thanks dev,
I hope next update will let the toggle seamlessly change the adblocking. Without even touching adaway again, :good:
You don't need AdAway anymore. Just close and open your browser if you still see ads after enabling. They're being cached. AdAway does this too.
 

ainurrofiq

Senior Member
Jan 6, 2015
438
110
You don't need AdAway anymore. Just close and open your browser if you still see ads after enabling. They're being cached. AdAway does this too.
So, if I don't need adaway anymore. what host is used by your apps? Or first install adaway, tick systemless host on magisk manager, and download the host. Reboot. Install your apps. And forget about adaway? Is this what you mean?
 
  • Like
Reactions: fire1951

Top Liked Posts

  • There are no posts matching your filters.
  • 60
    Often times, I see myself having to disable AdAway to use a Google Shopping or a Slickdeals link. This involved a process of exiting my browser, launching AdAway, disabling AdAway, going back to the browser, opening the desired link and then re-enable AdAway through the same process of exiting the browser to open AdAway again. Surely there was a simpler method! Attached below, I have posted a Tasker xml file that adds a Quick Setting tile to your system and allows users to enable/disable their AdBlocker. This uses the same sources as AdAway, but works independent of the app. Therefore, you don't need AdAway for this to work.

    I have also included a compiled APK, using Tasker's AppFactory, for you fiscal conservatives who don't want to buy Tasker.
    Coming soon: A unique icon....


    To note, if you are using systemless root, like MagiskSU, you must enable systemless hosts in the settings of MagiskSU/root client.

    Special thanks to my telegram pals Armando and Esperanza, for their help in testing the task.
    Another special thanks to Armando for the app icon.

    For those afraid of the download button, a copy of the xml file can be found below:
    Code:
    <TaskerData sr="" dvi="1" tv="5.1m">
    	<Task sr="task2">
    		<cdate>1496603118566</cdate>
    		<edate>1518881841270</edate>
    		<id>2</id>
    		<nme>AdBlocker</nme>
    		<pri>100</pri>
    		<Kid sr="Kid">
    			<launchID>2</launchID>
    			<pkg>rxb.srv.ila</pkg>
    			<vnme>v11</vnme>
    			<vnum>11</vnum>
    		</Kid>
    		<Action sr="act0" ve="7">
    			<code>342</code>
    			<Int sr="arg0" val="5"/>
    			<Str sr="arg1" ve="3">/sdcard/AdBlocker/status/status.txt</Str>
    			<Str sr="arg2" ve="3">%old_status</Str>
    			<Int sr="arg3" val="0"/>
    		</Action>
    		<Action sr="act1" ve="7">
    			<code>37</code>
    			<ConditionList sr="if">
    				<Condition sr="c0" ve="3">
    					<lhs>%old_status</lhs>
    					<op>2</op>
    					<rhs>false</rhs>
    				</Condition>
    			</ConditionList>
    		</Action>
    		<Action sr="act10" ve="7">
    			<code>512</code>
    			<Int sr="arg0" val="1"/>
    		</Action>
    		<Action sr="act11" ve="7">
    			<code>548</code>
    			<Str sr="arg0" ve="3">Enabling AdBlocker</Str>
    			<Int sr="arg1" val="0"/>
    		</Action>
    		<Action sr="act12" ve="7">
    			<code>162</code>
    			<Int sr="arg0" val="1"/>
    			<Str sr="arg1" ve="3">AdBlocker</Str>
    			<Int sr="arg2" val="0"/>
    		</Action>
    		<Action sr="act13" ve="7">
    			<code>118</code>
    			<Str sr="arg0" ve="3">https://adaway.org/hosts.txt</Str>
    			<Str sr="arg1" ve="3"/>
    			<Str sr="arg2" ve="3"/>
    			<Str sr="arg3" ve="3"/>
    			<Str sr="arg4" ve="3"/>
    			<Int sr="arg5" val="10"/>
    			<Str sr="arg6" ve="3"/>
    			<Str sr="arg7" ve="3">/sdcard/AdBlocker/adaway.txt</Str>
    			<Int sr="arg8" val="0"/>
    		</Action>
    		<Action sr="act14" ve="7">
    			<code>118</code>
    			<Str sr="arg0" ve="3">http://winhelp2002.mvps.org/hosts.txt</Str>
    			<Str sr="arg1" ve="3"/>
    			<Str sr="arg2" ve="3"/>
    			<Str sr="arg3" ve="3"/>
    			<Str sr="arg4" ve="3"/>
    			<Int sr="arg5" val="10"/>
    			<Str sr="arg6" ve="3"/>
    			<Str sr="arg7" ve="3">/sdcard/AdBlocker/mvps.txt</Str>
    			<Int sr="arg8" val="0"/>
    		</Action>
    		<Action sr="act15" ve="7">
    			<code>118</code>
    			<Str sr="arg0" ve="3">http://hosts-file.net/.%5Cad_servers.txt</Str>
    			<Str sr="arg1" ve="3"/>
    			<Str sr="arg2" ve="3"/>
    			<Str sr="arg3" ve="3"/>
    			<Str sr="arg4" ve="3"/>
    			<Int sr="arg5" val="10"/>
    			<Str sr="arg6" ve="3"/>
    			<Str sr="arg7" ve="3">/sdcard/AdBlocker/hphosts.txt</Str>
    			<Int sr="arg8" val="0"/>
    		</Action>
    		<Action sr="act16" ve="7">
    			<code>118</code>
    			<Str sr="arg0" ve="3">http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext</Str>
    			<Str sr="arg1" ve="3"/>
    			<Str sr="arg2" ve="3"/>
    			<Str sr="arg3" ve="3"/>
    			<Str sr="arg4" ve="3"/>
    			<Int sr="arg5" val="10"/>
    			<Str sr="arg6" ve="3"/>
    			<Str sr="arg7" ve="3">/sdcard/AdBlocker/yoyos.txt</Str>
    			<Int sr="arg8" val="0"/>
    		</Action>
    		<Action sr="act17" ve="7">
    			<code>123</code>
    			<Str sr="arg0" ve="3">sort -u /sdcard/AdBlocker/*.txt > /etc/hosts</Str>
    			<Int sr="arg1" val="0"/>
    			<Int sr="arg2" val="1"/>
    			<Str sr="arg3" ve="3"/>
    			<Str sr="arg4" ve="3"/>
    			<Str sr="arg5" ve="3"/>
    		</Action>
    		<Action sr="act18" ve="7">
    			<code>410</code>
    			<Str sr="arg0" ve="3">/sdcard/AdBlocker/status/status.txt</Str>
    			<Str sr="arg1" ve="3">2</Str>
    			<Int sr="arg2" val="0"/>
    			<Int sr="arg3" val="0"/>
    		</Action>
    		<Action sr="act19" ve="7">
    			<code>548</code>
    			<Str sr="arg0" ve="3">AdBlocker Enabled</Str>
    			<Int sr="arg1" val="0"/>
    		</Action>
    		<Action sr="act2" ve="7">
    			<code>548</code>
    			<Str sr="arg0" ve="3">Creating Directories</Str>
    			<Int sr="arg1" val="0"/>
    		</Action>
    		<Action sr="act20" ve="7">
    			<code>43</code>
    			<ConditionList sr="if">
    				<Condition sr="c0" ve="3">
    					<lhs>%status</lhs>
    					<op>2</op>
    					<rhs>2</rhs>
    				</Condition>
    			</ConditionList>
    		</Action>
    		<Action sr="act21" ve="7">
    			<code>512</code>
    			<Int sr="arg0" val="1"/>
    		</Action>
    		<Action sr="act22" ve="7">
    			<code>548</code>
    			<Str sr="arg0" ve="3">Disabling AdBlocker</Str>
    			<Int sr="arg1" val="0"/>
    		</Action>
    		<Action sr="act23" ve="7">
    			<code>162</code>
    			<Int sr="arg0" val="1"/>
    			<Str sr="arg1" ve="3">AdBlocker</Str>
    			<Int sr="arg2" val="1"/>
    		</Action>
    		<Action sr="act24" ve="7">
    			<code>123</code>
    			<Str sr="arg0" ve="3">truncate -s0 /etc/hosts</Str>
    			<Int sr="arg1" val="0"/>
    			<Int sr="arg2" val="1"/>
    			<Str sr="arg3" ve="3"/>
    			<Str sr="arg4" ve="3"/>
    			<Str sr="arg5" ve="3"/>
    		</Action>
    		<Action sr="act25" ve="7">
    			<code>123</code>
    			<Str sr="arg0" ve="3">echo "127.0.0.1 localhost
    ::1 localhost" >> /etc/hosts</Str>
    			<Int sr="arg1" val="0"/>
    			<Int sr="arg2" val="1"/>
    			<Str sr="arg3" ve="3"/>
    			<Str sr="arg4" ve="3"/>
    			<Str sr="arg5" ve="3"/>
    		</Action>
    		<Action sr="act26" ve="7">
    			<code>410</code>
    			<Str sr="arg0" ve="3">/sdcard/AdBlocker/status/status.txt</Str>
    			<Str sr="arg1" ve="3">1</Str>
    			<Int sr="arg2" val="0"/>
    			<Int sr="arg3" val="0"/>
    		</Action>
    		<Action sr="act27" ve="7">
    			<code>548</code>
    			<Str sr="arg0" ve="3">AdBlocker Disabled</Str>
    			<Int sr="arg1" val="0"/>
    		</Action>
    		<Action sr="act28" ve="7">
    			<code>38</code>
    		</Action>
    		<Action sr="act3" ve="7">
    			<code>409</code>
    			<Str sr="arg0" ve="3">/sdcard/AdBlocker</Str>
    			<Int sr="arg1" val="0"/>
    			<Int sr="arg2" val="0"/>
    		</Action>
    		<Action sr="act4" ve="7">
    			<code>409</code>
    			<Str sr="arg0" ve="3">/sdcard/AdBlocker/status</Str>
    			<Int sr="arg1" val="0"/>
    			<Int sr="arg2" val="0"/>
    		</Action>
    		<Action sr="act5" ve="7">
    			<code>410</code>
    			<Str sr="arg0" ve="3">/sdcard/AdBlocker/status/status.txt</Str>
    			<Str sr="arg1" ve="3">1</Str>
    			<Int sr="arg2" val="0"/>
    			<Int sr="arg3" val="0"/>
    		</Action>
    		<Action sr="act6" ve="7">
    			<code>135</code>
    			<Int sr="arg0" val="0"/>
    			<Int sr="arg1" val="1"/>
    			<Str sr="arg2" ve="3"/>
    		</Action>
    		<Action sr="act7" ve="7">
    			<code>43</code>
    		</Action>
    		<Action sr="act8" ve="7">
    			<code>417</code>
    			<Str sr="arg0" ve="3">/sdcard/AdBlocker/status/status.txt</Str>
    			<Str sr="arg1" ve="3">%status</Str>
    		</Action>
    		<Action sr="act9" ve="7">
    			<code>37</code>
    			<ConditionList sr="if">
    				<Condition sr="c0" ve="3">
    					<lhs>%status</lhs>
    					<op>2</op>
    					<rhs>1</rhs>
    				</Condition>
    			</ConditionList>
    		</Action>
    		<Img sr="icn" ve="2">
    			<uri>content://com.android.providers.downloads.documents/document/478</uri>
    		</Img>
    	</Task>
    </TaskerData>

    If you are using the tasker xml, please navigate to: Tasker> Preferences> Action> and add "AdBlocker" to the 2nd quick settings task.


    Per request, here is a telegram group for feature discussion: http://t.me/taskerAdBlocker
    4
    Is using/buying Tasker the only way to go about this mod? I was reading reviews on Tasker and they're all horrible.

    1. Maybe you should reread the original post. It clearly states there are two pathways, one for those who have and know how to use Tasker and an app for those who don't.
    2. Tasker has a 4.6 Star rating on PlayStore and over a million downloads. The only horrible reviews are people that are daunted by Tasker's learning curve.
    4
    APK 20 speeds up the enabling process by only downloading the host files that are older than 1 week. If the host files are newer than 1 week, it will block ads with the current host files saved on your phone.

    Also, APK 20 has the new icon.

    I haven't updated the code on the thread, since I am on my phone. However, I did upload the newest tsk file (which is the new code).
    2
    Best adaway app I have ever used! Simple and effective! Works amazingly well! Congratulations to the Dev!! And thank you for sharing this amazing app with us! :laugh:
    2
    Good job :good:
    Can you please share your wallpaper??

    Ok Thanks. Surely I'll wait till you get home :)

    Special thanks to @tugapower for sending this via telegram.