13
AdBlocker Quick Settings Tile [AppFactory apk and Tasker XML]

  1. Dr. Indest
    Lollipop Feb 13, 2018

    Dr. Indest , Feb 13, 2018 :
    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.

    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>1518553585876</edate>
            <id>2</id>
            <nme>AdBlocker</nme>
            <pri>100</pri>
            <Kid sr="Kid">
                <launchID>2</launchID>
                <pkg>rxb.srv.ila</pkg>
                <vnme>v5</vnme>
                <vnum>5</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&amp;showintro=0&amp;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 &gt; /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>548</code>
                <Str sr="arg0" ve="3">Disabling AdBlocker</Str>
                <Int sr="arg1" val="0"/>
            </Action>
            <Action sr="act22" 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="act23" 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="act24" ve="7">
                <code>123</code>
                <Str sr="arg0" ve="3">echo "127.0.0.1 localhost
    ::1 localhost" &gt;&gt; /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>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="act26" ve="7">
                <code>548</code>
                <Str sr="arg0" ve="3">AdBlocker Disabled</Str>
                <Int sr="arg1" val="0"/>
            </Action>
            <Action sr="act27" 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">
                <cls>org.adaway.ui.BaseActivity</cls>
                <pkg>org.adaway</pkg>
            </Img>
        </Task>
    </TaskerData>
    
    Download xml file: https://www.dropbox.com/s/ajfekgpbkwm1h2f/AdBlocker.tsk.xml?dl=0
    Download APK file: https://www.dropbox.com/s/kbda8gkj9emlx9y/AdBlocker.apk?dl=0
     

    #1
  2. BeingIncog
    Nougat Feb 13, 2018

    BeingIncog , Feb 13, 2018 :
    Great Thread! :)
     

    #2
  3. idkwhoiam322
    Nougat Feb 13, 2018


    #3
  4. NeVeR_SeTTLe
    The Lab - OnePlus 6 Reviewer Feb 13, 2018

    NeVeR_SeTTLe , Feb 13, 2018 :
    Thanks for this :) Will come handy ;)
     

    #4
  5. Dr. Indest
    Lollipop Feb 13, 2018


    #5
    GopalB., Punk_69, meatandy and 2 others like this.
  6. superplus
    Head Moderator Head Moderator Feb 13, 2018


    #6
    GopalB., 97pratyush, Punk_69 and 6 others like this.
  7. timebandit
    Oreo Feb 13, 2018


    #7
  8. Dr. Indest
    Lollipop Feb 13, 2018


    #8
  9. Rizla
    Jelly Bean Feb 13, 2018

    Rizla , Feb 13, 2018 :
    Dude, you're now my hero.
     

    #9
  10. meatandy
    Oreo Feb 13, 2018

    meatandy , Feb 13, 2018 :
    Thanks for the tip , Doc ! ;)
     

    #10
  11. Dr. Indest
    Lollipop Feb 13, 2018

    Dr. Indest , Feb 13, 2018 :
    On that note, @David Y. mind changing my username to "Reboot101, MD"? My diploma should arrive in the mail within the next 2 weeks.
     

    #11
    idkwhoiam322, Punk_69 and meatandy like this.
  12. superplus
    Head Moderator Head Moderator Feb 13, 2018

    superplus , Feb 13, 2018 :
    I'll pass on the request, in case the tag goes missing, like some of them seem to have been doing of late
     

    #12
  13. meatandy
    Oreo Feb 13, 2018

    meatandy , Feb 13, 2018 :
    You can now change your U-N yourself once from your profile. LOL
     

    #13
    idkwhoiam322 and Dr. Indest like this.
  14. superplus
    Head Moderator Head Moderator Feb 14, 2018

    superplus , Feb 14, 2018 :
    I was going to mention that :p but seems it might not work for users whose username has already been changed once upon a time, not sure though, so def worth a stab
     

    #14
    Dr. Indest, idkwhoiam322 and meatandy like this.
  15. Dr. Indest
    Lollipop Feb 14, 2018

    Dr. Indest , Feb 14, 2018 :
    Didn't know that, thanks.
     

    #15
    meatandy likes this.
  16. Dr. Indest
    Lollipop Feb 14, 2018

    Dr. Indest , Feb 14, 2018 :
    I couldn't use a , so I changed it to this.

    Deleted

    Time to wait for it to be updated.
     
    Last edited: Feb 14, 2018

    #16
    meatandy likes this.
  17. BeingIncog
    Nougat Feb 14, 2018


    #17
  18. Rizla
    Jelly Bean Feb 14, 2018

    Rizla , Feb 14, 2018 :
    Yeah you need to log out and in again for it to update.
     

    #18
    meatandy and Dr. Indest like this.
  19. Dr. Indest
    Lollipop Feb 14, 2018


    #19
    meatandy likes this.
  20. BeingIncog
    Nougat Feb 14, 2018


    #20
    meatandy and Rizla like this.