-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmacsploit-manager.sh
More file actions
87 lines (69 loc) · 2.14 KB
/
Copy pathmacsploit-manager.sh
File metadata and controls
87 lines (69 loc) · 2.14 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/usr/bin/env bash
set -Eeuo pipefail
URL="https://setup.rbxcdn.com/mac/Roblox.dmg"
DMG="$(mktemp /tmp/roblox.XXXXXX.dmg)"
MOUNT=""
cleanup() {
if [[ -n "${MOUNT:-}" ]] && mount | grep -Fq "$MOUNT"; then
hdiutil detach "$MOUNT" -quiet || true
fi
rm -f "$DMG"
}
trap cleanup EXIT
say() {
printf '[*] %s\n' "$1"
}
ok() {
printf '[+] %s\n' "$1"
}
bad() {
printf '[-] %s\n' "$1" >&2
exit 1
}
need() {
command -v "$1" >/dev/null 2>&1 || bad "Missing command: $1"
}
remove_path() {
local path="$1"
if compgen -G "$path" >/dev/null; then
rm -rf $path
ok "Removed $path"
fi
}
need curl
need hdiutil
need open
need rsync
need mktemp
say "Getting things ready..."
sudo -v || bad "Could not get admin access."
say "Removing MacSploit..."
sudo rm -rf "/Applications/MacSploit.app"
remove_path "$HOME/Library/Application Support/MacSploit"
remove_path "$HOME/Library/Saved Application State/com.macsploit.*"
remove_path "$HOME/Library/Preferences/com.macsploit.*"
say "Removing Roblox..."
sudo rm -rf "/Applications/Roblox.app"
remove_path "$HOME/Library/Application Support/Roblox"
remove_path "$HOME/Library/Preferences/com.roblox.*"
remove_path "$HOME/Library/Saved Application State/com.roblox.*"
remove_path "$HOME/Library/Logs/Roblox"
say "Downloading Roblox..."
curl --fail --location --silent --show-error -o "$DMG" "$URL" || bad "Could not download Roblox."
say "Opening the installer..."
MOUNT="$(hdiutil attach "$DMG" -nobrowse -quiet | awk '/\/Volumes\// {print substr($0, index($0, "/Volumes/"))}' | head -n1)"
[[ -n "$MOUNT" ]] || bad "Could not mount the Roblox installer."
APP="$(find "$MOUNT" -maxdepth 2 -type d -name 'Roblox.app' | head -n1)"
[[ -n "${APP:-}" ]] || bad "Could not find Roblox.app inside the installer."
say "Putting Roblox into Applications..."
sudo rsync -a "$APP/" "/Applications/Roblox.app/" || bad "Install failed."
ok "MacSploit is gone. Roblox is back."
printf '\n'
read -r -p "Open Roblox now? (y/N) " choice
if [[ "$choice" =~ ^[Yy]$ ]]; then
say "Launching Roblox..."
open "/Applications/Roblox.app" || bad "Installed Roblox, but could not open it."
fi
printf '\n'
ok "Done."
printf 'by Flawless\n'