yashsingh1/xdaforums huggingface dataset:
[Hero, G2 Touch General] :No-Frost::
I'm confused... This is for blocking apps adds???
[Hero, G2 Touch General] r1enh:
Yes it is. See it like a firewall wich blocks mobile ads. Because the app wont recieve any response from the ad url it tries to reach, it'll simply not display the ad (like when you use the app without wifi or data connextion on)
[Hero, G2 Touch General] :No-Frost::
Wooooooo thanks... worked like a charm in glympse shazam and others =D...

PS: Air Control still have adds... Mmm how can we know what's the host for the add in the apps so we can contribute into blocking them???
[Hero, G2 Touch General] NoHolidaysForAHooker:
it messes up the banner ads in Words with Friends. i'm on a Verizon Fascinate running stock/deodexed/debloated EB01. other than that it's worked great with all the other apps i've used
[Hero, G2 Touch General] edwardmlyte:
Same issue on a normal Desire. Until I can get home and run the workaround I've disabled AdFree.
[Hero, G2 Touch General] ss622:
i have adfree, but i still see ads in Angry birds and Words with friends, and basically everywhere else

how did you guys get adfree to block anything?

i've updated the host files so idk whats up :(

please help!
[Hero, G2 Touch General] Fat Fred:
Are you sure the hosts file is updating - what's the content of it here /system/etc/hosts ?
[Hero, G2 Touch General] dkmurphys:
It works great for me for Angry Birds.

New WWF update rebreaks the app after the fix.
[Hero, G2 Touch General] denshigomi:
Find out what address it's trying to connect to and remove it from your hosts file.
[Hero, G2 Touch General] ss622:
it acts like its updating and then says hosts files are updated.

i tried going to /system/etc/hosts, with my phone plugged in, i can't see a systems in file manager, systems/etc/hosts is a 25.00b file, if i select it it says application not available.

i feel like such a noob. thanks for your help!
[Hero, G2 Touch General] Fat Fred:
It's not updated properly then - try the steps above, in the order they're posted (I think my steps were last and seem to work on the HTC Desire).
[Hero, G2 Touch General] ss622:
thanks i'll try it out.
[Hero, G2 Touch General] biobyte:
mm realy need to install adb and learn to use it:rolleyes:
[Hero, G2 Touch General] edwardng:
sry for a noob question

How to block ads for elelinux rom???
[Hero, G2 Touch General] bochdi:
thanks... really helpful... :D
[Hero, G2 Touch General] Fat Fred:
Do it - makes life much easier!
[Hero, G2 Touch General] justitan:
does it work for Gingerbread 2.3.3 with rooted?
[Hero, G2 Touch General] killall-q:
It doesn't matter what version of Android it is if you replace /system/etc/hosts manually. In fact, the same method is used in Windows with C:\Windows\System32\drivers\etc\hosts, and in OS X with /private/etc/hosts. I can confirm working on CM7 RC2.
[Hero, G2 Touch General] usn.mustanger:
I get the same error, not only in WWF, but any app that uses the ads API from the android sdk (which is a lot of them!) whenever I have the AdFree hosts file installed. But since AdFree basically just replaces your hosts file, and does nothing to the apps themselves, I can't really blame this on AdFree. Looks like the devs of ad-supported apps have figured out a way to thwart our ad-killing efforts. Not that I blame them...

Anyways, thanks for the workaround. It would be nice if there was a better way that would allow us to kill the obnoxious ads in WWF and similar apps.
[Hero, G2 Touch General] mobileweasel:
I just recent migrated from a Samsung Galaxy I7500L running GAOSP to a Motorola Atrix. Adfree was running successfully on the Galaxy, but doesn't seem to be on the Atrix. Adfree successfully blocked ads in the app Weathereye, but it refuses to do it on the Atrix. Ideas ?
[Hero, G2 Touch General] eqzgkxokwa:
Optimize human-readability of hosts file

1.) i miss this: 127.0.0.1 api.admob.com :(

2.) you can enter multiple records at single page: ;)

127.0.0.1 admob.com api.admob.com a.admob.com b.admob.com c.admob.com mm.admob.com r.admob.com

this is great for human readability, because you can find related sites on single line :cool:

3.) i have rooted android 1.6, why you don't make your app working on it? i guess file access api is readily available here...
[Hero, G2 Touch General] OrangeLion:
Desire HD

Hi All,

Just spent 40 min reading this whole thread..

Im on DHD rooted (i think :) have ENG S-off)

the begining:

1. after entering :

adb shell mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system

I got: adb server is out of date. killing...

* daemon started successfully *

mount: Operation not premitted

2. after entering:

adb push hosts.for.mobile.txt /etc/hosts

I got: failed to copy 'hosts.for.mobile.txt to '/etc/hosts': Read-only file system

Then I tried it again after rebooting into Recovery

1. after adb shell mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system

i got: adb server is out of date. killing...

* daemon started successfully *

mount: mounting /dev/block/mtdblock3 on /system invalid argument

2. after adb push hosts.for.mobile.txt /etc/hosts

i got: * daemon not running. starting it now on port 5-37 *

* daemon started successfully *

1914 KB/s (614540 bytes in 0.313s)

and thats about is....

any idea what am I doing wrong?

Thanks!
[Hero, G2 Touch General] mobileweasel:
Well I don't know what the hell is going on with my Atrix. I seem to have successfully replaced the hosts file in the system/etc directory and when I open my browser to 00fun.com, it still opens. Should I be replacing the hosts file in /etc as well ??
[Hero, G2 Touch General] scholbert:
You need to be root to re-mount system partition.

Try:

1. adb push hosts.for.mobile.txt /sdcard

2. adb shell

3. in your device shell type su

4. mount -o rw,remount /dev/block/mtdblock3 /system

5. use mount to check if system partition has been re-mounted.

6. cp /etc/hosts /sdcard/hosts.backup

7. cp /sdcard/hosts.for.mobile.txt /etc/hosts

If your using the recovery console you'll have to:

1. mount system partition to /system first

2. make sure that it's mounted r/w

3. copy your host file to /system/etc/hosts instead of /etc/hosts

Anyway, these are noob questions and have been answered many times in this forum... please use the search button.

Apart from that try to update your adb tool on your host to a newer version.

There'd been an update for 2.1 and up.

@mobileweasel:

After your device has booted up into Android /system/etc is mounted to /etc.

In other words this is the same directory from systems view.

Good luck!

scholbert
[Hero, G2 Touch General] bsdnix:
how to install your .zip file? through recovery?
[Hero, G2 Touch General] mirror4me:
nice tutorial, thanks
[Hero, G2 Touch General] Preggy:
This file is now almost one year old. Is it still blocking ads efficiently today?
[Hero, G2 Touch General] killall-q:
Hi, please check out the updated file I posted in this post. You can also do it yourself using the links provided in the original file and then manually add back in mobile-specific ad providers and remove duplicates.
[Hero, G2 Touch General] Savagery:
Hmm after using this. I can easy pull the hosts file and verify its the correct one. But after boot its back to the old version. Any ideas ? And yes it is succesfully transfered, ea I can pull it and see its correct. Tried twice just to make sure all was ok.

reedit : It seems that under the latest cyanogen mod 7 the phone auto copies its host file from the system directory - meaning you gotta push your host file to "adb push hosts.for.mobile.txt /system/etc/hosts" and NOT "adb push hosts.for.mobile.txt /etc/hosts" even though the regular directory also excist.
[Hero, G2 Touch General] scholbert:
This is no copy at boot time... or some mystic magic :rolleyes:

Independent of which distribution you are using, it's all the same on Android phones:

The /etc folder in the root directory is a symlink to /system/etc.

To modify any file in /etc, the source of the symlink has to be modified of course (/system/etc).

While handling with files in the system structure in general, take care of read only mounts, file permissions and file owner.... etc.

Shell scripts and configuration files need unix text format.

So does the hosts file ;)

These are linux basics and while Android is based upon this OS, it would do no harm to read some educational books.

Have fun!

scholbert
[Hero, G2 Touch General] McLabia:
While I know this is for the Hero, I was curious if this would work on the Thunderbolt.
[Hero, G2 Touch General] flipwuk:
You could use the AdBlock application (it's on the Market but requires root) to do the same as this. It automatically prompts for updates to the hosts/blacklist file too.
[Hero, G2 Touch General] McLabia:
Yeah, I found that app the night before last. Ty though for the reply. haha.
[Hero, G2 Touch General] Tanker Bob:
I've tried these commands under 1.57, but it didn't work. I keep getting "Permission denied" when I run the first mount. I also tried using su, but it didn't help. I definitely have root and can open an su shell. Any ideas? Am I missing something?
[Hero, G2 Touch General] Tanker Bob:
Disregard, I used Ghost Commander to mount /system as rw, copied the host file from my external card, then reset /system to ro and rebooted. Seems to work great. Thanks for putting the hosts file together!
[Hero, G2 Touch General] arvin2212:
Works Great.

Thank you :)
[Hero, G2 Touch General] iamxeph:
Ad-Free.apk is working great, but If I put this file to manually on /system/etc/ , it doesn't work. weird.
[Hero, G2 Touch General] MomirPeh:
Which file are you putting in system/etc? Hosts file or the .apk? Hosts file should go to system/etc and .apk can go to system/app or data/app directories. Also watch for file permissions.
[Hero, G2 Touch General] Krishna.duvvuri:
Thank you! very useful!
[Hero, G2 Touch General] nikitosina:
Thank's!

Very useful!
[Hero, G2 Touch General] hero-dot:
Thank you! Works very well.
[Hero, G2 Touch General] croques:
I've shamelessly stolen from the hosts files in this thread and then added my own to make an up-to-date list that mainly works for me.

The file is sorted, (with the exception of the localhost entry), with duplicates removed.
[Hero, G2 Touch General] Murrx:
Adfree is a great and easy solution!

Thanks for the tip
[Hero, G2 Touch General] cephraim:
But, Adfree makes some apps, like Words with Friends, inoperable.
[Hero, G2 Touch General] Ok-Alex:
Hello. Thank you for a great app AdFree! It's very useful.

I noticed that some apps now can detect AdFree running and always annoying me in notification bar.

Is it possible to hide AdFree process or something?
[Hero, G2 Touch General] 92jacko:
Does anyone know the IP address of a

completely

blank website?

My reason for asking is that if you use localhost, some apps will show a website could not be found page where the ad would have been (which can sometimes take up more room than what an advert would)

Whereas, if a blank website was used, the app would/should show either an empty or non-existent space.

Thanks for any responce
[Hero, G2 Touch General] Phoenix84118:
Correct me if I'm wrong, but as I understand it, there is no background process. The app simply modifies a text file on the system and exits.

The app is most likely doing a explicit lookup to an ad server, and when it fails to resolve, displays the error message.

Alternately, it might also look for the adfree classname com.bigtincan....

If that's the case, then you should be able to install the app, apply the hosts file, and remove the app (or apply it via adb instead).

If you feel brave, you could set up your own web server and direct your own phone to your IP address. :D

All you would need (at least for apache) is probably a rewrite rule to redirect any file requests to a single file (ie. blank.html). I don't know what's requested though, you'd have to set up the server and read the logs to know.
[Hero, G2 Touch General] 92jacko:
Thanks for the suggestion, but in my case, that would not be possible, I cannot keep my computer running all day, my mother would kill me xD

..besides, I don't have a home internet connection at the moment :P

One that i have found, which I am using at the moment is: 87.106.13.152 (url: blankwebsite.com)

..which is a semi-blank website (nothing on it besides a few paragraph tags with non-breaking spaces inside)

so it kinda works for what I wanted, but now, apps which used to show a "this page could not be found" error message, in the ad-place, now show a small blank area (because of the paragraph tags)

EDIT:

Upon looking at that IP address again, it appears that it no-longer links to blankwebsite.com, but instead, a completely blank page (i don't even think its linking to a HTML (etc) document at all anymore), which if it stays 100% blank, then it's exactly what I was looking for (:
[Hero, G2 Touch General] carhigh:
Weid, it was working fine on my first infuse. Got a couple more, gave my old one to my wife and also got one for my daughter. Add free is half working on my new one. TikL is showing an add on the bottom. The top add is gone. Some other app is showing adds also, but i cant remember which one. Craigslist adds arent showing. I feel like im half addfreee!

If i remember the name of the other app ill edit here.

Addree is working fine on my daughters and she has no tikL bottom add.
[Hero, G2 Touch General] marcher233:
Read your hosts file, what a large *collection* of ad networks!! This is awesome, m8...
[Hero, G2 Touch General] Julian1984:
Why i'm getting an "Out of Date" error?

I've installed latest version on the market...

thanks!
[Hero, G2 Touch General] vax:
Thank you very much for your work!

Just one small problem : the latest update causes a FC each time during the verification of the hosts file (htc wildfire). Previous version was working perfectly.
[Hero, G2 Touch General] 92jacko:
This is not an error message, but a warning message alerting you to the fact your hosts file is out of date, not that the app is out of date.

To resolve, click "download & install hosts"
[Hero, G2 Touch General] x10mp_owner:
force close on X10 mini pro

Unfortunately the latest version 'force closes' on my X10 mini pro after aquiring 'su' privileges. The previous version worked just fine (but now shows 'out of date'). Could you please check this since I would like to continue using this comfortable way of updating the hosts file? I really appreciate the work you already invested in this app, thanks a lot!
[Hero, G2 Touch General] :
getting fc on wildfire and before this version I got out of date, the rest of versions were working fine!
[Hero, G2 Touch General] telemakos:
I have exactly the same problem on my SE X10 mini pro (android 2.1) after today's update! Can you pls. sort this out?
[Hero, G2 Touch General] adz63:
in the app what does it do if i tick use/data/data/hosts symlink

also only sometimes does it block ads . for eg i go on browser and a site and one min all the adds are gone then i go back on it half hour later and they are all there
[Hero, G2 Touch General] mrfree2ita:
it causes phone reboots on my wildfire just after updating... but the /system/etc/hosts file still only contains

127.0.0.1 localhost
[Hero, G2 Touch General] rawimage:
My AdFree hasn't been working at all since last update.

I took a peek at the host-file and it was completely empty.

I've been installing and reinstalling the app several times today with no luck. It says Success after every download of new hosts but it never worked.

So finaly I pushed a new host-file created with the info found in the first post of this thread: http://xdaforums.com/showthread.php?t=509997

Now the host-file is 605kb instead of 0kb and there are no ads in the phone anymore.
[Hero, G2 Touch General] SysTem-X:
I had the same problem like you. There was another thread on xda saying that "Use /data/data/hosts symlink" and "Create symlink if needed" should not be ticked. This fixed it for me.
[Hero, G2 Touch General] Crox:
After the update some Apps show ad again - for example Angry Birds, Leo, CamScanner ... please can you update the host-file.
[Hero, G2 Touch General] quadjacks:
Still getting ads in apps as mentioned!
[Hero, G2 Touch General] magixfingers:
thanks for sharing
[Hero, G2 Touch General] VerizonKoolaid:
FireStarter for android??

Is there an android gui IPtables app? to block ads servers by ip address where FQDN is not an option

FireStarter for android??

http://www.fs-security.com/
[Hero, G2 Touch General] Nyaki:
Sorry for the dumb question, but I assume the program have to run to block the ads, right? If I turn it on, the ads coming back?
[Hero, G2 Touch General] ashok2ashok:
Wow, thanks a lot for this. Works like a charm. I even tried putting adsense into a sample app with your hosts file. Blocks perfectly :)
[Hero, G2 Touch General] jinrake:
worked!! thanks
[Hero, G2 Touch General] almondecks:
adfree error

I keep getting this error, unable to locate a partition to remount to write the host file to. I don't know what to do. EVO 4G mikg 2.xx
[Hero, G2 Touch General] thebrainkafka:
Hi, I'm using an SGS+ (i9001) and either Ad-Free nor the manual pushing of the hosts file is giving success in blocking adds. Host file is in /etc folder and >800kb.

Any ideas?

Thanks
[Hero, G2 Touch General] Lucker:
Hi guys, this wonderful software using hosts file where someone place news website lenta.ru (russian website for news agency I read every day) with the last update. As far I'm completely newbie in android it took me about hour and half to find out why the website down, but working on my laptop. Finally I deleted the line with lenta.ru from hosts but I'm afraid it will be there with new update.

Is it possible to create some "white list" for the application to avoid editing hosts after every updates? I'd like to include in "white list" some other website, for instance gravatar.
[Hero, G2 Touch General] gyverd:
Hi, I would like to not used adfree anymore. What should I do ?

I'm already uninstalling the application but it still blocked my ads. I can't access some ads that I need.

Note : In the host file still had many blocked links.

*Problem Solved
[Hero, G2 Touch General] motopig:
Adfree improved my Angry Birds play on my sucky Spice to be a bit more tolerable, especially with Seasons.

Looking at some remaining ads I found that rovio1.appads.com also needs to be included in the hosts file, so it was not entirely perfect in blocking its ads. I added it manually to my hosts and the last bits of ads were gone.

In looking for this I also found that Angry Birds uses Burstly for its ads, which spews enough crap to plug up my logcat in a single run.

The good side is I only need to run it every so often to update the hosts file, then I can close it and leave it like that. Its built-in web server is entirely optional.

All in all, this is a must-have!
[Hero, G2 Touch General] Dazze:
Nice thanks! :)
[Hero, G2 Touch General] Coucher:
Trying to register on the website so that I can whitelist a site that by default is blocked.

Keep getting "There was a problem creating your account, please try again. If you still have problems please contact support."

Thoughts?
[Hero, G2 Touch General] Megatr0n.:
Is there a reason why adfree android and adaway cripple my download speeds when running speedtest.net?

Adfree android is a little better than adaway (which really hurts my connection speeds), but I'm still seeing well over a 50% reduction in download speed when running adfree android. Now, my question is: is the speed reduction just a result of certain addresses being blocked that the speedtest.net app uses or is adfree's host changes really reducing the connection speeds? I'm debating whether blocking ads is really worth crippling my connection.
[Hero, G2 Touch General] p_025:
I haven't seen any kind of slowdown of Verizon's 4G LTE on my Samsung Stratosphere.

I still see some ads though in Angry Birds Seasons. I've seen ones for some Zillow thing, a hotel booking app and, of all things, the iPhone 4S. If I wanted a damn iPhone then I wouldn't have seen the ad in the first place. Please find those domains and filter them, this is starting to piss me off.
[Hero, G2 Touch General] motopig:
I am seeing that too. I also found that the 2012 seasons switched to Nexage for the ad engine and - worst of all - refuses to move between levels without an internet connection. To top it all off tcpdump bundled in AdFree have not been able to reliably capture any ad activity. I'm also seeing stray ads in AndroZip and TubeMate as well, but I do have a way to block all data in apps that otherwise should not need to go online ever.

EDIT: Looks like the Wreck the Halls update switched again to AdMob.
[Hero, G2 Touch General] bobbymokie:
Question, how can I tell what line to remove from the hosts file to no longer block a server? since installing adfree I can no longer view emails or click through to see sales from newegg, my all time favorite site for buying stuff I don't really need. It hurts. I see this in logcat, but don't know how it translates into the sites blocked by the hosts file. Any help would be appreciated
[Hero, G2 Touch General] StopSpazzing:
I second this, any help would be fully appreciated!
[Hero, G2 Touch General] baradharajan:
hi, i tired doing this on a Xpera arc -s , i have root acccess, when i do adb push hosts.for.mobile.txt /etc/hosts it says adb: not found, what could be the issue.

Regards,

M.Baradharajan
[Hero, G2 Touch General] wyco:
I'm having trouble getting this to work on ICS. Anyone else? [SGS2]
[Hero, G2 Touch General] jpinsl:
Works fine on my rooted Galaxy Nexus with ICS 4.0.4.

The app requires root. Are you stock?
[Hero, G2 Touch General] jleotta:
Two Problems with AdFree

I have found two problems:

1) When I go into options and as to see the host file in just hangs.

2) nytimes/adx/bin - needs to be added to host file.

I also find that sometime the ads are blocked from the NYTimes app and then they return. I have a Motorola Photon 4G running at 1.3 GHz.

Thanks!
[Hero, G2 Touch General] lost101:
Tried AdAway?
[Hero, G2 Touch General] Janfi_FR:
+1.

I'm using it on Hero and on my new phone, it works very well and it's full free software (GPL v3). Give it a chance !
[Hero, G2 Touch General] c_shekhar:
Great suggestion....

works great!!!!
[Hero, G2 Touch General] Syrebral:
AdAway is brilliant! So glad I read this thread and found it, massive thumbs up!
[Hero, G2 Touch General] 1ceb0x:
There is AdFree also :)
[Hero, G2 Touch General] TheWall279:
Sorry but this needs to be done. Your stealing from the developers. Put this in your application to view the hosts file and see if they are blocking the ads.

BufferedReader in = null;

Boolean result = true;

try {

in = new BufferedReader(new InputStreamReader(new FileInputStream("/etc/hosts")));

String line;

while ((line = in.readLine()) != null)

{

if (line.contains("admob")) // change this to whichever site you use

{

result = false;

break;

}

}

} catch(Exception e){}

if(result == false){

Toast.makeText(getApplicationContext(),"admob detected in /etc/hosts", Toast.LENGTH_LONG).show();

adBlockerFound();

}

public void adblockerFound(){

/**

Do all the bad stuff here. I usually use a dialog and simply notify the user but I still let them use the application. I pretty much give them a guilt trip. But if you wanna be nasty you can do this.finish();

Ive also seen people ask for SU and then make the hosts file writeable and edit the admob out during the readline()

**/

}
[Hero, G2 Touch General] Justyouforme:
Thank you