Skip to content

Commit

Permalink
improve Android Network Security config (#23429)
Browse files Browse the repository at this point in the history
Summary:
This PR is trying to improve Android Network Security configuration introduced in 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: #23429

Differential Revision: D14065124

Pulled By: cpojer

fbshipit-source-id: 0f5ac5addbe968ed7e5cb57f356e2572de2690a8
  • Loading branch information
dulmandakh authored and facebook-github-bot committed Feb 13, 2019
1 parent e4fac61 commit 5747094
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
5 changes: 5 additions & 0 deletions template/android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" android:networkSecurityConfig="@xml/react_native_config" />
</manifest>
5 changes: 1 addition & 4 deletions template/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.helloworld">

<uses-permission android:name="android.permission.INTERNET" />
Expand All @@ -11,9 +10,7 @@
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="@style/AppTheme"
android:networkSecurityConfig="@xml/network_security_config"
tools:ignore="GoogleAppIndexingWarning,UnusedAttribute">
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
Expand Down

This file was deleted.

0 comments on commit 5747094

Please sign in to comment.