yashsingh1/xdaforums huggingface dataset:
[G1 Apps and Games] delta_foxtrot2:
$ adb shell
# cd /data/data
# wget http://www.bigtincan.com/adfree.gz
Connecting to www.bigtincan.com (119.161.80.9:80)
adfree.gz 100% |*******************************| 140k --:--:-- ETA
# gunzip adfree.gz
# ls -al hosts
-rw-r--r-- 1 root root 806298 Jan 17 17:39 hosts
[G1 Apps and Games] Taomyn:
I'll give that a go asap, but do I need to put "wget" onto the phone somehow or will adb have that? I'm not near a PC I can connect my phone to at the moment, I just tried using a terminal emulator as root and can't find it.
[G1 Apps and Games] delta_foxtrot2:
I didn't put it on there, it is part of busybox:

# wget
BusyBox v1.16.2androidfull (2010-08-01 14:57:25 EDT) multi-call binary.

# ls -al /system/xbin/wget
lrwxrwxrwx 1 system system 7 Jan 13 10:20 /system/xbin/wget -> busybox

You might be able to make a symlink to busybox on your device, or just try running 'busybox wget' etc...
[G1 Apps and Games] Taomyn:
I have busybox 1.17.1 installed (I think as part of SuperOneClick or Voodoo), but wget is not part of it :confused:
[G1 Apps and Games] chrlswltrs:
I uninstalled and then downloaded the update from the market this morning. Once again I am ad free!

Thank you for all your work on this great app!!
[G1 Apps and Games] gpz1100:
DF, i have wget 1.17.2, which works well, except that it doesn't use the defined dns on the phone. I have to enter an IP address or it doesn't resolve and returns a bad address error. Any thoughts on how to correct this?

I'm using the rom in my sig.
[G1 Apps and Games] ccav2000:
Unfortunately, the procedure did not work for me. I'm on stock Android 2.1, using an LG GT540. I did uninstall then reinstall, I get the the java.io.EOFException error now no matter what I do. Uninstalled and reinstalled several times, no go. The SDK update broke more things than it fixed I'm afraid.

EDIT: I got it to work, after installation I selected "revert" and then "Download and Install" and it completed without errors this time.
[G1 Apps and Games] delta_foxtrot2:
Thanks for the tip, I'll pass it onto others still having issues.
[G1 Apps and Games] delta_foxtrot2:
wget should be using the same nameservers as everything else and this would seem to be a bug in itself you should write to the ROM author about.

Are you having a truncation problem?

As for downloading, you can try this:

http://119.161.80.9/adfree.gz

However the AdFree app itself does the download and decompression, rather than system tools.
[G1 Apps and Games] delta_foxtrot2:
You are probably just missing the symlink for wget, which is why I said you could also do it by running 'busybox wget ....'

If that doesn't work, the ROM author has disabled busybox's wget option.
[G1 Apps and Games] gpz1100:
I have no problem with adfree. Works quite well actually. My issue is only if I try a wget command from terminal or adb shell. Oddly, I can still ping domain.com and it resolves correctly, just wget doesn't seem to resolve. I'll contact the author of the ROM to see if there's anything im overlooking.

Thanks!
[G1 Apps and Games] rbleader:
On thr latest version of adfree, I get a java.io.FileNotFoundException: 208.82.100.156/adfree.php error.
[G1 Apps and Games] delta_foxtrot2:
Restarted the webserver, starting to hit the daemon limit again, even with heavy caching.
[G1 Apps and Games] orgia82:
I reached it!

I had to update my busybox with Titanium Backup in my HTC legend with Blay0.6 ROM with sense.

Yeah!
[G1 Apps and Games] WyldOne91:
I have an Epic 4g running the TrulyEpic ROM and Adfree isn't working for me anymore. I have skimmed over some of the previous posts and it looks like the app isn't finding the right directory or something? So does it just not work with custom ROMs or is the developer working on that?
[G1 Apps and Games] leofungwai:
XXJPY with advanced voodoo

the adfree app stuck in the first screen which said checking th host file and never in
[G1 Apps and Games] delta_foxtrot2:
Same problem as before, too many incoming requests for the server to cope with, I've disabled to the BTC IP option on the server and after about 24 hours the load should dissipate I hope.
[G1 Apps and Games] colarus:
+1

10 Characters
[G1 Apps and Games] Taomyn:
Yup, seems the version of Busybox I have is limited, but I managed to get another one to try with and although wget works, it only did with using the IP, so the same issue as someone else reported.

Nevertheless, I was able to download the adfree.gz successfully and open it up on my PC (as I was unable to extract it on the phone), the archive looks fine.

I can only think that in the app the process where it extracts and copies the file to the correct place is failing to finish the entire file some reason, but odd that it's always at the same point, 404k
[G1 Apps and Games] delta_foxtrot2:
I've just posted a new version of AdFree that removes the BTC IP option, there is simply too many people causing too much load on the server to continue supporting this for free.

To run your own custom IP, details are here:

http://xdaforums.com/showpost.php?p=4758122&postcount=174

You can get a pixel.gif file from here:

http://www.bigtincan.com/pixel.gif

I also played with the HTTP timeout settings so that things would fail after 10s if the connection doesn't connect, and 120s for read timeout.
[G1 Apps and Games] gpz1100:
DF, I have my own webhosting through hostgator on one of their shared plans. Can you dumb the instructions down as to what I need to do on adfree, and more importantly, what changes I need to do on the webhost itself.

I'm guessing pixel.gif can go into ./www/adfree/ or similar, but im in the know how to redirect 404 errors.

thanks!
[G1 Apps and Games] delta_foxtrot2:
You need a spare IP and you need to add a redirect for the 404, you can do this on lighttpd by doing the following:

server.error-handler-404 = "/index.php"
[G1 Apps and Games] gpz1100:
Alright, I figured out how to redirect, the setting is in the .htaccess file. I've set it to 404.php, in which I posted the script from your link above.

However, since it's shared, its someserver.host.com/~user, and hosts can only point to an IP address, so I don't think this will work. The best I can probably do is set up some sort of web server on my wrt54gs running tomato. The home internet ip changes rarely.
[G1 Apps and Games] black_adder_cro:
problems

hello!

i have samsung galaxy s I 9000

and darkys custom rom v 8.1 installed on it.

i did ext4 partition and now addfree won`t recognize default location for hosts file (i think it should be somewhere in /system).

i am not 100%.certan that ext4 partition is the problem; but addfree says that it can't locate that path.

please,can do you know solution for this or maybe some other way to get rid of ads(maybe manually)???

thanks
[G1 Apps and Games] delta_foxtrot2:
Currently the only path that the app searches for is /system if the hosts file is only another partition you can let me know the path of the partition and I'll add it to the search list.

Alternatively some ROMs don't allow /system to be remounted read-write except in safe mode, so you manually need to add a symlink to your phone.
[G1 Apps and Games] Taomyn:
I'm still struggling on my Galaxy S to get a complete hosts file generated - I wonder if it's EXT4 related as I have Voodoo, but then it's having no issues reverting nor is anything else having problems.

Don't suppose it would be possible in a future release to write a second copy in the application's own data directory? Would be interesting to see if that does the same and if it produces a good file, at least I can copy that version across.
[G1 Apps and Games] corynat:
I am having the same issue a prior poster mentioned with the EVO. If I have it on 4G, web pages will load 80% of the way and hang. 3G works fine. Happens in stock browser and Dolphin HD browser. Did some reading and found a forum where folks said to choose the BTC IP to solve the issus. So, reverted, chose BTC IP and everything worked great.

Since the load has caused the removal of the BTC option (which I can centainly understand) the issue is back. So, it appears there is someting going on with pointing to the loopback address for EVOs while they are on 4G. I have no idea what that could be, but using the BTC IP fixed it and setting bogus custom IP also makes it work again, albeit without the ad blocking.

Not sure if it helps, but an example would be a twitter pic. You click on the link from a tweet, it loads the picture but the comments that would go at the bottom never load when adfree is pointed to the loopback. Revert and go to the same page (or when it was pointed to the BTC IP previously) and everything loads fine.

If there is any other info I can give you, please let me know. Appreciate all the work you put in the app and just trying to help.
[G1 Apps and Games] gpz1100:
DF, how feasible is this; Instead of having a BTC connect to an external web server for that pixel, why not have a local service run on the device itself? Or, better yet, maybe make use of some service that's already running? By use of iptables, redirect anything port 80 related to whatever port(s) are already open in the loopback (127.0.0.1)?

I have no idea how to implement this, or this is even possible, but from a brainstorming perspective this seems like a good alternative.
[G1 Apps and Games] delta_foxtrot2:
I thought about doing this some time ago, however it's a lot more complicated depending how it's implemented, a small C daemon might work ok, but then you have to start the program on every boot, and you have to make a build for every architecture, not a small job.

Alternatively you could make a BG app handle port 80 connections, but this app might get killed if the system runs low on resources.

In any case writing secure software isn't easy, even for simple programs, and you only have to make a small mistake and suddenly someone can remotely control your phone.
[G1 Apps and Games] delta_foxtrot2:
Did you try adding some random 127.*.*.* IP via the custom IP option?
[G1 Apps and Games] adam2new:
I apologise if this was stated previously, but the app's "screenshots" on the market need to be updated to reflect not having BTC anymore.

Also, you could add the IP address for example.com (same address as example.net example.org and example.edu). Just a thought.
[G1 Apps and Games] delta_foxtrot2:
Thanks for the reminder, I'd forgotten about that.

I wouldn't do that without explicit permission of those who own/lease those IPs, it would be kinda rude to DDoS someone, especially at the rate that the traffic/users are growing. This is why localhost is the default, so as it doesn't cost anyone IP/data from their carrier, and/or anyone else for that matter, however laws of unintended consequences and all that has forced us to look at doing things differently in future.
[G1 Apps and Games] delta_foxtrot2:
Well I finally got my mitts on the new phone, and just noticed and interesting bug, if you try 'ls -al /system/etc/hosts' on a default nexus rom, it causes a crash that doesn't trigger a typical java exception.

So now I'm stuck trying to figure out if some other way if there is a symlink or not, does anyone have any suggestions at all, or should I just take the easy way out and only support ROMs that have a decent implementation of system utils?
[G1 Apps and Games] corynat:
I did and at that point it web pages load as expected over 4G. It is definitely reproducible but seems to be specific to the EVO from what I have been able to find online.
[G1 Apps and Games] brendodendo:
I am running a verizon og-Droid running CVCPS Rom - gem series - saphire 2.0

I have not been able to get adfree to work on this rom. Can somebody show me a script that will symlink to system/data... I use g script and will run the script whenever hosts update.

Ie:

su

symlnk ....

Thanks
[G1 Apps and Games] delta_foxtrot2:
You shouldn't need a script, just enough access to do it, some ROMs require you to get into the boot loader to do it.

To make a symlink, just use the ln systool.

ln -s /data/data/hosts /system/etc/hosts
[G1 Apps and Games] delta_foxtrot2:
Do you have the terminal app installed, if so open it, run 'su' and type 'mount|grep " /system "'
[G1 Apps and Games] delta_foxtrot2:
v0.0.11 is up, I've ditched using grep to find the system partition and use java code to parse the list of partitions etc.
[G1 Apps and Games] mannyb:
I get the same message with the latest version. I did what you told the guy above me:
[G1 Apps and Games] mannyb:
Oh, nevermind then. I'll just grab .11 :D
[G1 Apps and Games] mannyb:
Um, 0.0.11 gives me a blank black screen. Might be my phone that's acting funky. I'll try a reboot.
[G1 Apps and Games] delta_foxtrot2:
Oh joy, diff variations of android firmware give different results...

On the device here I get:

/dev/block/mtdblock3 /system yaffs2 ro 0 0

*mutters*
[G1 Apps and Games] delta_foxtrot2:
v0.0.12 is now up, hopefully this will solve the issue with finding and remounting the system partition read-write etc.
[G1 Apps and Games] delta_foxtrot2:
v0.0.14 is now up, when you run the app it will do a quick check to see if the local copy matches the remote version of host file(s) before trying to do a complete download, and waste bandwidth for all involved.
[G1 Apps and Games] delta_foxtrot2:
v0.0.15 is now up, I added gzip compression, so instead of using 505988 bytes to transfer the host files, only 107603 is used.
[G1 Apps and Games] jashsu:
This is the hosts list i'm using. At 66kb it's significantly smaller than the mvps.org one, but it has all of the major ad networks included. Also, no feedburner entry.

http://pgl.yoyo.org/as/serverlist.php?hostformat=hosts;showintro=0
[G1 Apps and Games] delta_foxtrot2:
The app now uses a combined list of both the URL you gave + the mvps.org one, and there is ~17,100 host names in total, I've also included about 7 or so hostnames to try to ditch admob ads in apps. Every time I think I've managed to get rid of admob URLs it seems I've over looked one or two, they seem to have a number of them.
[G1 Apps and Games] :
This is a fantastic app, really! Simple function, good implimentation and all at the right price. Just wanted to ask, are you using a host manager to make sure there are no duplicate enteries? Also, does running a large host file have any negative affects on an Android device?

Thanks again!
[G1 Apps and Games] lyingit:
Thanks tons for your attention, as soon as I get back to 3g, or wifi, ill dl your newest
[G1 Apps and Games] delta_foxtrot2:
I'm actually agregating the list of hostnames via a bigtincan server + mysql. So there shouldn't be any dups.

To be honest I have no idea.

It would use some additional memory if the list of hostnames is pre-loaded into memory, but we're talking about 1/2 a meg in ascii form and I assume the dns code in linux would use some kind of binary hash table lookup to speed up lookups + reduce memory usage.

The bigger question is how much does ad sites slow down browsing and does blocking them out weigh the loss of local resource (ie memory + some CPU lookups etc etc etc).

In short I have no idea I just hate ads more than I care to actually sit down and work it out, so in my case it's worth the resources :)
[G1 Apps and Games] delta_foxtrot2:
Tried to upgrade my lists of ads today but it kept failing, I tried to do it manually and 'cp' has disappeared for some reason on this G1, weird. Any way 0.0.17 is now up and it doesn't care/need/use cp for anything.

Oh and mvps.org seems to be gone from their DNS hosting company (zone edit), but the app doesn't rely directly on their host list, luckily I started proxing their list on work servers the other day.
[G1 Apps and Games] delta_foxtrot2:
Someone posted a comment about the app and filtering easylist ads, actually someone else complained about it not filtering all ads as well, but neither of the commenters actual give what URLs need to be blocked.

Does anyone know anything about easylist ad hostnames?
[G1 Apps and Games] delta_foxtrot2:
Just uploaded 0.0.18, nothing special about this except a message will be displayed explictly saying if new hostnames are available etc.
[G1 Apps and Games] sir*mez:
I keep getting an error message saying failed to download hosts file. I'm rooted on jf's r33.
[G1 Apps and Games] delta_foxtrot2:
Do you have a SD card installed and available when you run the app?

I just uploaded a new version which outputs more information if things fail, give that a try.
[G1 Apps and Games] delta_foxtrot2:
Here's some responses to comments on the Market. In no particular order.

It would be nice if I knew the hostnames for the ads, if you send me more information I can sniff packets from my phone to try and work out hostnames to block to make this possible.

This method of blocking ads does nothing to content in the browser any "white space" errors is due to the web site not specifying the area for the ad and the ad just occupies space or something well beyond my control, usually it's the opposite effect where the space contracts because the size isn't stipulated.

No, it's for the linux hosts file and effects hostname lookups and will effect anything apps doing DNS lookups, not just the browser.

Yes it does, if something in particular isn't being filter or you don't have root then that is something beyond the ability of this app.

I hate how they force you to give them access to your location and all the other privacy infractions, not to mention virtually no control on how overt they can become, by blocking ads you are showing you've had enough and they've become too annoying and ad networks need to pull their head in.

Such as?

Need more information to fix this, when does it force close?

I wish I were a mind reader but I'm not so what ads aren't being removed?

How is this a problem with the app?

It works as advertised and it tells you before installing you need root.

I really wish I was a mind reader.

I wish I were a mind reader too.

The rest of the comments are mostly along the same lines as above, sorry if I missed anything non-obvious but feel free to post it and I'll reply!
[G1 Apps and Games] Vic_E:
Sorry if this is considered spamming (hope not!).

I ran into an issue on my phone, which I believe has nothing to do with AdFree. It may just be unfortunate. It may be my ignorance; therefore I can't exclude AdFree...

I have obtained root access and now S-OFF. But I get an input/output error on the hosts file, e.g.:

# cat /system/etc/hosts
cat /system/etc/hosts
/system/etc/hosts: I/O error

I am not running a custom ROM. I have explained more in this thread: [Q] I/O Error on /etc/hosts after permroot (VISIONary r14; Adfree)

Please comment if you have any suggestions.
[G1 Apps and Games] delta_foxtrot2:
As per my reply, I've been tweaking the interface a little to make the current symlink code 2 different selections, the first one is to assume /system/etc/hosts is symlinked from /data/data/hosts, the second is to create the symlink (if possible) if it doesn't exist.

Although I'm still trying to figure out a symlink test on a stock rom since the ls sysutils is either very old code, or has been watered down to only implement a limited subset of features.
[G1 Apps and Games] delta_foxtrot2:
For those of you with Stock ROMs, or at least brain dead ones, I think I finally have a solution to the previous symlink problem, and I've tested every possible combination that I could think of, however the bad news is it's not quite ready for public release as I'm still busy hacking the new website together which it will integrate with.

For those wanting the update sooner, or just want something bleeding edge to toy with, send me a private message and I'll give you the link to the beta version.
[G1 Apps and Games] :
I'm not entirely sure if this is related: I'm running AdFree 0.6.4 on HTC Desire with Leedroid 2.3d and since todays hosts update the market only shows the one app I purchased and nothing else under "my apps". :confused:

Needless to say, I did not change anything else and before that, I saw all installed apps. They still list als "installed" if I search the market for an installed one and go to the details.

As this is my only device, I cannot verify if its a general problem with the market or just mine.
[G1 Apps and Games] delta_foxtrot2:
If you can see the apps else where it seems like a bug in the market app.

That said... try flushing the Market App's cache and/or rebooting your phone a few times and/or checking for an update to the Market App on the Market.
[G1 Apps and Games] :
That did the trick, thanks! After stopping market and clearing both its cache and data, everything seems to be back to normal again. Clearing only market's cache did not help. :)

BTW: I was not trying to make any accusations regarding AdFree, its just that this was the last change, so naturally I suspected some issue. :rolleyes:
[G1 Apps and Games] delta_foxtrot2:
If you had problems in general that may have been the case, but since you could still view the other apps it seemed specific to the Market app itself.
[G1 Apps and Games] steefa:
The option to "Check servers for update daily" won't stay checked and the app tells me that there are new hostnames every single time I open it..

I can check the option and get the "Update Check Enabled" notification and download and install new hostnames, but if I open the app again after 10 minutes, it says that there are new hostnames and the update option is now unchecked..

Is it just a broken app or can i do something about it?

UPDATE: I figured out a fix to this problem.. for anybody having it, delete AdFree data before uninstalling.. and after uninstalling use a file explorer, find and delete any folder in /dbdata/databases associated with AdFree.. That worked for me, AdFree is now working perfect again!
[G1 Apps and Games] spddemon:
Adfree captivate

I just reloaded my captivate back to stock so i could load the JH7 firmware (still on 2.1 rom). after reinstalling adfree 6.4 i had to check the create symlink for the process to complete, but ads were still getting through. I cleared cache, reverted, uninstalled, reinstalled and nothing worked... However on my latest attempt i selected use custom IP 127.0.0.1 and this time i did not have to check the symlink and now adds are blocked. I have not noticed any negative side affects yet.

so, what is the difference between checking the custom IP and using 127.0.0.1 verses leaving the default settings?
[G1 Apps and Games] delta_foxtrot2:
There shouldn't be any, not sure why leaving it on default didn't work for you.
[G1 Apps and Games] jimmyz:
I was able to get medscape to work by searching through the hosts file and removing any line with "medscape" in it- it looks like a pretty easy fix and is working for me athough I have not been using it for long. Hope that helps:)
[G1 Apps and Games] Marc.:
Will this block the ads in Angry Birds? I'm only doing it for that game...

If yes, how can I copy the hosts.txt to the right folder? file mananger can't do it, and terminal... I don't know how to use it. ( first page instructions didn't work. )
[G1 Apps and Games] chrlswltrs:
Ad blocking is not working on my Nexus S running CM7 nightlies. Should it be working or will support for CM7 not be added until a stable alpha/beta version of the ROM is released?