Skip to content

Commit 6012383

Browse files
dulmandakhgrabbou
authored andcommitted
improve Android Network Security config (facebook#23429)
Summary: This PR is trying to improve Android Network Security configuration introduced in facebook@84572c4. I found that Android merges all manifest files into a single manifest file when building an app, so this PR provides AndroidManifest.xml with network security config in debug folder, that will be used only for debug builds. Also the network security configuration will be applied to only app that target API 28. Moved security config file to xml-v28, so that it'll only visible to API 28 and above. See https://developer.android.com/studio/build/manifest-merge [Android] [Changed] - Android Network Security configuration. Pull Request resolved: facebook#23429 Differential Revision: D14065124 Pulled By: cpojer fbshipit-source-id: 0f5ac5addbe968ed7e5cb57f356e2572de2690a8
1 parent 5a3ffc9 commit 6012383

File tree

4 files changed

+6
-12
lines changed

4 files changed

+6
-12
lines changed

local-cli/templates/HelloWorld/android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
xmlns:tools="http://schemas.android.com/tools"
32
package="com.helloworld">
43

54
<uses-permission android:name="android.permission.INTERNET" />
@@ -11,9 +10,7 @@
1110
android:icon="@mipmap/ic_launcher"
1211
android:roundIcon="@mipmap/ic_launcher_round"
1312
android:allowBackup="false"
14-
android:theme="@style/AppTheme"
15-
android:networkSecurityConfig="@xml/network_security_config"
16-
tools:ignore="GoogleAppIndexingWarning,UnusedAttribute">
13+
android:theme="@style/AppTheme">
1714
<activity
1815
android:name=".MainActivity"
1916
android:label="@string/app_name"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools">
4+
<application tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" android:networkSecurityConfig="@xml/react_native_config" />
5+
</manifest>

template/android/app/src/release/res/xml/network_security_config.xml

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)