diff --git a/.gitignore b/.gitignore index 5ec4d10..72a046b 100644 --- a/.gitignore +++ b/.gitignore @@ -11,5 +11,6 @@ iP* saved/ resources/firmware/ resources/ipwndfu/ +resources/jailbreak/ resources/libirecovery/ tmp/ diff --git a/README.md b/README.md index 7f998fd..540cd9d 100755 --- a/README.md +++ b/README.md @@ -67,13 +67,12 @@ - If the script can't find your device in pwnREC mode or gets stuck, you may have to start over - Other than the above there's not much else I can help regarding entering pwnDFU mode... - For 32-bit devices: - - To devices with baseband, this script will restore your device with the latest baseband + - To devices with baseband, this script will restore your device with the latest baseband (except iOS 6 jailbreak) - This script has a workaround for the activation error on devices downgrading from iOS 10 - This script can also be used to just enter kDFU mode for all supported devices - This script can also restore your device to other iOS versions with provided SHSH blobs - As alternatives to kloader/kDFU, checkm8 A5 or ipwndfu can also be used in DFU advanced menu - To enter DFU advanced menu, put your iOS device in DFU mode before running the script - - This script does not modify the IPSW - This script can work on virtual machines, but I won't provide support for them ## Tools and other stuff used by this script: diff --git a/resources/FirmwareBundles/Down_iPad2,1_6.1.3_10B329.bundle/Info.plist b/resources/FirmwareBundles/Down_iPad2,1_6.1.3_10B329.bundle/Info.plist new file mode 100644 index 0000000..1011297 --- /dev/null +++ b/resources/FirmwareBundles/Down_iPad2,1_6.1.3_10B329.bundle/Info.plist @@ -0,0 +1,138 @@ + + + + + RootFilesystem + 048-2634-005.dmg + RootFilesystemSize + 1063 + Filename + iPad2,1_6.1.3_10B329_Restore.ipsw + RamdiskMountVolume + ramdisk + Name + iPhone2,1_6.1.3_10B329 + SubPlatform + 6 + Platform + 1 + RamdiskOptionsPath + /usr/local/share/restore/options.k93.plist + SHA1 + 241a02bb446c21e44e8470b77e09b5fbfba7d6c4 + BuildIdentitiesPatches + + UniqueBuildID + tmhlqSVs3hfYDCFEF1CNxG9edO8= + Manifest + + RestoreRamDisk + + Digest + soTe26MUEWqoKnxbAlm9uDrYEA4= + PartialDigest + QAAAAHhwMwEwggsDt8v7VOdjNK99c7EacJVHFA== + + + + RamdiskPatches + + asr + + File + usr/sbin/asr + Patch + asr.patch + + + DownloadUrl + + FilesystemPatches + + RootFilesystemMountVolume + BrightonMaps10B329.K93OS + FirmwarePatches + + iBSS + + File + Firmware/dfu/iBSS.k93ap.RELEASE.dfu + Key + 6e4cce9ea6f2ec346cba0b279beab1b43e44a0680f1fde789a00f66a1e68ffab + Decrypt + + Patch + iBSS.k93ap.RELEASE.patch + IV + b69f753dccd09c9b98d345ec73bbf044 + TypeFlag + 8 + + iBEC + + File + Firmware/dfu/iBEC.k93ap.RELEASE.dfu + Key + 69eaeb223db61b557c36d65fa7e6e4ec1c0d7547dfce9d46077f7e5b0fcba98f + Decrypt + + Patch + iBEC.k93ap.RELEASE.patch + IV + 3a0726b7bc091915dd928eed21478728 + TypeFlag + 8 + + RestoreDeviceTree + + File + Firmware/all_flash/all_flash.k93ap.production/DeviceTree.k93ap.img3 + Key + 7c9c0c49075fd6c47e1598f23901266237e30e60dcfc7174b8c2ea6f42532bfb + DecryptPath + Downgrade/DeviceTree.k93ap.img3 + IV + 557d2b8116b04cf93bf7bff023ed6bf2 + + RestoreLogo + + File + Firmware/all_flash/all_flash.k93ap.production/applelogo.s5l8940x.img3 + Key + 0e7aa7bbcfddc88dfe0e56e021363028502621c52c709afc3744850977e2fb9f + DecryptPath + Downgrade/applelogo@2x.s5l8940x.img3 + IV + 623b2592ad563ea16bd8a86af6960bcb + + Restore Ramdisk + + File + 048-2516-005.dmg + Key + d406dc4343eedf9d6567e8303ba39a21f81f99bf701840c888963af58a84fb8f + Decrypt + + TypeFlag + 8 + IV + 8775b711d2e09e332f8ebfbebe63cce7 + + RestoreKernelCache + + File + kernelcache.release.k93 + Key + 2bbdf3fea41600cd7ae46157af7f19b1726900802f2ec2022aa60b9a27a3261f + DecryptPath + Downgrade/kernelcache.release.k93 + TypeFlag + 4 + IV + 247ea923c137404f4faec7da75822b08 + + + RootFilesystemKey + 70f5ac054bf50a522fd39071f6acbd92954804599c1507b881d7d9c4026005e3867bfab0 + + diff --git a/resources/FirmwareBundles/Down_iPad2,1_6.1.3_10B329.bundle/asr.patch b/resources/FirmwareBundles/Down_iPad2,1_6.1.3_10B329.bundle/asr.patch new file mode 100644 index 0000000..5266c80 Binary files /dev/null and b/resources/FirmwareBundles/Down_iPad2,1_6.1.3_10B329.bundle/asr.patch differ diff --git a/resources/FirmwareBundles/Down_iPad2,1_6.1.3_10B329.bundle/iBEC.k93ap.RELEASE.patch b/resources/FirmwareBundles/Down_iPad2,1_6.1.3_10B329.bundle/iBEC.k93ap.RELEASE.patch new file mode 100644 index 0000000..0eba4eb Binary files /dev/null and b/resources/FirmwareBundles/Down_iPad2,1_6.1.3_10B329.bundle/iBEC.k93ap.RELEASE.patch differ diff --git a/resources/FirmwareBundles/Down_iPad2,1_6.1.3_10B329.bundle/iBSS.k93ap.RELEASE.patch b/resources/FirmwareBundles/Down_iPad2,1_6.1.3_10B329.bundle/iBSS.k93ap.RELEASE.patch new file mode 100644 index 0000000..65738f8 Binary files /dev/null and b/resources/FirmwareBundles/Down_iPad2,1_6.1.3_10B329.bundle/iBSS.k93ap.RELEASE.patch differ diff --git a/resources/FirmwareBundles/Down_iPad2,2_6.1.3_10B329.bundle/Info.plist b/resources/FirmwareBundles/Down_iPad2,2_6.1.3_10B329.bundle/Info.plist new file mode 100644 index 0000000..d0d472b --- /dev/null +++ b/resources/FirmwareBundles/Down_iPad2,2_6.1.3_10B329.bundle/Info.plist @@ -0,0 +1,138 @@ + + + + + RootFilesystem + 048-2475-005.dmg + RootFilesystemSize + 1088 + Filename + iPad2,2_6.1.3_10B329_Restore.ipsw + RamdiskMountVolume + ramdisk + Name + iPhone2,2_6.1.3_10B329 + SubPlatform + 6 + Platform + 1 + RamdiskOptionsPath + /usr/local/share/restore/options.k94.plist + SHA1 + 1b7897aea7b23d2e00e3d3c5c0ad2a0c47b345cd + BuildIdentitiesPatches + + UniqueBuildID + 8iAuVn4UX8D2WcdqFQyoa+kz0FQ= + Manifest + + RestoreRamDisk + + Digest + soTe26MUEWqoKnxbAlm9uDrYEA4= + PartialDigest + QAAAAHhwMwEwggsDt8v7VOdjNK99c7EacJVHFA== + + + + RamdiskPatches + + asr + + File + usr/sbin/asr + Patch + asr.patch + + + DownloadUrl + + FilesystemPatches + + RootFilesystemMountVolume + BrightonMaps10B329.K94OS + FirmwarePatches + + iBSS + + File + Firmware/dfu/iBSS.k94ap.RELEASE.dfu + Key + b1bd1dc5e6076054392be054d50711ae70e8fcf31a47899fb90ab0ff3111b687 + Decrypt + + Patch + iBSS.k94ap.RELEASE.patch + IV + bc3c9f168d7fb86aa219b7ad8039584b + TypeFlag + 8 + + iBEC + + File + Firmware/dfu/iBEC.k94ap.RELEASE.dfu + Key + f4b314ce6b84de8c2bcfc9e6821a657b964767253e214f44af33b141703f6606 + Decrypt + + Patch + iBEC.k94ap.RELEASE.patch + IV + 2a160d86a7cb6c976009725a9d8c009c + TypeFlag + 8 + + RestoreDeviceTree + + File + Firmware/all_flash/all_flash.k94ap.production/DeviceTree.k94ap.img3 + Key + dbb0ade4c92ec6e561dd51f513ea0332b490f89f4a168f11efc1e9967c02847d + DecryptPath + Downgrade/DeviceTree.k94ap.img3 + IV + 43fdbf9046da468ecc944bb4bee19879 + + RestoreLogo + + File + Firmware/all_flash/all_flash.k94ap.production/applelogo.s5l8940x.img3 + Key + 0e7aa7bbcfddc88dfe0e56e021363028502621c52c709afc3744850977e2fb9f + DecryptPath + Downgrade/applelogo@2x.s5l8940x.img3 + IV + 623b2592ad563ea16bd8a86af6960bcb + + Restore Ramdisk + + File + 048-2516-005.dmg + Key + 66affb95fd5f5e9b976cee5822c563dd111069746f13200c5641c500600f1426 + Decrypt + + TypeFlag + 8 + IV + b59813148a1246ef4f4e3a5aa70ac471 + + RestoreKernelCache + + File + kernelcache.release.k94 + Key + c835455a98365c5c0dda77348109a0e88faea4e4d879a0f07a4bece7b4cc64ac + DecryptPath + Downgrade/kernelcache.release.k94 + TypeFlag + 4 + IV + c3e3ba1bb5627935d508c9fdf2490eba + + + RootFilesystemKey + 19703b03962ad004afeab0f80fcff0dd2e3ddca02c9f0e08bcd635884e941797c0b9dece + + diff --git a/resources/FirmwareBundles/Down_iPad2,2_6.1.3_10B329.bundle/asr.patch b/resources/FirmwareBundles/Down_iPad2,2_6.1.3_10B329.bundle/asr.patch new file mode 100644 index 0000000..5266c80 Binary files /dev/null and b/resources/FirmwareBundles/Down_iPad2,2_6.1.3_10B329.bundle/asr.patch differ diff --git a/resources/FirmwareBundles/Down_iPad2,2_6.1.3_10B329.bundle/iBEC.k94ap.RELEASE.patch b/resources/FirmwareBundles/Down_iPad2,2_6.1.3_10B329.bundle/iBEC.k94ap.RELEASE.patch new file mode 100644 index 0000000..9f936f2 Binary files /dev/null and b/resources/FirmwareBundles/Down_iPad2,2_6.1.3_10B329.bundle/iBEC.k94ap.RELEASE.patch differ diff --git a/resources/FirmwareBundles/Down_iPad2,2_6.1.3_10B329.bundle/iBSS.k94ap.RELEASE.patch b/resources/FirmwareBundles/Down_iPad2,2_6.1.3_10B329.bundle/iBSS.k94ap.RELEASE.patch new file mode 100644 index 0000000..65738f8 Binary files /dev/null and b/resources/FirmwareBundles/Down_iPad2,2_6.1.3_10B329.bundle/iBSS.k94ap.RELEASE.patch differ diff --git a/resources/FirmwareBundles/Down_iPad2,3_6.1.3_10B329.bundle/Info.plist b/resources/FirmwareBundles/Down_iPad2,3_6.1.3_10B329.bundle/Info.plist new file mode 100644 index 0000000..d4b762b --- /dev/null +++ b/resources/FirmwareBundles/Down_iPad2,3_6.1.3_10B329.bundle/Info.plist @@ -0,0 +1,138 @@ + + + + + RootFilesystem + 048-2653-005.dmg + RootFilesystemSize + 1071 + Filename + iPad2,3_6.1.3_10B329_Restore.ipsw + RamdiskMountVolume + ramdisk + Name + iPhone2,3_6.1.3_10B329 + SubPlatform + 6 + Platform + 1 + RamdiskOptionsPath + /usr/local/share/restore/options.k95.plist + SHA1 + b02a4f3f5b6b948bdcd036caee71449201e72f63 + BuildIdentitiesPatches + + UniqueBuildID + k8/0Wy73uXDFAc84NnXIXIXUnHI= + Manifest + + RestoreRamDisk + + Digest + soTe26MUEWqoKnxbAlm9uDrYEA4= + PartialDigest + QAAAAHhwMwEwggsDt8v7VOdjNK99c7EacJVHFA== + + + + RamdiskPatches + + asr + + File + usr/sbin/asr + Patch + asr.patch + + + DownloadUrl + + FilesystemPatches + + RootFilesystemMountVolume + BrightonMaps10B329.K95OS + FirmwarePatches + + iBSS + + File + Firmware/dfu/iBSS.k95ap.RELEASE.dfu + Key + 0bb841b8f1922ae73d85ed9ed0d7a3583a10af909787857c15af2691b39bba30 + Decrypt + + Patch + iBSS.k95ap.RELEASE.patch + IV + 56f964ee19bfd31f06e43e9d8fe93902 + TypeFlag + 8 + + iBEC + + File + Firmware/dfu/iBEC.k95ap.RELEASE.dfu + Key + 12805eb0cabe89539cfecbf886b0638a6fe941976ef9afe8bf3dc838139357ba + Decrypt + + Patch + iBEC.k95ap.RELEASE.patch + IV + 5aeb8eb73be0c634f9fa2a4eae791438 + TypeFlag + 8 + + RestoreDeviceTree + + File + Firmware/all_flash/all_flash.k95ap.production/DeviceTree.k95ap.img3 + Key + 8debb89e1457cc695e10891312bdbfbb4d5f40f7eaa6913dfe7dc61be6d9e5c7 + DecryptPath + Downgrade/DeviceTree.k95ap.img3 + IV + e28736e5e1a7c3fd31021398ed65af62 + + RestoreLogo + + File + Firmware/all_flash/all_flash.k95ap.production/applelogo.s5l8940x.img3 + Key + 0e7aa7bbcfddc88dfe0e56e021363028502621c52c709afc3744850977e2fb9f + DecryptPath + Downgrade/applelogo@2x.s5l8940x.img3 + IV + 623b2592ad563ea16bd8a86af6960bcb + + Restore Ramdisk + + File + 048-2516-005.dmg + Key + fd1188246393949c4ae81c302221019a2699dba6185cb1460e39ee80f1c7424a + Decrypt + + TypeFlag + 8 + IV + 4edaee1b65d86a5f9a16c3ef09b262bf + + RestoreKernelCache + + File + kernelcache.release.k95 + Key + 0e2f5fa117fa62535dc18ee0526137d6e73b4fc69edec9d99f1528f2a632fc83 + DecryptPath + Downgrade/kernelcache.release.k95 + TypeFlag + 4 + IV + 0cc133db4539b82dee5849d6abbcc467 + + + RootFilesystemKey + b51815b65f7e572ad0cc1238bf799edb558b602b0ee390a76cd874d714b7daf10205b195 + + diff --git a/resources/FirmwareBundles/Down_iPad2,3_6.1.3_10B329.bundle/asr.patch b/resources/FirmwareBundles/Down_iPad2,3_6.1.3_10B329.bundle/asr.patch new file mode 100644 index 0000000..5266c80 Binary files /dev/null and b/resources/FirmwareBundles/Down_iPad2,3_6.1.3_10B329.bundle/asr.patch differ diff --git a/resources/FirmwareBundles/Down_iPad2,3_6.1.3_10B329.bundle/iBEC.k95ap.RELEASE.patch b/resources/FirmwareBundles/Down_iPad2,3_6.1.3_10B329.bundle/iBEC.k95ap.RELEASE.patch new file mode 100644 index 0000000..24e225b Binary files /dev/null and b/resources/FirmwareBundles/Down_iPad2,3_6.1.3_10B329.bundle/iBEC.k95ap.RELEASE.patch differ diff --git a/resources/FirmwareBundles/Down_iPad2,3_6.1.3_10B329.bundle/iBSS.k95ap.RELEASE.patch b/resources/FirmwareBundles/Down_iPad2,3_6.1.3_10B329.bundle/iBSS.k95ap.RELEASE.patch new file mode 100644 index 0000000..65738f8 Binary files /dev/null and b/resources/FirmwareBundles/Down_iPad2,3_6.1.3_10B329.bundle/iBSS.k95ap.RELEASE.patch differ diff --git a/resources/FirmwareBundles/Down_iPhone4,1_6.1.3_10B329.bundle/Info.plist b/resources/FirmwareBundles/Down_iPhone4,1_6.1.3_10B329.bundle/Info.plist new file mode 100644 index 0000000..023b8c3 --- /dev/null +++ b/resources/FirmwareBundles/Down_iPhone4,1_6.1.3_10B329.bundle/Info.plist @@ -0,0 +1,140 @@ + + + + + RootFilesystem + 048-2613-005.dmg + RootFilesystemSize + 1220 + Filename + iPhone4,1_6.1.3_10B329_Restore.ipsw + RamdiskMountVolume + ramdisk + Name + iPhone4,1_6.1.3_10B329 + SubPlatform + 6 + Platform + 1 + RamdiskOptionsPath + /usr/local/share/restore/options.n94.plist + SHA1 + 7a62ee60b574301a6aafc48dcc9cccf0894ffb27 + BuildIdentitiesPatches + + UniqueBuildID + 3Usl6yRx4qezMq1vuVZf69RDnU8= + Manifest + + RestoreRamDisk + + Digest + soTe26MUEWqoKnxbAlm9uDrYEA4= + PartialDigest + QAAAAHhwMwEwggsDt8v7VOdjNK99c7EacJVHFA== + + + + RamdiskPatches + + asr + + File + usr/sbin/asr + Patch + asr.patch + + + DownloadUrl + + FilesystemPatches + + RootFilesystemMountVolume + BrightonMaps10B329.N94OS + UniqueBuildID + 3Usl6yRx4qezMq1vuVZf69RDnU8= + FirmwarePatches + + iBSS + + File + Firmware/dfu/iBSS.n94ap.RELEASE.dfu + Key + 35343d5139e0313c81ee59dbae292da26e739ed75b3da5db9da7d4d26046498c + Decrypt + + Patch + iBSS.n94ap.RELEASE.patch + IV + d3fe01e99bd0967e80dccfc0739f93d5 + TypeFlag + 8 + + iBEC + + File + Firmware/dfu/iBEC.n94ap.RELEASE.dfu + Key + aba0d7f3e2d40d2a0039a36086c469e25e1eafb2fee2f50e36a3e5f7cd4d89c9 + Decrypt + + Patch + iBEC.n94ap.RELEASE.patch + IV + 1f12075441b7f193c5967c51ede025bf + TypeFlag + 8 + + RestoreDeviceTree + + File + Firmware/all_flash/all_flash.n94ap.production/DeviceTree.n94ap.img3 + Key + bd500bdc2a66aba636311037b9bd2b6ab3bd7374542352225d5be0c23998dd84 + DecryptPath + Downgrade/DeviceTree.n94ap.img3 + IV + fabb698a3b2e845d7ad6849fbc067870 + + RestoreLogo + + File + Firmware/all_flash/all_flash.n94ap.production/applelogo@2x.s5l8940x.img3 + Key + e7e9b79f5e6e81ff6d6bf81bf272af56e6ab0f1c691088eff2aca5b1ee31455e + DecryptPath + Downgrade/applelogo@2x.s5l8940x.img3 + IV + 09678f1312084547b5bedce677e6a828 + + Restore Ramdisk + + File + 048-2516-005.dmg + Key + 1d8da07783a6f53efbb47657c352b305f0856697c6c824a9132ea0effe1a92a9 + Decrypt + + TypeFlag + 8 + IV + d30fa37b6ed56715121337a5fc039801 + + RestoreKernelCache + + File + kernelcache.release.n94 + Key + a374109c958957200f879f7b6ef34437fbde1a9f178b7c2412755cf9a3ed2d72 + DecryptPath + Downgrade/kernelcache.release.n94 + TypeFlag + 4 + IV + 8a2c03ef8a0e45947780cdde01be40fb + + + RootFilesystemKey + d4685a3c01a0b6f762350191d98b8964d4c7af349aa84bacef828be9683514ccf44a8426 + + diff --git a/resources/FirmwareBundles/Down_iPhone4,1_6.1.3_10B329.bundle/asr.patch b/resources/FirmwareBundles/Down_iPhone4,1_6.1.3_10B329.bundle/asr.patch new file mode 100644 index 0000000..5266c80 Binary files /dev/null and b/resources/FirmwareBundles/Down_iPhone4,1_6.1.3_10B329.bundle/asr.patch differ diff --git a/resources/FirmwareBundles/Down_iPhone4,1_6.1.3_10B329.bundle/iBEC.n94ap.RELEASE.patch b/resources/FirmwareBundles/Down_iPhone4,1_6.1.3_10B329.bundle/iBEC.n94ap.RELEASE.patch new file mode 100644 index 0000000..0179cb7 Binary files /dev/null and b/resources/FirmwareBundles/Down_iPhone4,1_6.1.3_10B329.bundle/iBEC.n94ap.RELEASE.patch differ diff --git a/resources/FirmwareBundles/Down_iPhone4,1_6.1.3_10B329.bundle/iBSS.n94ap.RELEASE.patch b/resources/FirmwareBundles/Down_iPhone4,1_6.1.3_10B329.bundle/iBSS.n94ap.RELEASE.patch new file mode 100644 index 0000000..0241517 Binary files /dev/null and b/resources/FirmwareBundles/Down_iPhone4,1_6.1.3_10B329.bundle/iBSS.n94ap.RELEASE.patch differ diff --git a/resources/tools/idevicerestore_linux b/resources/tools/idevicerestore_linux new file mode 100755 index 0000000..35446e7 Binary files /dev/null and b/resources/tools/idevicerestore_linux differ diff --git a/resources/tools/idevicerestore_macos b/resources/tools/idevicerestore_macos new file mode 100755 index 0000000..52737c3 Binary files /dev/null and b/resources/tools/idevicerestore_macos differ diff --git a/resources/tools/ipsw_linux b/resources/tools/ipsw_linux new file mode 100755 index 0000000..0430a4c Binary files /dev/null and b/resources/tools/ipsw_linux differ diff --git a/resources/tools/ipsw_macos b/resources/tools/ipsw_macos new file mode 100755 index 0000000..288962f Binary files /dev/null and b/resources/tools/ipsw_macos differ diff --git a/restore.sh b/restore.sh index 5d6fb28..7c04b92 100755 --- a/restore.sh +++ b/restore.sh @@ -42,9 +42,11 @@ function Main { bspatch="bspatch" ideviceenterrecovery="ideviceenterrecovery" ideviceinfo="ideviceinfo" + idevicerestore="sudo LD_LIBRARY_PATH=resources/lib resources/tools/idevicerestore_linux" iproxy="iproxy" + ipsw="env LD_LIBRARY_PATH=lib tools/ipsw_$platform" irecovery="env LD_LIBRARY_PATH=resources/lib resources/libirecovery/bin/irecovery" - pwnedDFU="sudo LD_LIBRARY_PATH=resources/lib resources/tools/pwnedDFU_$platform" + pwnedDFU="sudo LD_LIBRARY_PATH=resources/lib resources/tools/pwnedDFU_linux" python="python2" futurerestore1="sudo LD_PRELOAD=resources/lib/libcurl.so.3 LD_LIBRARY_PATH=resources/lib resources/tools/futurerestore1_linux" futurerestore2="sudo LD_LIBRARY_PATH=resources/lib resources/tools/futurerestore2_linux" @@ -56,7 +58,9 @@ function Main { bspatch="resources/tools/bspatch_$platform" ideviceenterrecovery="resources/libimobiledevice_$platform/ideviceenterrecovery" ideviceinfo="resources/libimobiledevice_$platform/ideviceinfo" + idevicerestore="resources/tools/idevicerestore_$platform" iproxy="resources/libimobiledevice_$platform/iproxy" + ipsw="tools/ipsw_$platform" irecovery="resources/libimobiledevice_$platform/irecovery" pwnedDFU="resources/tools/pwnedDFU_$platform" python="python" @@ -170,7 +174,7 @@ function SelectVersion { fi if [ $ProductType == iPad2,1 ] || [ $ProductType == iPad2,2 ] || [ $ProductType == iPad2,3 ] || [ $ProductType == iPhone4,1 ]; then - Selection+=("iOS 6.1.3") + Selection+=("iOS 6.1.3 (Jailbreak)" "iOS 6.1.3") fi [[ $Mode == 'Downgrade' ]] && Selection+=("Other") Selection+=("(Any other key to exit)") @@ -178,6 +182,7 @@ function SelectVersion { select opt in "${Selection[@]}"; do case $opt in "iOS 8.4.1" ) OSVer='8.4.1'; BuildVer='12H321'; break;; + "iOS 6.1.3 (Jailbreak)" ) OSVer='6.1.3'; BuildVer='10B329'; A5Jailbreak=1; break;; "iOS 6.1.3" ) OSVer='6.1.3'; BuildVer='10B329'; break;; "Other" ) OSVer='Other'; break;; *) exit;; @@ -383,6 +388,34 @@ function Downgrade { [ ! $DFUManual ] && kDFU + if [[ $A5Jailbreak == 1 ]]; then + JBFiles=(Cydia6.tar fstab_rw.tar p0sixspwn.tar) + JBSHA1=(1d5a351016d2546aa9558bc86ce39186054dc281 + 887f82cb601116ee78ad752eca7007128b6b38d3 + 6b003d3baddbafed2b468ba11328374d2dab276b) + JBLink=https://github.com/LukeZGD/iOS-OTA-Downgrader-Keys/releases/download/jailbreak + if [[ ! $(ls resources/jailbreak) ]]; then + cd tmp + Log "Downloading jailbreak files..." + for i in {0..2}; do + SaveFile $JBLink/jailbreak/${JBFiles[$i]} ${JBFiles[$i]} ${JBSHA1[$i]} + done + mkdir ../resources/jailbreak + cp ${JBFiles[@]} ../resources/jailbreak + cd .. + fi + for i in {0..2}; do + JBFiles[$i]=jailbreak/${JBFiles[$i]} + done + if [ ! -e $IPSWCustom.ipsw ]; then + Log "Preparing custom IPSW..." + cd resources + $ipsw ../$IPSW.ipsw ../$IPSWCustom.ipsw -memory -bbupdate -s 1260 ${JBFiles[@]} + cd .. + fi + IPSW=$IPSWCustom + fi + Log "Extracting IPSW..." unzip -q $IPSW.ipsw -d $IPSW/ @@ -429,12 +462,20 @@ function Downgrade { SaveOTABlobs fi - Log "Preparing for futurerestore... (Enter root password of your PC/Mac when prompted)" - cd resources - sudo bash -c "$python -m SimpleHTTPServer 80 &" - cd .. + if [[ -z $A5Jailbreak ]] && [[ -z $A7Device ]]; then + Log "Preparing for futurerestore... (Enter root password of your PC/Mac when prompted)" + cd resources + sudo bash -c "$python -m SimpleHTTPServer 80 &" + cd .. + fi - if [ $Baseband == 0 ]; then + if [[ $A5Jailbreak == 1 ]]; then + Log "Proceeding to idevicerestore..." + mkdir shsh + mv $SHSH shsh/${UniqueChipID}-${ProductType}-${OSVer}.shsh + $idevicerestore -y -e -w $IPSW.ipsw + rm -rf shsh + elif [ $Baseband == 0 ]; then Log "Device $ProductType has no baseband" Log "Proceeding to futurerestore..." if [[ $A7Device == 1 ]]; then @@ -476,9 +517,11 @@ function Downgrade { fi echo - Log "futurerestore done!" - Log "Stopping local server... (Enter root password of your PC/Mac when prompted)" - ps aux | awk '/python/ {print "sudo kill -9 "$2" 2>/dev/null"}' | bash + Log "Restoring done!" + if [[ -z $A5Jailbreak ]] && [[ -z $A7Device ]]; then + Log "Stopping local server... (Enter root password of your PC/Mac when prompted)" + ps aux | awk '/python/ {print "sudo kill -9 "$2" 2>/dev/null"}' | bash + fi Log "Downgrade script done!" }