fix boots

This commit is contained in:
edwin 2023-03-30 13:58:13 -04:00
parent d257d48db2
commit f1dc4dd2c3
2 changed files with 68 additions and 51 deletions

View file

@ -8,7 +8,7 @@ download the ipsw and put it into ipsw/ directory
Example: ./downr1n.sh --downgrade 14.3 Example: ./downr1n.sh --downgrade 14.3
--downgrade downgrade tethered your device to ios 14,15. --downgrade downgrade tethered your device to ios 14.
--dfuhelper A helper to help get A11 devices into DFU mode from recovery mode --dfuhelper A helper to help get A11 devices into DFU mode from recovery mode
@ -18,9 +18,11 @@ Example: ./downr1n.sh --downgrade 14.3
--boot this boot the device. --boot this boot the device.
--dont-restore this will avoid the restore using futurerestore, this can be used if you wanted only create the boot files
--fixBoot that will boot the device using fsboot --fixBoot that will boot the device using fsboot
--debug Debug the script --debug Debug the scrip
--- ---
@ -37,6 +39,10 @@ Example: ./downr1n.sh --downgrade 14.3
- futurerestore --exit-recovery - futurerestore --exit-recovery
- irecovery -n - irecovery -n
# fix some problems to boot
rn not working at all but you can try it
sometimes we have problems like deep sleep or the ios doesnt boot so i add two option for that reason --localboot and --fsboot. both are patchers by palera1n team in order to fix some problems in the boot so you must use it when you will create boot files for example --downgrade () --dont-restore (--localboot) or (--fsboot), when that finish creating that you just have to boot for example --boot (--localboot) or (--fsboot), its not neccessary that you need to use them but if you had some problems you can
# How do i jailbreak it ? # How do i jailbreak it ?

View file

@ -59,11 +59,12 @@ Usage: $0 [Options] [ subcommand | iOS version which are you]. put your ipsw in
iOS 15 - 14.0 downgrade tool ./downr1n --downgrade 15.7 (the ios of your device) ipsw iOS 15 - 14.0 downgrade tool ./downr1n --downgrade 15.7 (the ios of your device) ipsw
Options: Options:
--downgrade downgrade tethered your device to ios 14,15. --downgrade downgrade tethered your device to ios 14. you can use --localboot or --fsboot in order to fix some problems if you had them
--dfuhelper A helper to help get A11 devices into DFU mode from recovery mode --dfuhelper A helper to help get A11 devices into DFU mode from recovery mode
--jailbreak jailbreak with pogo. usage ./downr1n --jailbreak 14.8 --jailbreak jailbreak with pogo. usage ./downr1n --jailbreak 14.8
--taurine jailbreak with taurine. usage ./downr1n --jailbreak 14.3 --taurine --taurine jailbreak with taurine. usage ./downr1n --jailbreak 14.3 --taurine
--boot this boot the device. --boot this boot the device.
--dont-restore this will avoid the restore using futurerestore, this can be used if you wanted only create the boot files
--fixBoot that will boot the device using fsboot --fixBoot that will boot the device using fsboot
--debug Debug the script --debug Debug the script
@ -97,6 +98,15 @@ parse_opt() {
--fixBoot) --fixBoot)
fixBoot=1 fixBoot=1
;; ;;
--dont-restore)
dontRestore=1
;;
--localboot)
local=1
;;
--fsboot)
fsboot=1
;;
--dfuhelper) --dfuhelper)
dfuhelper=1 dfuhelper=1
;; ;;
@ -297,7 +307,7 @@ EOF
rm -rf /tmp/futurerestore/ rm -rf /tmp/futurerestore/
"$dir"/futurerestore -t blobs/"$deviceid"-"$version".shsh2 --use-pwndfu --skip-blob \ "$dir"/futurerestore -t blobs/"$deviceid"-"$version".shsh2 --use-pwndfu --skip-blob \
--rdsk work/rdsk.im4p --rkrn work/krnl.im4p \ --rdsk work/rdsk.im4p --rkrn work/krnl.im4p \
--latest-sep $HasBaseband $ipsw --latest-sep "$HasBaseband" $ipsw
} }
_boot() { _boot() {
@ -311,12 +321,20 @@ _boot() {
"$dir"/irecovery -f "blobs/"$deviceid"-"$version".shsh2" "$dir"/irecovery -f "blobs/"$deviceid"-"$version".shsh2"
sleep 1 sleep 1
if [[ ! "$cpid" == *"0x801"* ]]; then
"$dir"/irecovery -f "boot/${deviceid}/iBSS.img4" "$dir"/irecovery -f "boot/${deviceid}/iBSS.img4"
sleep 1 sleep 1
fi
"$dir"/irecovery -f "boot/${deviceid}/iBEC.img4" "$dir"/irecovery -f "boot/${deviceid}/iBEC.img4"
sleep 3 sleep 3
if [ "$local" = "1" ]; then
echo "booting ..."
echo "your devicd should be booting into the ios using localboot:)"
exit;
fi
if [[ "$cpid" == *"0x801"* ]]; then if [[ "$cpid" == *"0x801"* ]]; then
"$dir"/irecovery -c "go" "$dir"/irecovery -c "go"
sleep 2 sleep 2
@ -341,7 +359,7 @@ _boot() {
"$dir"/irecovery -f "boot/${deviceid}/kernelcache.img4" "$dir"/irecovery -f "boot/${deviceid}/kernelcache.img4"
sleep 1 sleep 1
"$dir"/irecovery -c `if [ ! "$fixBoot" = "1" ]; then echo "bootx" else "fsboot"; fi` "$dir"/irecovery -c "$(if [ ! "$fsboot" = "1" ]; then echo "bootx"; else echo "fsboot"; fi)"
exit; exit;
} }
@ -535,10 +553,10 @@ if [[ ${#ipsw_files[@]} -gt 1 ]]; then
fi fi
cd .. cd ..
if [ -a "$ipsw" ] || [ "${ipsw: -5}" == ".ipsw" ]; then if [ -a $ipsw ] || [ "${ipsw: -5}" == ".ipsw" ]; then
echo "Continuing..." echo "Continuing..."
else else
_eexit "$ipsw is not a valid ipsw file." _eexit $ipsw "is not a valid ipsw file."
fi fi
if [ "$downgrade" = "1" ] || [ "$jailbreak" = "1" ]; then if [ "$downgrade" = "1" ] || [ "$jailbreak" = "1" ]; then
@ -620,7 +638,7 @@ if [ true ]; then
fi fi
"$dir"/img4tool -e -s $(pwd)/blobs/"$deviceid"-"$version".shsh2 -m work/IM4M "$dir"/img4tool -e -s blobs/"$deviceid"-"$version".shsh2 -m work/IM4M
echo "Dumpped SHSH" echo "Dumpped SHSH"
if [ "$jailbreak" = "1" ]; then if [ "$jailbreak" = "1" ]; then
@ -713,6 +731,14 @@ if [ true ]; then
fi fi
remote_cmd "/usr/sbin/nvram auto-boot=false"
remote_cmd "/sbin/reboot"
_wait recovery
sleep 4
_dfuhelper "$cpid"
sleep 3
echo "Patchimg some boot files..." echo "Patchimg some boot files..."
if [ "$downgrade" = "1" ]; then if [ "$downgrade" = "1" ]; then
sleep 1 sleep 1
@ -724,12 +750,6 @@ if [ true ]; then
mkdir boot/"$deviceid" mkdir boot/"$deviceid"
fi fi
remote_cmd "/usr/sbin/nvram auto-boot=false"
remote_cmd "/sbin/reboot"
_wait recovery
sleep 4
_dfuhelper "$cpid"
sleep 3
if [ "$fixBoot" = "1" ]; then # i put it because my friend tested on his ipad and that does not boot so when we download all file from the internet so not extracting ipsw that boot fine idk why if [ "$fixBoot" = "1" ]; then # i put it because my friend tested on his ipad and that does not boot so when we download all file from the internet so not extracting ipsw that boot fine idk why
@ -750,7 +770,7 @@ if [ true ]; then
else else
#that will extract the files needed #that will extract the files needed
cp "$extractedIpsw$(awk "/""${model}""/{x=1}x&&/iBSS[.]/{print;exit}" work/BuildManifest.plist | grep '<string>' |cut -d\> -f2 |cut -d\< -f1)" "work/" cp "$extractedIpsw$(awk "/""${model}""/{x=1}x&&/iBSS[.]/{print;exit}" work/BuildManifest.plist | grep '<string>' |cut -d\> -f2 |cut -d\< -f1)" "work/"
cp "$extractedIpsw$(awk "/""${model}""/{x=1}x&&/iBEC[.]/{print;exit}" work/BuildManifest.plist | grep '<string>' |cut -d\> -f2 |cut -d\< -f1)" "work/" cp "$extractedIpsw$(awk "/""${model}""/{x=1}x&&/iBoot[.]/{print;exit}" work/BuildManifest.plist | grep '<string>' |cut -d\> -f2 |cut -d\< -f1)" "work/"
cp "$extractedIpsw$(awk "/""${model}""/{x=1}x&&/DeviceTree[.]/{print;exit}" work/BuildManifest.plist | grep '<string>' |cut -d\> -f2 |cut -d\< -f1)" "work/" cp "$extractedIpsw$(awk "/""${model}""/{x=1}x&&/DeviceTree[.]/{print;exit}" work/BuildManifest.plist | grep '<string>' |cut -d\> -f2 |cut -d\< -f1)" "work/"
cp "$extractedIpsw$(awk "/""${model}""/{x=1}x&&/kernelcache.release/{print;exit}" work/BuildManifest.plist | grep '<string>' |cut -d\> -f2 |cut -d\< -f1)" "work/" cp "$extractedIpsw$(awk "/""${model}""/{x=1}x&&/kernelcache.release/{print;exit}" work/BuildManifest.plist | grep '<string>' |cut -d\> -f2 |cut -d\< -f1)" "work/"
@ -765,14 +785,11 @@ if [ true ]; then
"$dir"/iBoot64Patcher work/iBSS.dec work/iBSS.patched "$dir"/iBoot64Patcher work/iBSS.dec work/iBSS.patched
"$dir"/img4 -i work/iBSS.patched -o work/iBSS.img4 -M work/IM4M -A -T ibss "$dir"/img4 -i work/iBSS.patched -o work/iBSS.img4 -M work/IM4M -A -T ibss
if [ "$fixBoot" = "1" ]; then # fixboot will download the boot files, sometimes that fix most of boot also boot with anoter patcher
"$dir"/gaster decrypt work/"$(awk "/""${model}""/{x=1}x&&/iBoot[.]/{print;exit}" work/BuildManifest.plist | grep '<string>' |cut -d\> -f2 |cut -d\< -f1 | sed 's/Firmware[/]all_flash[/]//')" work/iBEC.dec
else
"$dir"/gaster decrypt work/"$(awk "/""${model}""/{x=1}x&&/iBEC[.]/{print;exit}" work/BuildManifest.plist | grep '<string>' |cut -d\> -f2 |cut -d\< -f1 | sed 's/Firmware[/]dfu[/]//')" work/iBEC.dec
fi
"$dir"/iBoot64Patcher work/iBEC.dec work/iBEC.patched -b " -v wdt=-1 `if [ "$cpid" = '0x8960' ] || [ "$cpid" = '0x7000' ] || [ "$cpid" = '0x7001' ]; then echo "-restore"; fi`" -n -l "$dir"/gaster decrypt work/"$(awk "/""${model}""/{x=1}x&&/iBoot[.]/{print;exit}" work/BuildManifest.plist | grep '<string>' |cut -d\> -f2 |cut -d\< -f1 | sed 's/Firmware[/]all_flash[/]//')" work/iBEC.dec
"$dir"/img4 -i work/iBEC.patched -o work/iBEC.img4 -M work/IM4M -A -T ibec "$dir"/iBoot64Patcher work/iBEC.dec work/iBEC.patched -b " -v wdt=-1 `if [ "$cpid" = '0x8960' ] || [ "$cpid" = '0x7000' ] || [ "$cpid" = '0x7001' ]; then echo "-restore"; fi`" -n "$(if [ "$local" = "1" ]; then echo "-l"; elif [ "$fsboot" = "1" ]; then echo "-f"; fi)"
"$dir"/img4 -i work/iBEC.patched -o work/iBEC.img4 -M work/IM4M -A -T "$(if [[ "$cpid" == *"0x801"* ]]; then echo "ibss"; else echo "ibec"; fi)"
if [[ "$deviceid" == "iPhone8"* ]] || [[ "$deviceid" == "iPad6"* ]] || [[ "$deviceid" == *'iPad5'* ]]; then if [[ "$deviceid" == "iPhone8"* ]] || [[ "$deviceid" == "iPad6"* ]] || [[ "$deviceid" == *'iPad5'* ]]; then
python3 -m pyimg4 im4p extract -i work/"$(awk "/""${model}""/{x=1}x&&/kernelcache.release/{print;exit}" work/BuildManifest.plist | grep '<string>' |cut -d\> -f2 |cut -d\< -f1)" -o work/kcache.raw --extra work/kpp.bin python3 -m pyimg4 im4p extract -i work/"$(awk "/""${model}""/{x=1}x&&/kernelcache.release/{print;exit}" work/BuildManifest.plist | grep '<string>' |cut -d\> -f2 |cut -d\< -f1)" -o work/kcache.raw --extra work/kpp.bin
@ -879,23 +896,17 @@ if [ true ]; then
sleep 1 sleep 1
set +e
"$dir"/gaster reset "$dir"/gaster reset
if [ "$dontRestore" = "1" ]; then
echo "finished creating boot files now you can --boot in order to get boot to the system"
exit;
fi
_runFuturerestore _runFuturerestore
sleep 1 sleep 1
echo " echo -e "\n \n \n \n did the futurerestore gave you a error like ERROR: Unable to send iBSS component: Unable to upload data to device, write (yes) to try again write (no) to exit "
did the futurerestore gave you a error like ERROR: Unable to send iBSS component: Unable to upload data to device, write (yes) to try again write (no) to exit
"
read -r answer read -r answer
if [ "$answer" = 'yes' ]; then if [ "$answer" = 'yes' ]; then