I am trying to test out Admob for an app on my phone. But I have absolutely no idea what is blocking my ads. My phone is rooted, but I don't have any ad-blocking software. I did have AdFree, but then I restored my phone. So what's doing it? My ads are definitely being blocked because I have gone on several websites with ads, and they don't show up.
3 Answers
Well after an hour of searching around for how to revert the hosts file, I gave up. (I kept having permission denied errors). So I downloaded AdFree again (turns out that's what I had before) and clicked "revert".
-
-
-
Safe to mark your own answer as Answer then. :) Did you have to restart? Jul 23, 2013 at 6:21
-
2@geffchang Can't accept my answer till tomorrow. No I didn't have to restart Jul 23, 2013 at 21:17
Are you using a custom ROM? It may have adblock enabled behind the scenes.
As a work-around, try the Ad Block REMOVER.
Looking at what the app does, and the fact that it needs Root, it looks like one of the methods that it uses to block ads is to make changes to the device's central hosts file.1 2
This changes the way that DNS works on the device so that any requests by an app to connect to certain internet servers are given a bogus IP address, and the attempt to talk to the ad serving server fails.
In fact it looks like AdFree downloads and uses the MVPS list of HOSTS file entries list of host file entries (the file is available for download here).
Based on that I would assume that what's happened is that when you were using AdFree it downloaded that list of HOSTS file entries and saved them into the central HOSTS file on your phone (this would require root access), but when you uninstalled the app it didn't undo the changes it made to the HOSTS file.
If you just want to be able to connect to AdMob servers to test your app then you could edit your HOSTS file to remove just Google's Admob servers from the list, it looks like they're all called something.admob.com
. Alternatively you could edit your HOSTS file and remove all entries from it that point to 127.0.01, which should set you back to a default setup, with nothing being blocked. More on editing your hosts file here: Guide to editing /etc/hosts.
127.0.0.1 ad_website.com
I tried the Ad Block Remover, but it didn't work (or i'm not doing it right, idk).