Skip to content

Commit 3b0b7ce

Browse files
Salakarfacebook-github-bot
authored andcommitted
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: #23105 Differential Revision: D13781516 Pulled By: cpojer fbshipit-source-id: f7574f3e1b0fe6984efe1d0598ef631385c245bc
1 parent 25f7b0e commit 3b0b7ce

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<network-security-config>
3+
<domain-config cleartextTrafficPermitted="true">
4+
<domain includeSubdomains="false">localhost</domain>
5+
<domain includeSubdomains="false">10.0.2.2</domain>
6+
<domain includeSubdomains="false">10.0.3.2</domain>
7+
</domain-config>
8+
</network-security-config>

0 commit comments

Comments
 (0)