You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/bash
  2. # This script gets executed from Xcode to disable ATS (App Transport Security)
  3. # on Debug builds. Doing this allows loading resources over HTTP, such as the
  4. # JS bundle.
  5. set -x
  6. case "$CONFIGURATION" in
  7. Debug)
  8. # Speed up build times by skipping the creation of the offline package for debug
  9. # builds on the simulator since the packager is supposed to be running anyways.
  10. if [[ "$PLATFORM_NAME" == *simulator ]]; then
  11. echo "Skipping bundling for Simulator platform"
  12. exit 0;
  13. fi
  14. DEV=true
  15. ;;
  16. "")
  17. echo "$0 must be invoked by Xcode"
  18. exit 1
  19. ;;
  20. *)
  21. DEV=false
  22. ;;
  23. esac
  24. DEST=$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH
  25. if [[ "$CONFIGURATION" = "Debug" && ! "$PLATFORM_NAME" == *simulator ]]; then
  26. PLISTBUDDY='/usr/libexec/PlistBuddy'
  27. PLIST=$TARGET_BUILD_DIR/$INFOPLIST_PATH
  28. `$PLISTBUDDY -c "Add NSAppTransportSecurity:NSAllowsArbitraryLoads bool true" "$PLIST"` || true
  29. fi