feat: examples, standalone, monitor-install, quickstart
- auto-bypass-usb.sh: one-click bypass from SSD - prepare-ssd.sh: prepare the SSD before you need it - build-standalone.sh: now bundles all 12 lib modules (+check, +monitor) - unleash-standalone.sh: v1.2.0, 1958 lines, all commands included - monitor-install / monitor-uninstall: monitor as persistent LaunchDaemon - QUICKSTART.md: Portuguese/English quick reference for SSD - Responded to 8 more bypass-mdm issues (#136, #137, #139, #145, #148, #153, #155, #172) - Attached standalone to GitHub Release v1.2.0
This commit is contained in:
@@ -0,0 +1,37 @@
|
|||||||
|
# unleash — Quick Reference
|
||||||
|
|
||||||
|
Keep this on your SSD alongside the script.
|
||||||
|
|
||||||
|
## First time
|
||||||
|
|
||||||
|
1. Boot to Recovery (Apple Silicon: hold Power, Intel: Cmd+R)
|
||||||
|
2. Open Terminal → `chmod +x "/Volumes/YourSSD/unleash/unleash"`
|
||||||
|
3. Run → `"/Volumes/YourSSD/unleash/unleash"`
|
||||||
|
4. Pick "Full bypass" from the menu
|
||||||
|
|
||||||
|
## Common scenarios
|
||||||
|
|
||||||
|
| Você quer... | Comando |
|
||||||
|
|---|---|
|
||||||
|
| Bypass completo (cria usuário admin) | `./unleash bypass` |
|
||||||
|
| Só silenciar o MDM (sem criar usuário) | `./unleash suppress` |
|
||||||
|
| Consertar depois de atualizar macOS | `sudo ./unleash heal` |
|
||||||
|
| Nunca mais pensar nisso | `sudo ./unleash persist` + `sudo ./unleash whitelist` |
|
||||||
|
| Saber se vai travar após formatar | `sudo ./unleash check` |
|
||||||
|
| Vigiar MDM em tempo real | `sudo ./unleash monitor` |
|
||||||
|
| Instalar monitor para sempre | `sudo ./unleash monitor-install` |
|
||||||
|
| Limpeza pós-bypass (já logado) | `sudo ./unleash harden` |
|
||||||
|
| Varredura completa | `sudo ./unleash audit` |
|
||||||
|
| Voltar ao normal | `./unleash restore` |
|
||||||
|
|
||||||
|
## Aliases
|
||||||
|
|
||||||
|
`by` = bypass, `sv` = suppress, `fw` = firewall, `wl` = whitelist,
|
||||||
|
`st` = status, `mn` = monitor, `mn-st` = monitor-status
|
||||||
|
|
||||||
|
## Avisos
|
||||||
|
|
||||||
|
- **Não** rode `profiles renew` — isso reativa o MDM
|
||||||
|
- **Não** use "Apagar Conteúdo e Ajustes" — isso limpa o bypass
|
||||||
|
- Após formatar (wipe), rode o bypass de novo do Recovery
|
||||||
|
- Migration Assistant traz o MDM de volta — sempre rode `suppress` depois
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# auto-bypass-usb.sh
|
||||||
|
# Drop this on an external SSD. Boot to Recovery, run it.
|
||||||
|
# No typing, no prompts — just bypass.
|
||||||
|
#
|
||||||
|
# Usage from Recovery Terminal:
|
||||||
|
# chmod +x "/Volumes/YourSSD/auto-bypass-usb.sh"
|
||||||
|
# "/Volumes/YourSSD/auto-bypass-usb.sh"
|
||||||
|
|
||||||
|
UNLEASH_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||||
|
UNLEASH="$UNLEASH_DIR/unleash"
|
||||||
|
|
||||||
|
if [ ! -f "$UNLEASH" ]; then
|
||||||
|
echo "unleash not found at $UNLEASH"
|
||||||
|
echo "Copy the entire unleash/ folder alongside this script."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
"$UNLEASH" bypass
|
||||||
@@ -1,35 +1,22 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Build a standalone unleash.sh (single file) from modular source.
|
|
||||||
# Usage: bash build-standalone.sh
|
|
||||||
# Output: unleash-standalone.sh
|
|
||||||
|
|
||||||
OUT="unleash-standalone.sh"
|
OUT="unleash-standalone.sh"
|
||||||
SCRIPT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
||||||
|
|
||||||
cat > "$OUT" << 'HEADER'
|
VERSION="$(grep '^VERSION=' "$SCRIPT_DIR/unleash" | head -1 | cut -d'"' -f2)"
|
||||||
|
[ -z "$VERSION" ] && VERSION="1.0.0"
|
||||||
|
|
||||||
|
cat > "$OUT" << HEADER
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
VERSION="$VERSION"
|
||||||
# unleash — Unified MDM bypass tool for macOS (standalone).
|
|
||||||
# Auto-detects Recovery/dualboot mode. One file, zero dependencies.
|
|
||||||
#
|
|
||||||
# Usage:
|
|
||||||
# ./unleash [bypass|suppress|backup|restore|dualboot|status|version|help]
|
|
||||||
|
|
||||||
VERSION="1.0.0"
|
|
||||||
HEADER
|
HEADER
|
||||||
|
|
||||||
echo "" >> "$OUT"
|
for lib in colors detect validate dscl suppress backup status heal firewall harden whitelist check monitor; do
|
||||||
|
tail -n +1 "$SCRIPT_DIR/lib/$lib.sh" >> "$OUT"
|
||||||
for lib in colors detect validate dscl suppress backup status; do
|
|
||||||
echo "# === lib/$lib.sh ===" >> "$OUT"
|
|
||||||
# Remove shebang lines (first line of each lib)
|
|
||||||
tail -n +2 "$SCRIPT_DIR/lib/$lib.sh" >> "$OUT"
|
|
||||||
echo "" >> "$OUT"
|
echo "" >> "$OUT"
|
||||||
done
|
done
|
||||||
|
|
||||||
# Append the main script body (skip shebang, skip lib sourcing)
|
sed -e '1,/_lib in /d' -e '/^done$/,$!d' -e '/^done$/d' "$SCRIPT_DIR/unleash" >> "$OUT"
|
||||||
sed -e '1d' -e '/^LIB_DIR=/d' -e '/^for _lib in/,/^done$/d' "$SCRIPT_DIR/unleash" >> "$OUT"
|
|
||||||
|
|
||||||
chmod +x "$OUT"
|
chmod +x "$OUT"
|
||||||
echo "Created: $OUT ($(wc -c < "$OUT") bytes, $(wc -l < "$OUT") lines)"
|
echo "Created: $OUT (v$VERSION, $(wc -c < "$OUT") bytes, $(wc -l < "$OUT") lines)"
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# prepare-ssd.sh
|
||||||
|
# Prepares an external SSD with unleash + auto-bypass script.
|
||||||
|
# Run this on a working Mac, before you need the bypass.
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
# sudo bash prepare-ssd.sh /Volumes/MySSD
|
||||||
|
|
||||||
|
SSD="${1:-}"
|
||||||
|
[ -z "$SSD" ] && { echo "Usage: $0 /Volumes/YourSSD"; exit 1; }
|
||||||
|
[ -d "$SSD" ] || { echo "SSD not mounted at $SSD"; exit 1; }
|
||||||
|
|
||||||
|
SRC="$(cd "$(dirname "$0")/.." && pwd)"
|
||||||
|
|
||||||
|
echo "Copying unleash to $SSD..."
|
||||||
|
cp -R "$SRC" "$SSD/unleash"
|
||||||
|
cp "$SRC/examples/auto-bypass-usb.sh" "$SSD/auto-bypass-usb.sh"
|
||||||
|
chmod +x "$SSD/auto-bypass-usb.sh" "$SSD/unleash/unleash"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "✅ SSD ready at $SSD"
|
||||||
|
echo ""
|
||||||
|
echo "To bypass:"
|
||||||
|
echo " 1. Boot to Recovery (hold Power on AS, Cmd+R on Intel)"
|
||||||
|
echo " 2. Open Terminal"
|
||||||
|
echo " 3. Run:"
|
||||||
|
echo " chmod +x \"${SSD}/auto-bypass-usb.sh\""
|
||||||
|
echo " \"${SSD}/auto-bypass-usb.sh\""
|
||||||
+18
-28
@@ -1,30 +1,20 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Quickstart examples for unleash
|
# Usage examples for unleash — copy/paste what you need.
|
||||||
# Copy these one-liners as needed.
|
|
||||||
|
|
||||||
# === EXPRESS (from external SSD, no download) ===
|
echo "=== unleash quick examples ==="
|
||||||
# 1. Copy unleash folder to your SSD
|
echo ""
|
||||||
# 2. Boot into Recovery
|
echo "From Recovery (external SSD):"
|
||||||
# 3. Terminal ->
|
echo ' "/Volumes/YourSSD/unleash/unleash" bypass'
|
||||||
# /Volumes/YourSSDName/unleash/unleash
|
echo ""
|
||||||
|
echo "From Recovery (one-liner, needs internet):"
|
||||||
# === ONE-LINER (download + run) ===
|
echo " curl -L https://raw.githubusercontent.com/mateussiqueira/unleash/main/unleash -o /tmp/unleash && chmod +x /tmp/unleash && /tmp/unleash bypass"
|
||||||
# curl -L https://raw.githubusercontent.com/mateussiqueira/unleash/main/unleash -o unleash
|
echo ""
|
||||||
# chmod +x unleash && ./unleash bypass
|
echo "From booted system (sudo needed):"
|
||||||
|
echo " sudo ./unleash heal # fix after update"
|
||||||
# === DUAL-BOOT ===
|
echo " sudo ./unleash harden # cleanup live MDM artifacts"
|
||||||
# sudo ./unleash dualboot
|
echo " sudo ./unleash audit # deep scan"
|
||||||
|
echo " sudo ./unleash check # pre-format report"
|
||||||
# === SUPPRESS ONLY ===
|
echo " sudo ./unleash monitor # watch MDM in background"
|
||||||
# ./unleash suppress
|
echo " sudo ./unleash persist # auto-heal on every boot"
|
||||||
|
echo " sudo ./unleash firewall # pf kernel block"
|
||||||
# === BACKUP ===
|
echo " sudo ./unleash whitelist # block MDM only, keep iCloud"
|
||||||
# ./unleash backup
|
|
||||||
|
|
||||||
# === RESTORE ===
|
|
||||||
# ./unleash restore
|
|
||||||
|
|
||||||
# === STATUS ===
|
|
||||||
# ./unleash status
|
|
||||||
|
|
||||||
echo "See the comments in this file for usage examples."
|
|
||||||
|
|||||||
@@ -1,3 +1,76 @@
|
|||||||
|
install_monitor_launchdaemon() {
|
||||||
|
local data_mount="$1"
|
||||||
|
local root=""
|
||||||
|
[ -n "$data_mount" ] && root="$data_mount"
|
||||||
|
|
||||||
|
local unleash_src
|
||||||
|
if [ -n "$SCRIPT_DIR" ]; then
|
||||||
|
unleash_src="$SCRIPT_DIR/unleash"
|
||||||
|
else
|
||||||
|
unleash_src="$(cd "$(dirname "$0")" && pwd)/unleash"
|
||||||
|
fi
|
||||||
|
|
||||||
|
step "Installing monitor LaunchDaemon..."
|
||||||
|
|
||||||
|
local plist_dir="${root}/Library/LaunchDaemons"
|
||||||
|
local plist_path="${plist_dir}/com.unleash.monitor.plist"
|
||||||
|
mkdir -p "$plist_dir"
|
||||||
|
|
||||||
|
cat > "$plist_path" <<- PLIST
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>Label</key>
|
||||||
|
<string>com.unleash.monitor</string>
|
||||||
|
<key>ProgramArguments</key>
|
||||||
|
<array>
|
||||||
|
<string>/bin/bash</string>
|
||||||
|
<string>-c</string>
|
||||||
|
<string>${unleash_src} monitor</string>
|
||||||
|
</array>
|
||||||
|
<key>RunAtLoad</key>
|
||||||
|
<true/>
|
||||||
|
<key>KeepAlive</key>
|
||||||
|
<true/>
|
||||||
|
<key>Nice</key>
|
||||||
|
<integer>1</integer>
|
||||||
|
<key>StandardOutPath</key>
|
||||||
|
<string>/var/log/unleash-monitor.log</string>
|
||||||
|
<key>StandardErrorPath</key>
|
||||||
|
<string>/var/log/unleash-monitor.err</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
|
PLIST
|
||||||
|
|
||||||
|
chmod 644 "$plist_path"
|
||||||
|
success "Monitor LaunchDaemon: $plist_path"
|
||||||
|
|
||||||
|
if command -v launchctl &>/dev/null; then
|
||||||
|
launchctl load "$plist_path" 2>/dev/null \
|
||||||
|
&& success "Monitor loaded (starts at boot)" \
|
||||||
|
|| info "Will load on next boot"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
uninstall_monitor_launchdaemon() {
|
||||||
|
local data_mount="$1"
|
||||||
|
local root=""
|
||||||
|
[ -n "$data_mount" ] && root="$data_mount"
|
||||||
|
local plist_path="${root}/Library/LaunchDaemons/com.unleash.monitor.plist"
|
||||||
|
|
||||||
|
if [ -f "$plist_path" ]; then
|
||||||
|
step "Removing monitor LaunchDaemon..."
|
||||||
|
if command -v launchctl &>/dev/null; then
|
||||||
|
launchctl unload "$plist_path" 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
rm -f "$plist_path"
|
||||||
|
success "Monitor LaunchDaemon removed"
|
||||||
|
else
|
||||||
|
info "No monitor LaunchDaemon installed"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
monitor_mdm() {
|
monitor_mdm() {
|
||||||
header "MDM Monitor (continuous)"
|
header "MDM Monitor (continuous)"
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,8 @@ Bypass / suppress / monitor MDM enrollment on macOS.
|
|||||||
Monitoring:
|
Monitoring:
|
||||||
check Pre-format / pre-upgrade safety report
|
check Pre-format / pre-upgrade safety report
|
||||||
monitor Background daemon (watches MDM every 5 min)
|
monitor Background daemon (watches MDM every 5 min)
|
||||||
|
monitor-install Install monitor as LaunchDaemon (boot persistent)
|
||||||
|
monitor-uninstall Remove monitor LaunchDaemon
|
||||||
monitor-stop Stop the daemon
|
monitor-stop Stop the daemon
|
||||||
monitor-status Check if daemon is running
|
monitor-status Check if daemon is running
|
||||||
|
|
||||||
@@ -67,6 +69,8 @@ ALIASES
|
|||||||
sv suppress
|
sv suppress
|
||||||
by bypass
|
by bypass
|
||||||
mn monitor
|
mn monitor
|
||||||
|
mn-install monitor-install
|
||||||
|
mn-uninstall monitor-uninstall
|
||||||
mn-stop monitor-stop
|
mn-stop monitor-stop
|
||||||
mn-st monitor-status
|
mn-st monitor-status
|
||||||
|
|
||||||
@@ -278,7 +282,13 @@ cmd_check() {
|
|||||||
check_upgrade_safety
|
check_upgrade_safety
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd_monitor() { monitor_mdm; }
|
cmd_monitor() {
|
||||||
|
case "${2:-}" in
|
||||||
|
install) install_monitor_launchdaemon "" ;;
|
||||||
|
uninstall) uninstall_monitor_launchdaemon "" ;;
|
||||||
|
*) monitor_mdm ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
cmd_monitor_stop() { stop_monitor; }
|
cmd_monitor_stop() { stop_monitor; }
|
||||||
cmd_monitor_status() { monitor_status; }
|
cmd_monitor_status() { monitor_status; }
|
||||||
|
|
||||||
@@ -430,7 +440,9 @@ main() {
|
|||||||
dualboot) cmd_dualboot ;;
|
dualboot) cmd_dualboot ;;
|
||||||
status|st|ls) cmd_status ;;
|
status|st|ls) cmd_status ;;
|
||||||
check) cmd_check ;;
|
check) cmd_check ;;
|
||||||
monitor|mn) cmd_monitor ;;
|
monitor|mn) cmd_monitor "$@" ;;
|
||||||
|
monitor-install|mn-install) install_monitor_launchdaemon "" ;;
|
||||||
|
monitor-uninstall|mn-uninstall) uninstall_monitor_launchdaemon "" ;;
|
||||||
monitor-stop|mn-stop) cmd_monitor_stop ;;
|
monitor-stop|mn-stop) cmd_monitor_stop ;;
|
||||||
monitor-status|mn-st) cmd_monitor_status ;;
|
monitor-status|mn-st) cmd_monitor_status ;;
|
||||||
version|-v|--version) cmd_version ;;
|
version|-v|--version) cmd_version ;;
|
||||||
|
|||||||
+1945
-12
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user