Created
January 2, 2019 05:52
-
-
Save xiangyu-sun/c82627296b95748964b3d7d57f2e3681 to your computer and use it in GitHub Desktop.
ATS toggle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/usr/libexec/PlistBuddy -c "Delete :NSAppTransportSecurity dict" "${PROJECT_DIR}/${PROJECT_NAME}/Info.plist" | |
# allow insecure connections for MOCK environment | |
if [ "$env" != "MOCK" ] | |
then | |
/usr/libexec/PlistBuddy -c "Add :NSAppTransportSecurity dict" "${PROJECT_DIR}/${PROJECT_NAME}/Info.plist" | |
/usr/libexec/PlistBuddy -c "Add :NSAppTransportSecurity:NSAllowsArbitraryLoads bool NO" "${PROJECT_DIR}/${PROJECT_NAME}/Info.plist" | |
/usr/libexec/PlistBuddy -c "Add :NSAppTransportSecurity:NSAllowsArbitraryLoadsInWebContent bool YES" "${PROJECT_DIR}/${PROJECT_NAME}/Info.plist" | |
else | |
/usr/libexec/PlistBuddy -c "Add :NSAppTransportSecurity dict" "${PROJECT_DIR}/${PROJECT_NAME}/Info.plist" | |
/usr/libexec/PlistBuddy -c "Add :NSAppTransportSecurity:NSAllowsArbitraryLoads bool NO" "${PROJECT_DIR}/${PROJECT_NAME}/Info.plist" | |
/usr/libexec/PlistBuddy -c "Add :NSAppTransportSecurity:NSAllowsArbitraryLoadsInWebContent bool YES" "${PROJECT_DIR}/${PROJECT_NAME}/Info.plist" | |
/usr/libexec/PlistBuddy -c "Add :NSAppTransportSecurity:NSExceptionDomains dict" "${PROJECT_DIR}/${PROJECT_NAME}/Info.plist" | |
/usr/libexec/PlistBuddy -c "Add :NSAppTransportSecurity:NSExceptionDomains:localhost dict" "${PROJECT_DIR}/${PROJECT_NAME}/Info.plist" | |
/usr/libexec/PlistBuddy -c "Add :NSAppTransportSecurity:NSExceptionDomains:localhost:NSExceptionAllowsInsecureHTTPLoads bool YES" "${PROJECT_DIR}/${PROJECT_NAME}/Info.plist" | |
/usr/libexec/PlistBuddy -c "Add :NSAppTransportSecurity:NSExceptionDomains:localhost:NSExceptionRequiresForwardSecrecy bool YES" "${PROJECT_DIR}/${PROJECT_NAME}/Info.plist" | |
/usr/libexec/PlistBuddy -c "Add :NSAppTransportSecurity:NSExceptionDomains:localhost:NSIncludesSubdomains bool YES" "${PROJECT_DIR}/${PROJECT_NAME}/Info.plist" | |
/usr/libexec/PlistBuddy -c "Add :NSAppTransportSecurity:NSExceptionDomains:localhost:NSRequiresCertificateTransparency bool NO" "${PROJECT_DIR}/${PROJECT_NAME}/Info.plist" | |
/usr/libexec/PlistBuddy -c "Add :NSAppTransportSecurity:NSExceptionDomains:localhost:NSTemporaryThirdPartyExceptionAllowsInsecureHTTPLoads bool YES" "${PROJECT_DIR}/${PROJECT_NAME}/Info.plist" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment