如何prevent广告拦截从拦截广告上的应用程序 [英] How to prevent ad blocker from blocking ads on an app

查看:178
本文介绍了如何prevent广告拦截从拦截广告上的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的一个用户让猫的袋子,并告诉我他们使用了我的免费应用程序,这是由广告货币化的,但他们被阻止与广告拦截广告。他们告诉我这个嘲弄,因为如果我不能做任何事情。

One of my users let the cat out of the bag and told me they were using one of my free apps, which is monetized by ads, but they were blocking the ads with an ad blocker. They told me this mockingly, as if I can't do anything about it.

我能做些什么呢?有没有一种方法来检测广告被阻止?

Can I do something about it? Is there a way to detect that ads are being blocked?

推荐答案

我知道的一种方式,广告拦截工程(在任何计算机上真的),他们编辑hosts文件指向本地主机的所有已知的广告服务器。为Android这个位于etc / hosts文件的文件。

I am aware of one way that ad blocking works (on any computer really), they edit the hosts file to point to localhost for all known ad servers. For android this is located in the "etc/hosts" file.

例如,我使用AdMob的广告和我已经从定制ROM主机文件列出了如下因素AdMob的条目:

For example, I use admob ads and a host file that I have taken from custom rom lists the folowing admob entries:

127.0.0.1 analytics.admob.com
127.0.0.1 mmv.admob.com
127.0.0.1 mm.admob.com
127.0.0.1 admob.com
127.0.0.1 a.admob.com
127.0.0.1 jp.admob.com
127.0.0.1 c.admob.com
127.0.0.1 p.admob.com
127.0.0.1 mm1.vip.sc1.admob.com
127.0.0.1 media.admob.com
127.0.0.1 e.admob.com

现在任何时候一个进程试图解决他们被路由到在这种情况下,上市对他们(本地)左侧的地址,上面的地址。

Now anytime a process tries to resolve the above addresses they are routed to the address listed to the left of them (localhost) in this case.

我在做我的应用程序是检查该主机文件,并查找任何AdMob的作品,如果我发现我的任何通知,我已经检测到的广告拦截用户,告诉他们从那里取出AdMob的条目,并do't允许他们使用的应用程序中。

What I do in my apps is check this host file and look for any admob entries, if I find any I notify the user that I've detected ad blocking and tell them to remove admob entries from there and do't allow them use of the app.

毕竟有什么好处呢我,如果他们没有看到广告?没有一点让他们使用的应用程序是免费的。

After all what good does it do me if they're not seeing ads? No point in letting them use the app for free.

下面是我如何做到这一点的code片断:

Here is a code snippet of how I achieve that:

        BufferedReader in = null;

    try 
    {
        in = new BufferedReader(new InputStreamReader(
                new FileInputStream("/etc/hosts")));
        String line;

        while ((line = in.readLine()) != null)
        {
            if (line.contains("admob"))
            {
                result = false;
                break;
            }
        }
    } 

我发誓,所有的广告支持的应用程序应该检查这个文件。你并不需要root权限才能访问它,但写它可能是一个不同的故事。

I vow that all ad supported apps should check this file. You do not need to be root in order to access it, but writing to it might be a different story.

另外,不知道是否有作用于一个基于Linux的操作系统相同的任何其他文件,但无论如何,我们可以随时查询所有这些文件。

Also, not sure if there is any other files that act the same on a linux based OS, but at any rate we can always check all of those files.

在改善这种欢迎任何建议。

Any suggestions on improving this are welcome.

也叫广告免费的Andr​​oid的应用程序需要root权限,这意味着它很可能改变了主机,以实现它的目标文件。

Also the app called "Ad Free android" needs root access, meaning that it most likely changes the hosts file in order to achieve its goal.

这篇关于如何prevent广告拦截从拦截广告上的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆