How could one create a firewall app in Android?

筅森魡賤 提交于 2019-12-06 14:05:04

问题


I'm building a parental control app that blocks access to certain sites - aka a simple firewall for Android. What do you think the simplest method of doing this would be?

I've seen other applications use VpnService to monitor the traffic - but I'm looking for any and all suggestions, methods and ideas related to this subject.

Thus far I've built the UI for the application - it stores all the user data necessary for each user profile - now it's time to make it function and block some traffic (for example - when a kid logs onto a porn site after midnight!)

Any and all ideas / input is greatly appreciated!

(and of course - the simpler the implementation: the better!)

NoobNinja


回答1:


I'm starting to do a bit of research into what it would take to develop a simple firewall that would monitor browser traffic via a combination of Broadcast Receivers and the ActivityManager class.

Fortunately, this is not possible, for obvious privacy and security reasons. You cannot unilaterally spy on other apps' traffic using "Broadcast Receivers and the ActivityManager class".

What the app in question uses is a VpnService to pretend to be a VPN connection, and spy on other apps' traffic that way. This requires the user to actually set up the app as a VPN provider and use it for a VPN connection.



来源:https://stackoverflow.com/questions/15623110/how-could-one-create-a-firewall-app-in-android

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