简体   繁体   English

如何使用URL的过滤器列表监视和阻止流量?

[英]How can I monitor and block traffic using a filter list of URL's?

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? (最好使用由URL组成的过滤器列表)有没有可能这样做? I have searched Google, and stack overflow and I have not been able to find anything relevant to my needs. 我已经搜索过Google,并且堆栈溢出,但找不到任何与我的需求相关的东西。 thank you very much for any help in advance. 非常感谢您的任何提前帮助。

This will be tough. 这将是艰难的。 Android has no host file as such. Android没有此类主机文件。

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). 我假设您不想开发自己的自定义ROM(因为有自定义ROM允许您嗅探和过滤在Android设备上来回传输的数据包)。

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). 他们可以拦截URL浏览器呼叫,电话呼叫,SMS等(假设没有其他具有相同或更高优先级的广播接收器出现)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM