Skip to content

Instantly share code, notes, and snippets.

@dessibelle
Created October 16, 2014 11:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dessibelle/bb4683a4db441c0b35da to your computer and use it in GitHub Desktop.
Save dessibelle/bb4683a4db441c0b35da to your computer and use it in GitHub Desktop.
Chrome OS X POODLE patch
#!/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