3

I have just tried this adblocker app for Android, and it does seem to be working quite effectively, I tried it with some popular apps like Angry Birds and Cut the Rope.

Does anyone know how it works? I tought Android processes can't mess with one another?

1
  • You can take a look at its code if you want so. It's an open-source app.
    – Firelord
    Jun 10, 2015 at 18:46

2 Answers 2

1

AdBlock Plus uses two methods, depending on your device/setup:

For non-root on modern Android with certain devices, it changes the network proxy settings.

For root devices, it uses the classic hosts file loopback trick which alters the DNS lookup. (Instead of returning the real IP address for www.some-ad.com it returns the local loopback IP, which won't return the ad.)

Either way, at the OS network level the network settings the ad blocker changes causes Android not too request the ad at all, but instead sends back an empty or dummy HTTP response to the app.

Since the ad request was never sent, the ad networks can't track you and of course then can't show an image or ad.

See more details on the AdBlock FAQ.

1

The F-Droid description of AdAway, (which is a popular adblocker) is described as:

An ad blocker that uses the hosts file. The hosts file contains a list of mappings between hostnames and IP addresses. When an app requests an ad, that request is directed to 127.0.0.1 which does nothing.

So, an adblocker redirects an app's ad requests to an IP address which produces a blank result, which prevents the ad from being visible.

5
  • but how exactly does it redirect them, does it intercept the incoming traffic, or somehow messes with the other app's processes?
    – Borislav
    Jun 10, 2015 at 13:43
  • As far as I know, it intercepts the incoming traffic. AdAway has a feature where you can see what traffic is coming in to your device, so that would support that hypothesis.
    – 1990clb
    Jun 10, 2015 at 13:59
  • 2
    @1990clb apples and plums :) OP uses AdblockPlus (from the URL in the question). Sure that works the same? It cannot modify the hosts file without root permissions. As for how the hosts blocking works: It doesn't interfere with any traffic. If the client requests e.g. www.example-spam-host.com/example.jpg, it needs to have the IP address for that host. It first looks in the hosts file and, if not found there, asks the name server. So the hosts file has the line www.example-spam-host.com 127.0.0.1, which makes the client use that IP (localhost) – where nothing has the example.jpg.
    – Izzy
    Jun 10, 2015 at 14:30
  • I think it not block hosts, maybe redirect/rewrite request (like an .htaccess for a website) . More convenient is to scan app for identifiers, organized as lists see for reference easylist-downloads.adblockplus.org/easylist.txt .The app scans for trafic (in /out) and abort rendering of elements contained in lists. (Interesting list anyway :) )
    – ares777
    Jun 10, 2015 at 15:38
  • 1
    can the users who have downvoted give some insight as to the reason why? With your suggestions I will endeavour to improve my answer.
    – 1990clb
    Jun 12, 2015 at 15:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .