如何使用 URL 过滤器列表监控和阻止流量?
我正在尝试创建一个应用程序来监视所有传入流量并在需要时阻止它,并在必要时将其替换为来自其他地方的流量。 (最好使用由 URL 组成的过滤器列表) 有没有可能的方法来做到这一点? 我搜索了谷歌和堆栈溢出,但找不到任何与我的需求相关的内容。 非常感谢您提前提供的任何帮助。
I'm trying to create an app that monitors all incoming traffic and blocks it if required and if necessary, replace it with traffic from elsewhere. (preferably using a filter list made up of URL's)
is there any possible way to do this?
I have searched Google, and stack overflow and I have not been able to find anything relevant to my needs.
thank you very much for any help in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这会很艰难。 Android 没有这样的主机文件。
我假设您不想开发自己的自定义 ROM(因为有自定义 ROM 允许您嗅探和过滤 Android 设备上来回的数据包)。
看一下广播接收器。广播接收器是实现此类功能的最佳选择。它们可以拦截 URL 浏览器调用、电话、短信等(假设没有其他广播接收器具有相同或更高的优先级)。
This will be tough. Android has no host file as such.
I assume you will not want to develop your own custom ROM (because there are custom ROMs that allow you to sniff and filter the packets going back and forth on an Android device).
Take a look at Broadcast Receivers. Broadcast Receivers are your best bet for that kind of functionality. They can intercept url browser calls, phone calls, SMS, etc. (assuming no other Broadcast Receivers are present with the same or higher priority).