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

笑着哭i 提交于 2019-12-12 01:49:28

问题


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.


回答1:


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).



来源:https://stackoverflow.com/questions/7439101/how-can-i-monitor-and-block-traffic-using-a-filter-list-of-urls

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!