如何在Android上实现网站过滤?

时间:2021-05-16 14:32:28

I have to implement something that filters websites on Android devices (adult websites etc) as a uni project, but unfortunately have very little knowledge in this subject... What are possible solutions here? I would be very grateful if someone could just point me in the right direction(s). Then I can investigate further. I just need a summary of all possible general principles that are applicable for this, I guess, and what would be easiest to implement maybe.

我必须实现将Android设备(成人网站等)上的网站过滤为uni项目的东西,但不幸的是,这个主题知之甚少......这里有什么可能的解决方案?如果有人能指出我正确的方向,我将非常感激。然后我可以进一步调查。我只需要总结适用于此的所有可能的一般原则,我想,最简单的实现可能。

From my understanding, you can...

根据我的理解,你可以......

  • use a proxy server and do the filtering there
  • 使用代理服务器并在那里进行过滤
  • use iptables to block calls to some websites
  • 使用iptables阻止对某些网站的调用
  • somehow set dns to point to a custom dns server/ a dns server with a filter
  • 以某种方式将dns设置为指向具有过滤器的自定义DNS服务器/ dns服务器

I guess it would be easiest to implement it on client side (iptables maybe) but I at least really would like to know what possibilities exist.

我想在客户端(也许是iptables)实现它是最简单的,但我至少真的想知道存在哪些可能性。

2 个解决方案

#1


0  

The only idea comes to in my mind HostTable and DNS Server,

唯一的想法是在我看来HostTable和DNS服务器,

There are no content blocking controls built in to the browser itself, but with superuser permissions you can filter any url you want. This method means you have to know what urls you want to block, add them to the hosts table, then "install" the hosts table on your Android. Look at Android Using the Hosts Table

浏览器本身没有内置阻止控件,但具有超级用户权限,您可以筛选所需的任何URL。此方法意味着您必须知道要阻止的URL,将它们添加到hosts表,然后在Android上“安装”hosts表。查看Android使用主机表

Also at these Google App Engine and this SO Question

还有这些Google App Engine和这个SO问题

#2


0  

Actually, it's going to be really hard to implement on the client side because in order to use something like iptable you're going to need to have root on the device. Android is made in such away that a regular old app cant interfere with low-level things like restricting website access. It's probably possible, but it's gonna be a real headache. I think the easiest thing for you to do is implement a custom DNS server actually and just filter all the requests from there.

实际上,在客户端实现起来真的很难,因为为了使用像iptable这样的东西,你需要在设备上拥有root权限。 Android就是这样做的,一个普通的旧应用程序无法干扰限制网站访问等低级别的东西。这可能是可能的,但这将是一个真正的头痛。我认为最简单的方法是实际实现自定义DNS服务器,只过滤掉那里的所有请求。

#1


0  

The only idea comes to in my mind HostTable and DNS Server,

唯一的想法是在我看来HostTable和DNS服务器,

There are no content blocking controls built in to the browser itself, but with superuser permissions you can filter any url you want. This method means you have to know what urls you want to block, add them to the hosts table, then "install" the hosts table on your Android. Look at Android Using the Hosts Table

浏览器本身没有内置阻止控件,但具有超级用户权限,您可以筛选所需的任何URL。此方法意味着您必须知道要阻止的URL,将它们添加到hosts表,然后在Android上“安装”hosts表。查看Android使用主机表

Also at these Google App Engine and this SO Question

还有这些Google App Engine和这个SO问题

#2


0  

Actually, it's going to be really hard to implement on the client side because in order to use something like iptable you're going to need to have root on the device. Android is made in such away that a regular old app cant interfere with low-level things like restricting website access. It's probably possible, but it's gonna be a real headache. I think the easiest thing for you to do is implement a custom DNS server actually and just filter all the requests from there.

实际上,在客户端实现起来真的很难,因为为了使用像iptable这样的东西,你需要在设备上拥有root权限。 Android就是这样做的,一个普通的旧应用程序无法干扰限制网站访问等低级别的东西。这可能是可能的,但这将是一个真正的头痛。我认为最简单的方法是实际实现自定义DNS服务器,只过滤掉那里的所有请求。