1

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

NoobNinja
  • 123
  • 2
  • 14

1 Answers1

6

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.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • I've seen it done before: https://play.google.com/store/apps/details?id=com.netspark.firewall&feature=search_result#?t=W251bGwsMSwxLDEsImNvbS5uZXRzcGFyay5maXJld2FsbCJd ...and I've been hired to do it again. I just need the input from the correct set of minds (perhaps someone who has a bit of experience doing such things - it's a totally legit project - my boss owns the patent - the app just so happens to require a firewall component) – NoobNinja Mar 25 '13 at 19:35
  • @NoobNinja: "I've seen it done before" -- not using "Broadcast Receivers and the ActivityManager class", which was your stated requirement. That being said, I updated my answer to reflect this requirement. – CommonsWare Mar 25 '13 at 19:47
  • Ok - It doesn't really matter how it can be done... as long as it can be done! (Any ideas on how it COULD be done? By any means necessary of course!) – NoobNinja Mar 25 '13 at 19:48
  • Ok - so it might be possible using VpnService (good to know - thank you!) do you think there's a way to automate the process? I'd like to have the app be as simple as possible - having the user manually setup a VPN seems tedious. – NoobNinja Mar 25 '13 at 19:59
  • 1
    @NoobNinja: "do you think there's a way to automate the process?" -- I sure hope not, otherwise that would be a security flaw that I would have to track down and get fixed. – CommonsWare Mar 25 '13 at 20:01
  • It doesnt matter if it's totally automated or just very simple as long as it isn't difficult for the user to implement. Is building a parental control app totally off the drawing board? I feel like this is possible if implemented correctly. – NoobNinja Mar 25 '13 at 20:09
  • I don't mind meeting security protocols - I just want to keep the kids off the (dirty) tubes after midnight – NoobNinja Mar 25 '13 at 20:13
  • @NoobNinja: "Is building a parental control app totally off the drawing board?" -- no, but the user has to go in and set up the fake VPN connection. A "parental control app" is indistinguishable from malware, in that it tries to take control of the device out of the hands of the person that is holding it and put it in somebody else's hands. Android does not allow malware to automatically intercept communications, for hopefully obvious reasons. Hence, parental control apps will need some amount of user setup in Settings. – CommonsWare Mar 25 '13 at 20:21
  • That is totally fine... I don't mind an initial setup menu (it's going to need one- I just need to figure out how the core components of the app are going to work) – NoobNinja Mar 25 '13 at 20:28
  • Any suggestions on a starting point for further research into how I'd go about using VpnService to accomplish creating a basic firewall? – NoobNinja Mar 25 '13 at 20:29
  • @NoobNinja: There is a "toy VPN" in the SDK samples. – CommonsWare Mar 25 '13 at 20:29
  • This information is useful... (thank you!) Do you by any chance know of a simpler way of controlling / setting rules to a wireless router for an android device? (I just want to make sure I'm not overthinking/programming this) – NoobNinja Mar 25 '13 at 20:46
  • @NoobNinja I've to do a similar app (like Mobiwol), have you got any answers or any tips for how to start? – Filipe Mota Oct 31 '13 at 14:39