forked from rustymyers/Insta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAppleJava.sh
executable file
·37 lines (32 loc) · 957 Bytes
/
AppleJava.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
#* AppleJava
#+
#+ Description: Payload required. Stop disabling Java applet plugin and web start apps.
#+
#+ Version: 1.0
#+
#+ History:
#+ 1.0: Script.
#+
#+ TODO:
#+ * Add error checking?
ME=$0
SCRIPT_DIR="$1/Contents/Resources"
TARGET_DIR="$3"
#+ // fix
if [ -z "${TARGET_DIR}" ] || [ "${TARGET_DIR}" = "/" ]; then
TARGET_DIR=""
fi
#* Detect payload & copy
if [ -r "${SCRIPT_DIR}/PAYLOAD" ]; then
#+ TARGET_DIR
sudo /bin/mkdir -p "${TARGET_DIR}/usr/local/bin"
#+ Payload
sudo /bin/cp -Rf "${SCRIPT_DIR}/PAYLOAD/" "${TARGET_DIR}/usr/local/bin"
fi
#+ Disable javadisabler LaunchAgent
sudo /usr/bin/defaults write "${TARGET_DIR}/System/Library/LaunchAgents/com.apple.javadisabler" "RunAtLoad" "No"
sudo /usr/sbin/chown root:wheel "${TARGET_DIR}/System/Library/LaunchAgents/com.apple.javadisabler.plist"
sudo /bin/chmod 644 "${TARGET_DIR}/System/Library/LaunchAgents/com.apple.javadisabler.plist"
exit 0