FORUMS

XDA Recap: This Week In Android (May 17 – 23)

Another week, another recap. The Sunday tradition marches on this week with a fresh … more

Huawei To Sell Honor Smartphones Via Indian Retail Outlets

World’s fourth largest smartphone maker Huawei plans to now sell its … more

Sunday Debate: Are Smaller Bezels Better or Worth It?

Bezels have been getting smaller and smaller as the years go by, and while devices … more

LG G4 First Impressions and Unboxing – XDA TV

The latest in LG’s signature line of “G phones” has been released. … more
Post Reply Subscribe to Thread Email Thread

How to filter ads on your G1

28th April 2009, 07:55 PM |#1  
OP Senior Member
Thanks Meter: 464
 
More
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 06:48 AM.
The Following 20 Users Say Thank You to delta_foxtrot2 For This Useful Post: [ View ]
 
 
29th April 2009, 05:14 PM |#2  
Dark X Dragon's Avatar
Junior Member
Thanks Meter: 1
 
More
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, 06:30 PM |#3  
OP Senior Member
Thanks Meter: 464
 
More
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, 06:30 PM |#4  
Account currently disabled
Thanks Meter: 98
 
More
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 ]
1st May 2009, 11:11 PM |#5  
ShatBag1105's Avatar
Senior Member
Thanks Meter: 3
 
More
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 12:21 AM.
2nd May 2009, 02:09 AM |#6  
OP Senior Member
Thanks Meter: 464
 
More
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 02:11 AM.
2nd May 2009, 02:28 AM |#7  
Dark X Dragon's Avatar
Junior Member
Thanks Meter: 1
 
More
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, 03:48 AM |#8  
ShatBag1105's Avatar
Senior Member
Thanks Meter: 3
 
More
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, 10:57 AM |#9  
ShatBag1105's Avatar
Senior Member
Thanks Meter: 3
 
More
Exclamation
I'm a dummy its etc not ect
Last edited by ShatBag1105; 3rd May 2009 at 01:15 AM.
2nd May 2009, 06:55 PM |#10  
Junior Member
Thanks Meter: 0
 
More
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