如何在 Android 中阻止特定网址

How to block specific urls in Android

我正在开发一种家长类型的应用程序,其中需要阻止设备中所有浏览器的特定 url。我认为这是一个老问题,但在堆栈中找不到任何解决方案。

您有任何可行的解决方案吗?假设 - 设备已获得 root 权限。

此致, 沙

我有两个资源给你:

  1. 由于设备已获得 root 权限,您可以直接使用 iptables. iptables will give you very precise control over all coming and going data packets. Check out open source projects like AFWall+ on GitHub for iptables in action。

  2. 如果您希望能够 运行 您的应用程序在无根设备上运行,请考虑创建一个假的 VPN。您不向实际的 VPN 服务器发送任何数据,您只需使用 VPN API 来过滤所有来来去去的信息。查看 Disconnect (whenever they actually share their open source code...) or OpenVPN Disconnect 的基础。