1. Download our Official Android App: Forums for Android!

DIY Uber Hosts File to block ads & trackers

Discussion in 'Android Lounge' started by Manxminx, Feb 22, 2011.

  1. Manxminx

    Manxminx Member
    Thread Starter
    Rank:
    None
    Points:
    36
    Posts:
    30
    Joined:
    Jan 1, 2011

    Jan 1, 2011
    30
    1
    36
    Newcastle Upon Tyne
    I know some people use the AdFree app, but I find it's just as easy and less hastle to roll my own.

    Using mathdotrandom: Block ads on PC & Android with an uber HOSTS file! as a guideline I downloaded the following hosts files:

    The Uber hosts file from the above site (last updated 22 Dec 2010)
    The mvps hosts file (last updated 18th Feb 2011)Blocking Unwanted Parasites with a Hosts File
    The yoyo hosts file (last updated 31st Jan 2011)Ad server hostnames for blocking ads (format: hosts -- in hosts file format)

    Then merged:

    Code (Text):
    1. C:\Documents and Settings\Kris>java -cp "c:\temp\MergeHosts.jar" com.ri.hosts.MergeHosts "c:\temp\hosts"
    2.  
    3. MergeHosts - looking for "hosts.*" files in: C:\Temp\hosts
    4.  
    5. Found hosts files:
    6.    hosts.mvps
    7.    hosts.uber
    8.    hosts.yoyo
    9.  
    10. Processing: hosts.mvps
    11.    14795 domains successfully extracted, with 0 collisions
    12.  
    13. Processing: hosts.uber
    14.    23151 domains successfully extracted, with 14535 collisions
    15.  
    16. Processing: hosts.yoyo
    17.    2739 domains successfully extracted, with 2728 collisions
    18.  
    19. DONE!
    20. Final hosts file: C:\Temp\hosts\hosts.final
    21. Size: 675KB
    14795+8616+11=23,422 ads & trackers blocked!

    I then merged that with the hosts list from AdFree which added an extra 180. So the total is now 23,602 and the resulting file is 680KB in size.

    If you wanted you can also merge extra lists from Fichier hosts - Acc
     

    Attached Files:


    Advertisement

Share This Page

Loading...