在 Android P 中,默认情况下禁用明文通信。相反,有两种选择:
我的问题与第二种方法有关。我可以在 network_security_config.xml 中将这样的特定 IP 地址列入白名单
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">192.168.1.1</domain>
</domain-config>
</network-security-config>
Run Code Online (Sandbox Code Playgroud)
但是,我想将所有私有 IP 地址列入白名单。我有一些反复试验的案例,但我无法让它发挥作用。
本质上,是否提供了在网络安全配置中定义IP 地址范围的选项?