Created
October 16, 2014 11:18
-
-
Save dessibelle/bb4683a4db441c0b35da to your computer and use it in GitHub Desktop.
Chrome OS X POODLE patch
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/bin/env bash | |
BUNDLE_PATH="/Applications/Google Chrome.app" | |
APP_PATH="$BUNDLE_PATH/Contents" | |
PLIST_PATH="$APP_PATH/Contents/Info.plist" | |
EXECUTABLE_PATH="$APP_PATH/MacOS/Google Chrome" | |
EXECUTABLE_ARGS="--args --ssl-version-min=tls1" | |
LAUNCHER_SCRIPT_FILENAME="launch-chrome-tls.sh" | |
LAUNCHER_SCRIPT_PATH="$APP_PATH/MacOS/$LAUNCHER_SCRIPT_FILENAME" | |
LAUNCHER_SCRIPT="#!/usr/bin/env bash"$'\n'"exec \"$EXECUTABLE_PATH\" $EXECUTABLE_ARGS" | |
# Add launcher script, which in turn calls executable | |
echo "$LAUNCHER_SCRIPT" > "${LAUNCHER_SCRIPT_PATH}" | |
chmod +x "${LAUNCHER_SCRIPT_PATH}" | |
# Update Info.plist to call launcher script rather than executable | |
defaults write "\"$PLIST_PATH\"" CFBundleExecutable -string "$LAUNCHER_SCRIPT_FILENAME" | |
if [[ $(defaults read "\"$PLIST_PATH\"" CFBundleExecutable) = "$LAUNCHER_SCRIPT_FILENAME" ]] | |
then | |
echo "CFBundleExecutable set to $LAUNCHER_SCRIPT_FILENAME" | |
else | |
echo "Could not set CFBundleExecutable" | |
exit 1 | |
fi | |
# Update launch services | |
echo "Updating LaunchServices" | |
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Support/lsregister -f -r "${BUNDLE_PATH}" -v |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment