-
Notifications
You must be signed in to change notification settings - Fork 24.7k
adjust ats settings in plist in pod install #38086
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
Conversation
This pull request was exported from Phabricator. Differential Revision: D47041590 |
Base commit: 605db44 |
Summary: Pull Request resolved: facebook#38086 Changelog: [Internal] in this diff, we update the developer's Info.plists to have the correct ATS settings introducing usage of products: https://www.rubydoc.info/github/CocoaPods/Xcodeproj/Xcodeproj/Project#products-instance_method, in order to retrieve the plists Differential Revision: D47041590 fbshipit-source-id: 4118127e7be5374ff8bb7225ebdf6b00e06f7177
9481ff5
to
fff1d60
Compare
This pull request was exported from Phabricator. Differential Revision: D47041590 |
Summary: Pull Request resolved: facebook#38086 Changelog: [Internal] in this diff, we update the developer's Info.plists to have the correct ATS settings introducing usage of products: https://www.rubydoc.info/github/CocoaPods/Xcodeproj/Xcodeproj/Project#products-instance_method, in order to retrieve the plists Differential Revision: D47041590 fbshipit-source-id: b1ffc36478f37ece6006fd5360b058d94d076f41
fff1d60
to
3a4ace8
Compare
This pull request was exported from Phabricator. Differential Revision: D47041590 |
Summary: Pull Request resolved: facebook#38086 Changelog: [Internal] in this diff, we update the developer's Info.plists to have the correct ATS settings introducing usage of files: https://www.rubydoc.info/github/CocoaPods/Xcodeproj/Xcodeproj/Project#files-instance_method, in order to retrieve the plists Differential Revision: D47041590 fbshipit-source-id: 03a2d8759c50f58a2364c96f30900a44e47b3328
3a4ace8
to
0452f55
Compare
This pull request was exported from Phabricator. Differential Revision: D47041590 |
Summary: Pull Request resolved: facebook#38086 Changelog: [Internal] in this diff, we update the developer's Info.plists to have the correct ATS settings introducing usage of files: https://www.rubydoc.info/github/CocoaPods/Xcodeproj/Xcodeproj/Project#files-instance_method, in order to retrieve the plists Differential Revision: D47041590 fbshipit-source-id: d2cf908a7b1c34f7f2e3523914a3f5facc503f2d
0452f55
to
1dc8797
Compare
This pull request was exported from Phabricator. Differential Revision: D47041590 |
Summary: Pull Request resolved: facebook#38086 Changelog: [Internal] in this diff, we update the developer's Info.plists to have the correct ATS settings introducing usage of files: https://www.rubydoc.info/github/CocoaPods/Xcodeproj/Xcodeproj/Project#files-instance_method, in order to retrieve the plists Reviewed By: cipolleschi Differential Revision: D47041590 fbshipit-source-id: 14a1c182e0e7f0dbc105fc960a115bda0b3b8fd2
1dc8797
to
a4858c2
Compare
This pull request was exported from Phabricator. Differential Revision: D47041590 |
This pull request was successfully merged by @philIip in c86f15a. When will my fix make it into a release? | Upcoming Releases |
Probably not safe to assume that all targets in the pbxproj are using React Native or connecting to a dev server. This change is modifying my widgets target to support loading. I also use widgets outside of my |
info_plists = user_project | ||
.files | ||
.select { |p| | ||
p.name&.end_with?('Info.plist') |
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.
Info.plist
files should be discovered by tracing PBXProject > PBXNativeTarget > XCConfigurationList > XCBuildConfiguration > buildSettings.INFOPLIST_FILE
.
|
||
def self.update_ats_in_plist(plistPaths, parent) | ||
plistPaths.each do |plistPath| | ||
fullPlistPath = File.join(parent, plistPath.path) |
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.
This would only be accurate if you trace the join the paths of PBXFileReference.path | PBXFileReference.name
with every parent PBXGroup.path
according to sourceTree
. Iirc cocoapods has some utility method for getting the real file path for a file.
@@ -246,6 +246,7 @@ def react_native_post_install( | |||
ReactNativePodsUtils.set_node_modules_user_settings(installer, react_native_path) | |||
ReactNativePodsUtils.apply_flags_for_fabric(installer, fabric_enabled: fabric_enabled) | |||
ReactNativePodsUtils.apply_xcode_15_patch(installer) | |||
ReactNativePodsUtils.apply_ats_config(installer) |
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.
This should ultimately only be running on the target that the user added the function to, and not all targets in the pbxproj.
# Why On react-native 0.73 there was a change to the default template which automatically sets `NSAllowsArbitraryLoads` to false after running `pod install`. (facebook/react-native#38086) Temporary fix for #26573 # How As a temporary fix this PR updates the bare-minimum template to set a custom ATS configuration for `exp.direct` in order to allow users to use the `--tunnel` flag with expo cli. Until a proper fix is not implemented upstream, If users need to whitelist other HTTP domains they should manually add `NSExceptionDomains` to their `infoPlist` via app.json e.g. ```{ "expo": { "ios": { "infoPlist": { "CFBundleAllowMixedLocalizations": true, "NSAppTransportSecurity": { "NSExceptionDomains": { "your-custom-domain.test": { "NSIncludesSubdomains": true, "NSExceptionAllowsInsecureHTTPLoads": true } } } } } } } ``` # Test Plan ``` $ npx create-expo-app sdk50 $ cd sdk50 $ npx expo prebuild --template /path/to/expo/expo/expo-template-bare-minimum-*.tgz $ npx expo start --tunnel ``` # Checklist <!-- Please check the appropriate items below if they apply to your diff. This is required for changes to Expo modules. --> - [ ] Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) - [ ] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin).
On react-native 0.73 there was a change to the default template which automatically sets `NSAllowsArbitraryLoads` to false after running `pod install`. (facebook/react-native#38086) Temporary fix for #26573 As a temporary fix this PR updates the bare-minimum template to set a custom ATS configuration for `exp.direct` in order to allow users to use the `--tunnel` flag with expo cli. Until a proper fix is not implemented upstream, If users need to whitelist other HTTP domains they should manually add `NSExceptionDomains` to their `infoPlist` via app.json e.g. ```{ "expo": { "ios": { "infoPlist": { "CFBundleAllowMixedLocalizations": true, "NSAppTransportSecurity": { "NSExceptionDomains": { "your-custom-domain.test": { "NSIncludesSubdomains": true, "NSExceptionAllowsInsecureHTTPLoads": true } } } } } } } ``` ``` $ npx create-expo-app sdk50 $ cd sdk50 $ npx expo prebuild --template /path/to/expo/expo/expo-template-bare-minimum-*.tgz $ npx expo start --tunnel ``` <!-- Please check the appropriate items below if they apply to your diff. This is required for changes to Expo modules. --> - [ ] Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) - [ ] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin).
Summary:
Changelog: [Internal]
in this diff, we update the developer's Info.plists to have the correct ATS settings
introducing usage of products: https://www.rubydoc.info/github/CocoaPods/Xcodeproj/Xcodeproj/Project#products-instance_method, in order to retrieve the plists
Differential Revision: D47041590