Skip to content

Commit c21c168

Browse files
committed
fixes regarding wikiproxy usage
1 parent 68e915d commit c21c168

3 files changed

Lines changed: 37 additions & 12 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ resources/jailbreak/g1lbertJB/payload/Cydia.tar
2121
resources/jailbreak/g1lbertJB/var
2222
resources/powdersn0w/
2323
resources/ramdisk/
24-
saved/
24+
saved*/
2525
sudoloop
2626
tmp*/
2727
version.xml

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
#### Supported architectures: x86_64, arm64
120120

121121
- **macOS** 10.11 and newer
122-
- macOS 12.6 and newer recommended for Apple Silicon Macs
122+
- macOS 12.6 and newer recommended
123123
- [**Ubuntu**](https://ubuntu.com/) 22.04 and newer, and Ubuntu-based distros like [Linux Mint](https://www.linuxmint.com/)
124124
- [**Fedora**](https://getfedora.org/) 40 and newer, [Atomic Desktop](https://fedoraproject.org/atomic-desktops/) (Silverblue, Kinoite, [Bazzite](https://bazzite.gg/), etc.) also supported
125125
- [**Debian**](https://www.debian.org/) 12 Bookworm and newer, Sid, and Debian-based distros

restore.sh

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2509,11 +2509,37 @@ file_download() {
25092509
}
25102510

25112511
device_fw_key_server() {
2512-
local venv="../saved/wikiproxy_venv"
2512+
local venv_name
2513+
local venv
2514+
local repo
2515+
local python_minver
2516+
2517+
python_minver=$(python3 -c 'import sys; print(sys.version_info[1])')
2518+
if [[ -z $python_minver ]]; then
2519+
if [[ $platform == "macos" ]]; then
2520+
error_msg+="* If you get the 'python3: command not found' error, download and install Python 3 here: https://www.python.org/ftp/python/3.11.9/python-3.11.9-macos11.pkg"
2521+
error_msg+=$'\n* This is the latest version of Python 3 that will run on as low as 10.11 El Capitan.\n'
2522+
fi
2523+
error_msg+='* For more troubleshooting steps, go to the "Running wikiproxy" wiki page in GitHub.'
2524+
error_msg+=$'\n* Troubleshooting link: https://github.com/LukeZGD/Legacy-iOS-Kit/wiki/running-wikiproxy'
2525+
error "Failed to initialize Python 3." "$error_msg"
2526+
fi
2527+
if (( python_minver <= 13 )); then
2528+
repo="LukeZGD"
2529+
else
2530+
repo="m1stadev"
2531+
fi
2532+
venv_name="wikiproxy-${repo}_venv"
2533+
venv="../saved/$venv_name"
2534+
2535+
# remove old venv
2536+
if [[ -d "../saved/wikiproxy_venv" ]]; then
2537+
rm -r "../saved/wikiproxy_venv"
2538+
fi
25132539

25142540
if [[ ! -d $venv || ! -s $venv/bin/python3 ]]; then
25152541
log "Creating venv for wikiproxy"
2516-
python3 -m venv $venv
2542+
python3 -m venv "$venv"
25172543
fi
25182544
if [[ ! -d $venv || ! -s $venv/bin/python3 ]]; then
25192545
warn "Creation of venv seems to have failed. wikiproxy will not run."
@@ -2523,11 +2549,11 @@ device_fw_key_server() {
25232549

25242550
if [[ ! -s $venv/bin/wikiproxy ]]; then
25252551
log "Installing wikiproxy using pip..."
2526-
$venv/bin/pip install git+https://github.com/LukeZGD/wikiproxy.git
2552+
"$venv/bin/pip" install "git+https://github.com/${repo}/wikiproxy.git"
25272553
fi
25282554

25292555
log "Running wikiproxy..."
2530-
"$(cd .. && pwd)/saved/wikiproxy_venv/bin/wikiproxy" &
2556+
"$(cd .. && pwd)/saved/$venv_name/bin/wikiproxy" &
25312557
httpserver_pid=$!
25322558

25332559
log "Waiting for local server"
@@ -2575,8 +2601,7 @@ device_fw_key_check() {
25752601
if [[ ! -e "$keys_path/index.html" ]]; then
25762602
mkdir -p "$keys_path"
25772603
local try=("https://raw.githubusercontent.com/LukeZGD/Legacy-iOS-Kit-Keys/master/$device_type/$build/index.html"
2578-
"http://127.0.0.1:8888/firmware/$device_type/$build"
2579-
"https://api.m1sta.xyz/wikiproxy/$device_type/$build")
2604+
"http://127.0.0.1:8888/firmware/$device_type/$build")
25802605
for i in "${try[@]}"; do
25812606
[[ $i == *"127.0.0.1:8888"* ]] && device_fw_key_server
25822607
log "Getting firmware keys for $device_type-$build: $i"
@@ -2587,9 +2612,9 @@ device_fw_key_check() {
25872612
rm -f index.html
25882613
done
25892614
if [[ $(cat index.html | grep -c "$build") != 1 ]]; then
2590-
local error_msg="* You may need to run wikiproxy to get firmware keys."
2591-
error_msg+=$'\n* For more details, go to the "Troubleshooting" wiki page in GitHub.'
2592-
error_msg+=$'\n* Troubleshooting link: https://github.com/LukeZGD/Legacy-iOS-Kit/wiki/Troubleshooting#running-wikiproxy'
2615+
local error_msg=
2616+
error_msg+='* For more troubleshooting steps, go to the "Running wikiproxy" wiki page in GitHub.'
2617+
error_msg+=$'\n* Troubleshooting link: https://github.com/LukeZGD/Legacy-iOS-Kit/wiki/running-wikiproxy'
25932618
error "Failed to download firmware keys." "$error_msg"
25942619
fi
25952620
mv index.html "$keys_path/"
@@ -3268,7 +3293,7 @@ ipsw_prepare_rebootsh() {
32683293
echo "mv /mnt1/System/Library/LaunchDaemons/com.apple.mDNSResponder.plist_ /mnt1/Library/LaunchDaemons/com.apple.mDNSResponder.plist" | tee -a reboot.sh
32693294
echo "mv /mnt1/Library/LaunchDaemons/com.apple.sandboxd.plist /mnt1/System/Library/LaunchDaemons/" | tee -a reboot.sh
32703295
echo "mv /mnt1/Library/LaunchDaemons/com.saurik.Cydia.Startup.plist /mnt1/System/Library/LaunchDaemons/" | tee -a reboot.sh
3271-
local crash
3296+
local crash=
32723297
[[ $1 == "aquila" ]] && crash+="_o"
32733298
echo "mv /mnt1/usr/libexec/CrashHousekeeping$crash /mnt1/usr/libexec/CrashHousekeeping.backup" | tee -a reboot.sh
32743299
echo "ln -sf /aquila /mnt1/usr/libexec/CrashHousekeeping" | tee -a reboot.sh

0 commit comments

Comments
 (0)