-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·126 lines (112 loc) · 3.85 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·126 lines (112 loc) · 3.85 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#!/usr/bin/env bash
# Install host dependencies for Strawhat Ramdisk (v1.0) on a fresh macOS.
set -euo pipefail
ROOT="$(cd "$(dirname "$0")" && pwd)"
# shellcheck source=env.sh
source "$ROOT/env.sh"
nr_banner "setup $NR_VERSION"
FAIL=0
ok() { echo " OK $*"; }
warn() { echo " WARN $*"; }
bad() { echo " MISS $*"; FAIL=1; }
echo "=== platform ==="
[[ "$(uname)" == "Darwin" ]] || {
echo "This toolkit requires macOS." >&2
exit 1
}
ok "macOS $(sw_vers -productVersion)"
echo
echo "=== Homebrew ==="
if ! command -v brew >/dev/null 2>&1; then
echo "Homebrew not found. Installing..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
if [[ -x /opt/homebrew/bin/brew ]]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
elif [[ -x /usr/local/bin/brew ]]; then
eval "$(/usr/local/bin/brew shellenv)"
fi
fi
command -v brew >/dev/null && ok "brew $(brew --version | head -1)" || bad "brew"
echo
echo "=== brew packages ==="
BREW_PKGS=(python@3 curl)
# ipsw is often a cask/formula from blacktop; try formula then alternate.
for pkg in "${BREW_PKGS[@]}"; do
if brew list --formula "$pkg" >/dev/null 2>&1 || brew list --cask "$pkg" >/dev/null 2>&1; then
ok "$pkg (already installed)"
else
echo " installing $pkg..."
brew install "$pkg" || warn "could not brew install $pkg"
fi
done
if command -v ipsw >/dev/null 2>&1; then
ok "ipsw $(ipsw version 2>/dev/null | head -1 || echo present)"
else
echo " installing ipsw..."
if brew install blacktop/tap/ipsw 2>/dev/null || brew install ipsw 2>/dev/null; then
ok "ipsw installed"
else
bad "ipsw — install from https://github.com/blacktop/ipsw (brew install blacktop/tap/ipsw)"
fi
fi
# Optional host iproxy if vendored one fails on newer macOS
if ! [[ -x "$NR_TOOLS/iproxy" ]]; then
brew install libimobiledevice 2>/dev/null || true
fi
echo
echo "=== Python packages ==="
PYTHON=python3
command -v "$PYTHON" >/dev/null || bad "python3"
if command -v "$PYTHON" >/dev/null; then
ok "$PYTHON $($PYTHON --version 2>&1)"
"$PYTHON" -m pip install --upgrade pip >/dev/null 2>&1 || true
"$PYTHON" -m pip install -r "$ROOT/requirements.txt"
if "$PYTHON" -c "import pyimg4, capstone" 2>/dev/null; then
ok "pyimg4 + capstone"
else
bad "pyimg4/capstone import failed"
fi
fi
echo
echo "=== vendored tools (tools/darwin) ==="
for t in irecovery pzb gtar trustcache jq usbliter8_boot iproxy sshpass libusb-1.0.0.dylib ibootim; do
if [[ -e "$NR_TOOLS/$t" ]]; then
ok "$t"
else
bad "$t"
fi
done
if [[ ! -x "$NR_TOOLS/img4" ]]; then
echo " NOTE: img4 not included (GitHub content policy)."
echo " Fetch it from the original repo:"
echo " https://github.com/Pa7r0n/ICH_A12_plus_Ramdisk/raw/main/tools/darwin/img4"
echo " Save to $NR_TOOLS/img4 and chmod +x"
fi
echo
echo "=== resources ==="
for t in IM4M_0x8020 IM4M_0x8030 mount_filesystems.safe ssh.tar.gz sshtarlist.txt restored_external restored_external.ents.xml; do
if [[ -e "$NR_RESOURCES/$t" ]]; then
ok "$t"
else
bad "$t"
fi
done
if [[ ! -e "$NR_RESOURCES/ssh.tar.gz" ]]; then
echo " NOTE: ssh.tar.gz not included (GitHub content policy)."
echo " Fetch it from the original repo:"
echo " https://github.com/Pa7r0n/ICH_A12_plus_Ramdisk/raw/main/resources/ssh.tar.gz"
echo " Save to $NR_RESOURCES/ssh.tar.gz"
fi
echo
if ((FAIL)); then
echo "Setup incomplete — fix MISS items above, then re-run ./setup.sh"
nr_footer
exit 1
fi
echo "Setup complete. Next:"
echo " 1) Pwn DFU with RP2350 + usbliter8"
echo " 2) ./build.sh # --with-fw default (normal USB)"
echo " 3) ./boot.sh # waits for USB Recovery after iBoot"
echo " 4) ./ssh.sh"
echo " 3) ./boot.sh && ./ssh.sh"
nr_footer