Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

How to filter ads on your G1

OP delta_foxtrot2

28th April 2009, 08:55 PM   |  #1  
OP Senior Member
Thanks Meter: 437
 
605 posts
Join Date:Joined: Feb 2009
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.
Last edited by delta_foxtrot2; 27th April 2013 at 07:48 AM.
The Following 19 Users Say Thank You to delta_foxtrot2 For This Useful Post: [ View ]
29th April 2009, 06:14 PM   |  #2  
Dark X Dragon's Avatar
Junior Member
Thanks Meter: 1
 
16 posts
Join Date:Joined: 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: [ View ]
29th April 2009, 07:30 PM   |  #3  
OP Senior Member
Thanks Meter: 437
 
605 posts
Join Date:Joined: Feb 2009
Quote:
Originally Posted by Dark X Dragon

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.
29th April 2009, 07:30 PM   |  #4  
Account currently disabled
Thanks Meter: 96
 
2,645 posts
Join Date:Joined: 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: [ View ]
2nd May 2009, 12:11 AM   |  #5  
ShatBag1105's Avatar
Senior Member
Thanks Meter: 3
 
112 posts
Join Date:Joined: Feb 2009
Thumbs up
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?
Last edited by ShatBag1105; 2nd May 2009 at 01:21 AM.
2nd May 2009, 03:09 AM   |  #6  
OP Senior Member
Thanks Meter: 437
 
605 posts
Join Date:Joined: Feb 2009
Quote:
Originally Posted by ShatBag1105

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:
mount -o remount,rw /dev/block/mtdblock3 /system
Then you go into the etc dir

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

Code:
rm hosts
Then grab the hosts.txt file

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)
Last edited by delta_foxtrot2; 2nd May 2009 at 03:11 AM.
2nd May 2009, 03:28 AM   |  #7  
Dark X Dragon's Avatar
Junior Member
Thanks Meter: 1
 
16 posts
Join Date:Joined: Apr 2009
Quote:
Originally Posted by lbcoder

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.
2nd May 2009, 04:48 AM   |  #8  
ShatBag1105's Avatar
Senior Member
Thanks Meter: 3
 
112 posts
Join Date:Joined: 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.
2nd May 2009, 11:57 AM   |  #9  
ShatBag1105's Avatar
Senior Member
Thanks Meter: 3
 
112 posts
Join Date:Joined: Feb 2009
Exclamation
I'm a dummy its etc not ect
Last edited by ShatBag1105; 3rd May 2009 at 02:15 AM.
2nd May 2009, 07:55 PM   |  #10  
Junior Member
Thanks Meter: 0
 
13 posts
Join Date:Joined: May 2009
Quote:
Originally Posted by delta_foxtrot2

Then grab the hosts.txt file

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

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes