Reputation: 13
I want to block internet access of some certain apps. As UID (User ID) is unique for each application and stays constant as long as app is not re-installed.Is it possible to block the internet access of app on the basis of UID? For Non-rooted phone
Upvotes: 1
Views: 744
Reputation: 1509
If the phone is rooted and your app is running as root, then yes it is possible. Or, if your app is running as a System app on the device, it is also possible. For any other condition, it is not possible.
Upvotes: 0
Reputation: 9617
Yes, with rooted phone, you can install iptables and set up firewall rules that blocks all internet traffic for that user:
iptables -A INPUT -m owner --uid-owner $UID -j DROP
iptables -A OUTPUT -m owner --uid-owner $UID -j DROP
Upvotes: 1