Modify android WebView and create whitelist

51 Views Asked by At

This is my first time I'm asking question on stack overflow, so sorry if my question isn't clear, but I'll try my best. This question is for android developers. So I'm trying to create a system that prevents the user from opening web pages on the phone, but ze can still install apps. The purpose is for kids that spend too much time browsing, or people that don't want to watch cat videos (religion reasons, don't ask). Anyway, I'm doing it by modifying the ROM, and I have a problem. Of course I removed all the web browsers, but some apps that are not officially browsers contains a simple browser that uses Android System WebView (for example, outlook, Moovit). I want to some how block access to the WebView, but I saw it's complicated. I tried simply disable the WebView, but than i saw that i can't connect to Gmail and outlook at all, because the login page needs the WebView. I think that the solution is to modify the WebView and create a whitelist, so only sites like Gmail and outlook will open, but others will just show a blank page. The problem is that I don't know how to do that. Can anyone help? Thanks very much

1

There are 1 best solutions below

9
Gabe Sechan On

You're going about it the wrong way. If you want to block all but a whitelist of websites, install a Linux firewall on the device. Then you don't need to modify every component- if the OS blocks the site, nothing can reach it.