[TIMOB-24516] Android N: Implement support for Network security configs
| GitHub Issue | n/a |
|---|---|
| Type | New Feature |
| Priority | Critical |
| Status | Closed |
| Resolution | Done |
| Resolution Date | 2018-07-16T22:52:16.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | n/a |
| Components | n/a |
| Labels | n/a |
| Reporter | Eric Merriman |
| Assignee | Joshua Quick |
| Created | 2017-03-20T20:26:13.000+0000 |
| Updated | 2018-07-16T22:52:43.000+0000 |
Description
Specifies level of security and response/behaviour for corresponding level.
We already have capability to do this via a our custom AndroidManifest.xml write ability. Note that feature is dependent on: https://github.com/appcelerator/titanium_mobile/pull/8961 due to introduction of new attribute. Demo:
in platform/android/res/xml/network_security_config.xml:<android xmlns:android="http://schemas.android.com/apk/res/android"> <uses-sdk android:targetSdkVersion="24"/> <manifest> <application android:networkSecurityConfig="@xml/network_security_config"> </application> </manifest> </android>and the certificate is placed in placed platform/android/res/raw. In this example, the file is called trusted_roots.<network-security-config> <domain-config> <domain includeSubdomains="true">secure.example.com</domain> <domain includeSubdomains="true">cdn.example.com</domain> <trust-anchors> <certificates src="@raw/trusted_roots"/> </trust-anchors> </domain-config> </network-security-config>