Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,740,943 Members 52,647 Now Online
XDA Developers Android and Mobile Development Forum

How to filter ads on your G1

Tip us?
 
delta_foxtrot2
Old
(Last edited by delta_foxtrot2; 27th April 2013 at 06:48 AM.)
#1  
Senior Member - OP
Thanks Meter 407
Posts: 585
Join Date: Feb 2009
Default How to filter ads on your G1

You can find the latest version of this app on the slideme app store.

http://slideme.org/application/adfree

This is the old thread, I started a new thread in the general section => http://forum.xda-developers.com/show...php?p=40759351

================================================== ================================================== ============================================

Spoiled by ad free browsing on my normal desktop computer it became increasingly annoying seeing all the ads on my phone. However it's really easy to make them disappear, although you most likely will need root on the phone.

Download the hosts.txt file from http://www.mvps.org/winhelp2002/hosts.txt, you may need to run dos2unix over the file to remote \r characters, rename the file hosts and copy it to /system/etc on your phone and say goodbye to most ads.

You may find the list to be imperfect, for example some feedburner URLs are "blocked" as a result which can screw with RSS feeds, although it's annoying giving too much info to Google but like everything else in life some things are a trade off.

If you want to root your phone, try this article.
The Following 18 Users Say Thank You to delta_foxtrot2 For This Useful Post: [ Click to Expand ]
 
Dark X Dragon
Old
#2  
Dark X Dragon's Avatar
Junior Member
Thanks Meter 1
Posts: 16
Join Date: Apr 2009
Thanks for this!

As soon as I read the topic title I realised what you were doing and I never thought of it myself.

My hosts file was /etc/hosts though, not /system/etc/hosts
The Following User Says Thank You to Dark X Dragon For This Useful Post: [ Click to Expand ]
 
delta_foxtrot2
Old
#3  
Senior Member - OP
Thanks Meter 407
Posts: 585
Join Date: Feb 2009
Quote:
Originally Posted by Dark X Dragon View Post
As soon as I read the topic title I realised what you were doing and I never thought of it myself.
I've been using this technique for a bit, just didn't think to post about it before did a quick search and noticed no one else had so thought I might as well

Quote:
My hosts file was /etc/hosts though, not /system/etc/hosts
Doesn't seem to matter, I just checked the /etc dir and it has the same hosts file.
 
lbcoder
Old
#4  
Account currently disabled
Thanks Meter 95
Posts: 2,645
Join Date: Jan 2009
Actually, /etc is a symbolic link to /system/etc, so your hosts file is really at /system/etc -- however, accessing the file through either path is equivalent.
The Following User Says Thank You to lbcoder For This Useful Post: [ Click to Expand ]
 
ShatBag1105
Old
(Last edited by ShatBag1105; 2nd May 2009 at 12:21 AM.)
#5  
ShatBag1105's Avatar
Senior Member
Thanks Meter 3
Posts: 112
Join Date: Feb 2009
Ha ha hosts exists on android!? I had no idea. I'm also a spoiled ad-less pc user. This is great. Thanks.

If you can't download the file above (it appears as text in browser), replace .txt with .zip at the end of the url. This will download the zip file which u can later unzip with an unzip app in the market.

Ok. I can't paste over the original hosts file using the phone? Astro and lynda file managers don't do it for me. And yes I am rooted, running 1.5 dudes build. Can this be done only from a PC?
 
delta_foxtrot2
Old
(Last edited by delta_foxtrot2; 2nd May 2009 at 02:11 AM.)
#6  
Senior Member - OP
Thanks Meter 407
Posts: 585
Join Date: Feb 2009
Quote:
Originally Posted by ShatBag1105 View Post
Ok. I can't paste over the original hosts file using the phone? Astro and lynda file managers don't do it for me. And yes I am rooted, running 1.5 dudes build. Can this be done only from a PC?
You have a couple of options, you can download the terminal app from the market and use it, or you can use ADB to shell into the phone, or wait for someone to code an app to do it all for you.

For the time being go with installing terminal, then type 'su' to become root. That is unless you have a copy of adb handy, if you can 'adb shell' the following commands are the same, except you can copy and paste.

Then remount the system partition read-write.

Code:
Select Code
mount -o remount,rw /dev/block/mtdblock3 /system
Then you go into the etc dir

Code:
Select Code
cd /system/etc
Then you can rm the hosts file

Code:
Select Code
rm hosts
Then grab the hosts.txt file

Code:
Select Code
wget http://www.mvps.org/winhelp2002/hosts.txt -O hosts
Always more than one way to skin a cat, but the above works for me(tm)
 
Dark X Dragon
Old
#7  
Dark X Dragon's Avatar
Junior Member
Thanks Meter 1
Posts: 16
Join Date: Apr 2009
Quote:
Originally Posted by lbcoder View Post
Actually, /etc is a symbolic link to /system/etc, so your hosts file is really at /system/etc -- however, accessing the file through either path is equivalent.
Ugghh, I read that ages ago but really didn't commit it to memory. It is now. =)


There's a fair chance I won't get around to it but I'm tempted to take this ad blocking further. Namely an automatic app but there might be more to add to it.
 
ShatBag1105
Old
#8  
ShatBag1105's Avatar
Senior Member
Thanks Meter 3
Posts: 112
Join Date: Feb 2009
Thanks for the help delta. I figured it had to be done in terminal. And you know, this would definitely become very popular as an app.
 
ShatBag1105
Old
(Last edited by ShatBag1105; 3rd May 2009 at 01:15 AM.)
#9  
ShatBag1105's Avatar
Senior Member
Thanks Meter 3
Posts: 112
Join Date: Feb 2009
I'm a dummy its etc not ect
 
nyayo99
Old
#10  
Junior Member
Thanks Meter 0
Posts: 13
Join Date: May 2009
Quote:
Originally Posted by delta_foxtrot2 View Post
Then grab the hosts.txt file

Code:
Select Code
wget http://www.mvps.org/winhelp2002/hosts.txt -O hosts
Always more than one way to skin a cat, but the above works for me(tm)
(I am using the terminal program on the phone)

Until the above step, no problems
After typing in the above I get the following message:

"bad address "www.mvps.org"

I checked for typing errors, tried it 3 times but get the same error message

Any suggestions please?

thanks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes