嗨,network_security_config 中是否可以有多個子域?
請參見下面的示例:我找不到任何具有多個示例的示例。
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="false">
<domain includeSubdomains="true">whatever.com</domain>
<domain includeSubdomains="true">anotherone.com</domain>
<pin-set>
<pin digest="SHA-256">whatever.compinhere</pin>
<pin digest="SHA-256">anotherone.compinhere/TLRbotnEw=</pin>
<!-- backup pin -->
<pin digest="SHA-256">backuppinwhatever.compinhere</pin>
<pin digest="SHA-256">backuppinanotherone.compinhere/TLRbotnEw=</pin>
</pin-set>
</domain-config>
</network-security-config>
或者下面是正確的
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="false">
<domain includeSubdomains="true">whatever.com</domain>
<pin-set>
<pin digest="SHA-256">whatever.com in here</pin>
<!-- backup pin -->
</pin-set>
</domain-config>
<domain-config cleartextTrafficPermitted="false">
<domain includeSubdomains="true">anotherone.com</domain>
<pin-set>
<pin digest="SHA-256">anotherone.cominhere</pin>
<!-- backup pin -->
</pin-set>
</domain-config>
</network-security-config>
以上哪一項是有效的方法?非常感謝
uj5u.com熱心網友回復:
根據官方檔案,network_security_configcan 包含任意數量,<domain-config>can<domain-config>包含 0 或 1 <pin-set>,其中可以包含任意數量的<pin>.
因此,您提供的兩個示例似乎都是正確的。
如果您需要更多資訊,請查看官方檔案: https ://developer.android.com/training/articles/security-config
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/450818.html
