Skip to content

Instantly share code, notes, and snippets.

@gchristian
Created February 1, 2013 15:44
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 gchristian/4692090 to your computer and use it in GitHub Desktop.
Save gchristian/4692090 to your computer and use it in GitHub Desktop.
script to re-enable java and stop xprotect from requiring a minimum version of java
#!/bin/bash
#step through users and check for java prefs file, if found enable java web componets
USERS=`ls /Users`
for f in $USERS
do
JPREFS=`ls /Users/$f/Library/Preferences/ByHost/com.apple.java.JavaPreferences.*.plist`
if [ -e "$FPREFS" ]
then
/usr/libexec/PlistBuddy -c "Delete :GeneralByTask:Any:WebComponentsEnabled" $JPREFS
/usr/libexec/PlistBuddy -c "Add :GeneralByTask:Any:WebComponentsEnabled bool true" $JPREFS
fi
done
#delete block on JavaWebComponents
/usr/libexec/PlistBuddy -c "Delete :JavaWebComponentVersionMinimum" /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/XProtect.meta.plist
#turn off xprotectupdater downloads (tested on 10.6 and 10.7) to prevent block from just being added back
launchctl unload -w /System/Library/LaunchDaemons/com.apple.xprotectupdater.plist
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment