-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[android] apply Network Security Config file (fixes #22375) (part 2 of #23105) #23135
Conversation
Generated by 🚫 dangerJS |
@Salakar thanks for making progress and also mentioning me. Now what you do is use This is because when you install react-native from NPM, it comes with only one AAR file, the one named react-native-0.56.1.aar somewhere inside in I'm not going to suggest editing Instead you can move
Basically we do the same thing described in https://stackoverflow.com/a/46321866 Note that this solution obviously does not work for brownfield apps that wasn't started from the helloworld template in this repo, so they would have to manually add those 2 files. I think that's acceptable, but I'm not authority here :) |
Ah damn, @hey99xx you're right again 🙈 this change would only apply when using RN from source like I was locally, completely forgot it gets distributed as an AAR - which this change won't apply to the bundled AAR that gets publish alongside on NPM >.> I can apply it to the template but like you said this only works for apps that began with this template after the change. I may have an alternative though; I can move it to the main manifest and wrap the security config in a |
You can try, but as far as I recall it won't work, I've tried it myself in the past 🙃. Maybe you can ask in the Discord channel for alternative solutions (such as releasing debug and release AARs, but I feel it's too much trouble for this issue). Unfortunately I don't know a better way. As long as the solution is mentioned in Android tab at https://facebook.github.io/react-native/docs/integration-with-existing-apps I personally think it's ok. |
😭 right, ok. I will ask about the AARs but I also feel it's far too much trouble. I think this may just be a case of applying this to the template project & tests project only and then pair with some documentation for non-template based apps. |
@Salakar do you have any update on this PR? |
@cpojer sorry for the delay getting back to you, 🙈I've been been held up with prior OSS commitments this week - I've not forgotten I owe you a writeup for this as per Discord. Will get this done by Friday latest 👍 |
This reverts commit 1f15078
This reverts commit a89e878
…ences)" This reverts commit dedd9a5
…book#23105)" This reverts commit 9f14ac2
Hey @cpojer; I've updated this to apply only to the I've also updated the PR description to reflect the above + added testing screenshots. I will also follow up with a separate docs PR to https://facebook.github.io/react-native/docs/integration-with-existing-apps - to document this for existing apps that aren't using the template. |
how about having single config file, but use debug-overrides in it as described in https://developer.android.com/training/articles/security-config. so it'll be empty for non-debug builds. |
@dulmandakh thanks for the suggestion, see the comments above, specifically;
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making this change, and yeah it seems like we need to make sure this is applied to new templates going forward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cpojer is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
…acebook#23105) (facebook#23135) Summary: This is a follow-up PR for facebook#23105 - as mentioned on discord. --- This PR applies the network security config for the RN template project only. New RN projects started with the updated template will be able to connect to the packager on builds built with Android API 28 & above. See https://developer.android.com/training/articles/security-config#CleartextTrafficPermitted for more information about this newly required config, specifically: ![image](https://user-images.githubusercontent.com/5347038/52124287-b3de2580-2620-11e9-958d-bc2da15c6f01.png) Changelog: ---------- [ANDROID] [Template] add Network Security Config file to allow access to packager via cleartext requests in Android API 28 and above. (fixes facebook#22375) Pull Request resolved: facebook#23135 Differential Revision: D13917058 Pulled By: cpojer fbshipit-source-id: 0e66f2cde712c1285d217e3625b73028c3770b65
…23135) Summary: This is a follow-up PR for #23105 - as mentioned on discord. --- This PR applies the network security config for the RN template project only. New RN projects started with the updated template will be able to connect to the packager on builds built with Android API 28 & above. See https://developer.android.com/training/articles/security-config#CleartextTrafficPermitted for more information about this newly required config, specifically: ![image](https://user-images.githubusercontent.com/5347038/52124287-b3de2580-2620-11e9-958d-bc2da15c6f01.png) Changelog: ---------- [ANDROID] [Template] add Network Security Config file to allow access to packager via cleartext requests in Android API 28 and above. (fixes #22375) Pull Request resolved: #23135 Differential Revision: D13917058 Pulled By: cpojer fbshipit-source-id: 0e66f2cde712c1285d217e3625b73028c3770b65
…acebook#23105) (facebook#23135) Summary: This is a follow-up PR for facebook#23105 - as mentioned on discord. --- This PR applies the network security config for the RN template project only. New RN projects started with the updated template will be able to connect to the packager on builds built with Android API 28 & above. See https://developer.android.com/training/articles/security-config#CleartextTrafficPermitted for more information about this newly required config, specifically: ![image](https://user-images.githubusercontent.com/5347038/52124287-b3de2580-2620-11e9-958d-bc2da15c6f01.png) Changelog: ---------- [ANDROID] [Template] add Network Security Config file to allow access to packager via cleartext requests in Android API 28 and above. (fixes facebook#22375) Pull Request resolved: facebook#23135 Differential Revision: D13917058 Pulled By: cpojer fbshipit-source-id: 0e66f2cde712c1285d217e3625b73028c3770b65
This is a follow-up PR for #23105 - as mentioned on discord.
This PR applies the network security config for the RN template project only. New RN projects started with the updated template will be able to connect to the packager on builds built with Android API 28 & above.
See https://developer.android.com/training/articles/security-config#CleartextTrafficPermitted for more information about this newly required config, specifically:
Changelog:
[ANDROID] [Template] add Network Security Config file to allow access to packager via cleartext requests in Android API 28 and above. (fixes #22375)
Test Plan:
Before change:
After change: