From 9f14ac224432f63963c2dd6687beb4db74e75266 Mon Sep 17 00:00:00 2001 From: Michael Diarmid Date: Wed, 23 Jan 2019 03:04:54 -0800 Subject: [PATCH] Add Network Security Config file (fixes #22375) (#23105) Summary: This fixes #22375. Android API level 28 and above now blocks all [clear text requests](https://developer.android.com/training/articles/security-config#CleartextTrafficPermitted) unless a network configuration rule is added to exclude it specifically. The packager falls into this category and therefore gets blocked; resulting in the app being unable to connect to it. Domains/IPs for the config have been taken from [here](https://github.com/facebook/react-native/blob/master/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/AndroidInfoHelpers.java#L20-L22). This change only adds to DevSupport android resources - so won't affect builds without DevSupport, e.g. release builds. Changelog: ---------- [ANDROID] [DevSupport] add Network Security Config file to allow access to packager via cleartext requests in Android API 28 and above. (fixes #22375) Pull Request resolved: https://github.com/facebook/react-native/pull/23105 Differential Revision: D13781516 Pulled By: cpojer fbshipit-source-id: f7574f3e1b0fe6984efe1d0598ef631385c245bc --- .../main/res/devsupport/xml/network_security_config.xml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 ReactAndroid/src/main/res/devsupport/xml/network_security_config.xml diff --git a/ReactAndroid/src/main/res/devsupport/xml/network_security_config.xml b/ReactAndroid/src/main/res/devsupport/xml/network_security_config.xml new file mode 100644 index 00000000000000..ba4b23070be6cc --- /dev/null +++ b/ReactAndroid/src/main/res/devsupport/xml/network_security_config.xml @@ -0,0 +1,8 @@ + + + + localhost + 10.0.2.2 + 10.0.3.2 + +