Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Block other apps from accessing the internet

Tags:

android

block

In my app I want the user to create a blacklist of apps that will not be allowed internet access. How might I prevent certain other apps from accessing the internet?

It's a parental control app. I want to make sure only the browser with filtering is allowed internet access and not any other browsers(other apps are OK, just not browsers).

like image 341
John Avatar asked Nov 14 '22 02:11

John


2 Answers

Like what Ad Free is doing, you can go on with a root access and edit the host file to block the websites related to or used by the apps.

like image 113
mauris Avatar answered Dec 05 '22 09:12

mauris


I think you could maybe create a proxy application that runs as a background service. You could then set your browser up to use localhost as the proxy server.

The service will have to listen on port 80 for HTTP requests from the browser, create a real internet request, download the content and post it back to the browser in it's response.

You could then filter and deny any unwanted requests by looking at the URL that the browser is requesting.

There are a few problems with this though, the main one being there is nothing to stop the user from turning off the proxy themselves.

like image 20
BG100 Avatar answered Dec 05 '22 08:12

BG100