├── README.md ├── restore_ipad2_ios6.sh ├── restore_ipad2_ios7.sh ├── restore_ipad2_ios9.sh ├── restore_ipad3_cellular_ios5.sh ├── restore_ipad3_cellular_ios6.sh ├── restore_ipad3_cellular_ios7.sh ├── restore_ipad3_cellular_ios9.sh ├── restore_ipad3_ios6.sh ├── restore_ipad3_ios7.sh ├── restore_ipad3_ios9.sh ├── restore_ipad4_cellular_ios6.sh ├── restore_ipad4_cellular_ios7.sh ├── restore_ipad4_cellular_ios9.sh ├── restore_iphone4s_ios5.sh ├── restore_iphone4s_ios6.sh ├── restore_iphone4s_ios7.sh ├── restore_iphone4s_ios9.sh ├── restore_iphone5_ios6.sh ├── restore_iphone5_ios7.sh ├── restore_iphone5_ios9.sh ├── restore_iphone5c_ios7.sh └── restore_iphone5c_ios9.sh /README.md: -------------------------------------------------------------------------------- 1 | # A5/A6 iOS tethered downgrade bash scripts 2 | 3 | ### Disclaimer 4 | 5 | This is BETA software. This may boot loop or brick your device if you don't know what you're doing. This is a tethered up/downgrade, since there is no iBoot/bootROM exploit to boot the device after a reboot, so you'll have to restore your device to a signed iOS version. 6 | 7 | *** 8 | ### Contents 9 | 10 | These bash scripts are an attempt to make tether-up/downgrading an A5/A6 device to (almost) any iOS easier. The original tutorial can be found here: 11 | https://www.reddit.com/r/jailbreak/comments/7v6pxu/release_tutorial_how_to_downgrade_any_32_bit/ 12 | 13 | These are the contents: 14 | 15 | * restore_iphone4s_ios5.sh - for up/downgrading an iPhone 4S to iOS 5.0-5.1.1 16 | 17 | * restore_iphone4s_ios6.sh - for up/downgrading an iPhone 4S to iOS 6.0-6.1.3** 18 | 19 | * restore_iphone4s_ios7.sh - for up/downgrading an iPhone 4S to iOS 7.0-8.4.1* 20 | 21 | * restore_iphone4s_ios9.sh - for up/downgrading an iPhone 4S to iOS 9.0-9.3.5*** 22 | 23 | * restore_iphone5_ios6.sh - for up/downgrading an iPhone 5 to iOS 6.0-6.1.4 24 | 25 | * restore_iphone5_ios7.sh - for up/downgrading an iPhone 5 to iOS 7.0-8.4.1* 26 | 27 | * restore_iphone5_ios9.sh - for up/downgrading an iPhone 5 to iOS 9.0-10.3.3*** 28 | 29 | * restore_iphone5c_ios7.sh - for up/downgrading an iPhone 5C to iOS 7.0-8.4.1 30 | 31 | * restore_iphone5c_ios9.sh - for up/downgrading an iPhone 5C to iOS 9.0-10.3.3*** 32 | 33 | * restore_ipad2_ios6.sh - for up/downgrading an iPad 2 (Wi-Fi or Cellular) to iOS 5.0-6.1.3** 34 | 35 | * restore_ipad2_ios7.sh - for up/downgrading an iPad 2 (Wi-Fi or Cellular) to iOS 7.0-8.4.1* 36 | 37 | * restore_ipad2_ios9.sh - for up/downgrading an iPad 2 (Wi-Fi or Cellular) to iOS 9.0-9.3.5*** 38 | 39 | * restore_ipad3_ios6.sh - for up/downgrading an iPad 3/4/mini 1 (Wi-Fi) to iOS 5.1-6.1.3. Can be used on the iPod touch 5. 40 | 41 | * restore_ipad3_ios7.sh - for up/downgrading an iPad 3/4/mini 1 (Wi-Fi) to iOS 7.0-8.4.1. Can be used on the iPod touch 5.* 42 | 43 | * restore_ipad3_ios9.sh - for up/downgrading an iPad 3/4/mini 1 (Wi-Fi) to iOS 9.0-9.3.5. Can be used on the iPod touch 5.*** 44 | 45 | * restore_ipad3_cellular_ios5.sh - for up/downgrading an iPad 3 (Cellular) to iOS 5.1-5.1.1 46 | 47 | * restore_ipad3_cellular_ios6.sh - for up/downgrading an iPad 3 (Cellular) to iOS 5.1-6.1.3 48 | 49 | * restore_ipad3_cellular_ios7.sh - for up/downgrading an iPad 3 (Cellular) to iOS 7.0-8.4.1* 50 | 51 | * restore_ipad3_cellular_ios9.sh - for up/downgrading an iPad 3 (Cellular) to iOS 9.0-9.3.5*** 52 | 53 | * restore_ipad4_cellular_ios6.sh - for up/downgrading an iPad 4/mini 1 (Cellular) to iOS 6.0-6.1.3 54 | 55 | * restore_ipad4_cellular_ios7.sh - for up/downgrading an iPad 4/mini 1 (Cellular) to iOS 7.0-8.4.1* 56 | 57 | * restore_ipad4_cellular_ios9.sh - for up/downgrading an iPad 4/mini 1 (Cellular) to iOS 9.0-10.3.3*** 58 | 59 | \* iOS 8.4.1 is OTA-signed for most compatible 32 bit devices except for iPhone 5C. 60 | 61 | ** iOS 6.1.3 is signed for iPhone 4S and iPad 2 (except iPad2,4). 62 | 63 | \*** iOS 9.3.5 and 10.3.3 is the latest version for A5/A6 devices respectively. 64 | 65 | 64-bit devices are not compatible with this method. 66 | 67 | Note: if you are up/downgrading to iOS 9.0 beta 1-4 use the restore__ios7.sh since the contents of `/var` on iOS 9.0 beta 1-4 root filesystems are larger than on iOS 9.0 beta 5 and newer. 68 | 69 | ### How to use 70 | 71 | 1. Download the ipsw of the firmware you want to up/downgrade to, decrypt the root filesystem, iBSS, iBEC, apple logo, device tree, and kernel cache, dual boot using CoolBooter to iOS 6.1.3 if you’re up/downgrading to iOS 6.1.3 or earlier or to iOS 7.1.2 if you’re installing iOS 7.0 or newer in the same way as the original tutorial, and open `BuildManifest.plist`. Alternatively, you can decrypt a ramdisk (it doesn't matter if it is restore or update ramdisk) using xpwntool, mount the ramdisk, and open `/usr/local/share/restore/options.plist`, search for `SystemPartitionSize` and `SystemPartitionPadding`. 72 | 73 | 2. Download the scripts and open the the one appropriate for your device/iOS version mentioned before, replace `` with the value of `SystemPartitionSize` from before, `` with the value for your device capacity, e.g. if you have a 64 GB device replace it with `640`, or if you have a 16 GB device, replace it with `160`, and `` with the `SystemPartitionPadding` value multiplied by 1048576, e.g. if the value was 640 it should be 671088640, or if the value was 160 it should be 167772160. 74 | 75 | 3. Once you have dual booted using CoolBooter and added values to the script, download @nyan_satan's dualbootstuff.deb from [here] (https://github.com/NyanSatan/nyansatan.github.io/blob/master/apt/deb_files/dualbootstuff.deb?raw=true), copy the script you edited before, dualbootstuff.deb, the decrypted kernel cache (it must be named "kernelcache"), apticket.der (if you are upgrading from iOS ≤6.1.3 to iOS ≥7.0), the decrypted and patched iBSS (or iBEC if you're using an iPad) to the root directory and the decrypted root filesystem (it must be named "UDZO.dmg") to `/var`. 76 | 77 | 4. SSH into your device, if it says "Are you sure you want to continue connecting", type `yes`. The default root password is `alpine`. Then type `chmod +x /restore__iosx.sh`, and type `/restore__iosx.sh` to start installing the target iOS. It'll automatically partition the device, flash the filesystem, and kloader the iBSS or iBEC. 78 | 79 | 5. Unplug and replug the device or press the home button and upload the files using irecovery in this sequence: 80 | 81 | `irecovery -f iBEC`* 82 | 83 | `irecovery -f applelogo` 84 | 85 | `irecovery -c setpicture` 86 | 87 | `irecovery -c 'bgcolor 0 0 0'` 88 | 89 | `irecovery -f devicetree` 90 | 91 | `irecovery -c devicetree` 92 | 93 | `irecovery -f kernelcache` 94 | 95 | `irecovery -c bootx` 96 | 97 | If all worked, the device should successfully boot into iOS. 98 | 99 | \* Skip that command if you're using an iPad. 100 | -------------------------------------------------------------------------------- /restore_ipad2_ios6.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | dpkg -i /dualbootstuff.deb 3 | rm /dualbootstuff.deb 4 | mkdir /mnt1 5 | mkdir /mnt2 6 | # Check the file systems and mount them. 7 | fsck_hfs -fy /dev/disk0s1s1 8 | fsck_hfs -fy /dev/disk0s1s2; mount -t hfs /dev/disk0s1s1 /mnt1 && cp -a /mnt1/etc/fstab /var 9 | umount /mnt1 10 | # Edit the partition table to make room for the file system that we'll flash using asr later. 11 | system_size="$((+))" 12 | systemsize="$(($system_size*1024*1024/8192+5))" 13 | (echo -e "d\n1\nd\n2\nn\n\1\n\n$systemsize\n\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 14 | sync 15 | sync 16 | sync && (echo -e "d\n1\nn\n\1\n\n\n\nd\n2\n\nn\n2\n\n\n\nc\n1\nSystem\nc\n2\nData\nx\na\n2\n48\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 17 | sync 18 | sync 19 | sync 20 | # Erase the file systems using newfs_hfs. 21 | newfs_hfs -s -v System -J -b 8192 -n a=8192,c=8192,e=8192 /dev/disk0s1s1 && newfs_hfs -s -v Data -J -P -b 8192 -n a=8192,c=8192,e=8192 /dev/disk0s1s2 && fsck_hfs -fy /dev/disk0s1s1 && fsck_hfs -fy /dev/disk0s1s2 22 | # Flash the file system. 23 | asr restore -source /var/UDZO.dmg -target /dev/disk0s1s1 -erase -noprompt -puppetstrings && fsck_hfs -fy /dev/disk0s1s1 && mount -t hfs /dev/disk0s1s1 /mnt1 && fsck_hfs -fy /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s2 /mnt2 && mv -v /mnt1/private/var/* /mnt2 && cp -a /var/fstab /mnt1/etc && umount /mnt2 && mount -t hfs /dev/disk0s1s2 /var && fixkeybag && umount -f /var && mount -t hfs /dev/disk0s1s2 /mnt2 && mv /kernelcache /mnt1/System/Library/Caches/com.apple.kernelcaches && echo Cleaning up... && rm -rf /var/UDZO.dmg && 24 | mv /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/Support/softwareupdateservicesd /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/ 25 | cd /mnt2/mobile/Media 26 | cp -a /iBEC /usr/bin/hfs_resize /usr/bin/kloader . 27 | ./hfs_resize 28 | ./kloader 29 | # Destroy partitions made by CoolBooter and use kloader to jump to a pwned iBEC. 30 | used_size="$(df -B1 | sed -n -e 's/^.*\/dev\/disk0s1s1 //p'| sed -e 's/^[ \t]*//' | sed 's/[^ ]* //' | sed 's/ .*//')" 31 | system_size2="$(($used_size+))" 32 | new_system_size="$(($system_size2/8192+3))" 33 | hfs_resize /mnt1 $system_size2 34 | System_GUID="$((echo -e "i\n1\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 35 | Data_GUID="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 36 | (echo -e "d\n1\nd\n2\nd\n3\nd\nn\n1\n\n$new_system_size\n\nc\nSystem\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n\nc\n1\n$System_GUID\nc\n2\n$Data_GUID\nw\nY\n") | gptfdisk /dev/rdisk0s1 37 | data_size="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition size: //p' | sed 's/ .*//')" 38 | data_size2="$(($data_size-3))" 39 | new_data_size="$(($data_size2*8192))" 40 | ./hfs_resize /mnt2 $new_data_size; ./kloader iBEC 41 | 42 | 43 | -------------------------------------------------------------------------------- /restore_ipad2_ios7.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | dpkg -i /dualbootstuff.deb 3 | rm /dualbootstuff.deb 4 | mkdir /mnt1 5 | mkdir /mnt2 6 | # Check the file systems and mount them. 7 | fsck_hfs -fy /dev/disk0s1s1 8 | fsck_hfs -fy /dev/disk0s1s2; mount -t hfs /dev/disk0s1s1 /mnt1 && cp -a /mnt1/etc/fstab /var 9 | cp -a /mnt1/System/Library/Caches/apticket.der / 10 | umount /mnt1 11 | # Edit the partition table to make room for the file system that we'll flash using asr later. 12 | system_size="$((+))" 13 | systemsize="$(($system_size*1024*1024/8192+5))" 14 | (echo -e "d\n1\nd\n2\nn\n\1\n\n$systemsize\n\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 15 | sync 16 | sync 17 | sync && (echo -e "d\n1\nn\n\1\n\n\n\nd\n2\n\nn\n2\n\n\n\nc\n1\nSystem\nc\n2\nData\nx\na\n2\n48\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 18 | sync 19 | sync 20 | sync 21 | # Erase the file systems using newfs_hfs. 22 | newfs_hfs -s -v System -J -b 8192 -n a=8192,c=8192,e=8192 /dev/disk0s1s1 && newfs_hfs -s -v Data -J -P -b 8192 -n a=8192,c=8192,e=8192 /dev/disk0s1s2 && fsck_hfs -fy /dev/disk0s1s1 && fsck_hfs -fy /dev/disk0s1s2 23 | # Flash the file system. 24 | asr restore -source /var/UDZO.dmg -target /dev/disk0s1s1 -erase -noprompt -puppetstrings && fsck_hfs -fy /dev/disk0s1s1 && mount -t hfs /dev/disk0s1s1 /mnt1 && fsck_hfs -fy /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s2 /mnt2 && mv -v /mnt1/private/var/* /mnt2 && cp -a /var/fstab /mnt1/etc && umount /mnt2 && mount -t hfs /dev/disk0s1s2 /var && fixkeybag && umount -f /var && mount -t hfs /dev/disk0s1s2 /mnt2 && mv /apticket.der /mnt1/System/Library/Caches && mv /kernelcache /mnt1/System/Library/Caches/com.apple.kernelcaches && echo Cleaning up... && rm -rf /var/UDZO.dmg && 25 | mv /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/Support/softwareupdateservicesd /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/ 26 | cd /mnt2/mobile/Media 27 | cp -a /iBEC /usr/bin/hfs_resize /usr/bin/kloader . 28 | ./hfs_resize 29 | ./kloader 30 | # Destroy partitions made by CoolBooter and use kloader to jump to a pwned iBEC. 31 | used_size="$(df -B1 | sed -n -e 's/^.*\/dev\/disk0s1s1 //p'| sed -e 's/^[ \t]*//' | sed 's/[^ ]* //' | sed 's/ .*//')" 32 | system_size2="$(($used_size+))" 33 | new_system_size="$(($system_size2/8192+3))" 34 | hfs_resize /mnt1 $system_size2 35 | System_GUID="$((echo -e "i\n1\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 36 | Data_GUID="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 37 | (echo -e "d\n1\nd\n2\nd\n3\nd\nn\n1\n\n$new_system_size\n\nc\nSystem\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n\nc\n1\n$System_GUID\nc\n2\n$Data_GUID\nw\nY\n") | gptfdisk /dev/rdisk0s1 38 | data_size="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition size: //p' | sed 's/ .*//')" 39 | data_size2="$(($data_size-3))" 40 | new_data_size="$(($data_size2*8192))" 41 | ./hfs_resize /mnt2 $new_data_size; ./kloader iBEC 42 | 43 | 44 | -------------------------------------------------------------------------------- /restore_ipad2_ios9.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | dpkg -i /dualbootstuff.deb 3 | rm /dualbootstuff.deb 4 | mkdir /mnt1 5 | mkdir /mnt2 6 | # Check the file systems and mount them. 7 | fsck_hfs -fy /dev/disk0s1s1 8 | fsck_hfs -fy /dev/disk0s1s2; mount -t hfs /dev/disk0s1s1 /mnt1 && cp -a /mnt1/etc/fstab /var 9 | cp -a /mnt1/System/Library/Caches/apticket.der / 10 | umount /mnt1 11 | # Edit the partition table to make room for the file system that we'll flash using asr later. 12 | system_size="$((+))" 13 | systemsize="$(($system_size*1024*1024/8192+5))" 14 | (echo -e "d\n1\nd\n2\nn\n\1\n\n$systemsize\n\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 15 | sync 16 | sync 17 | sync && (echo -e "d\n1\nn\n\1\n\n\n\nd\n2\n\nn\n2\n\n\n\nc\n1\nSystem\nc\n2\nData\nx\na\n2\n48\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 18 | sync 19 | sync 20 | sync 21 | # Erase the file systems using newfs_hfs. 22 | newfs_hfs -s -v System -J -b 8192 -n a=8192,c=8192,e=8192 /dev/disk0s1s1 && newfs_hfs -s -v Data -J -P -b 8192 -n a=8192,c=8192,e=8192 /dev/disk0s1s2 && fsck_hfs -fy /dev/disk0s1s1 && fsck_hfs -fy /dev/disk0s1s2 23 | # Flash the file system. 24 | asr restore -source /var/UDZO.dmg -target /dev/disk0s1s1 -erase -noprompt -puppetstrings && fsck_hfs -fy /dev/disk0s1s1 && mount -t hfs /dev/disk0s1s1 /mnt1 && fsck_hfs -fy /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s2 /mnt2 && mv -v /mnt1/private/var/* /mnt2 && cp -a /var/fstab /mnt1/etc && umount /mnt2 && mount -t hfs /dev/disk0s1s2 /var && fixkeybag && umount -f /var && mount -t hfs /dev/disk0s1s2 /mnt2 && mv /apticket.der /mnt1/System/Library/Caches && mv /kernelcache /mnt1/System/Library/Caches/com.apple.kernelcaches && echo Cleaning up... && rm -rf /var/UDZO.dmg && 25 | mv /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/Support/softwareupdateservicesd /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/ 26 | cd /mnt2/mobile/Media 27 | cp -a /iBEC /usr/bin/hfs_resize /usr/bin/kloader . 28 | ./hfs_resize 29 | ./kloader 30 | # Destroy partitions made by CoolBooter and use kloader to jump to a pwned iBEC. 31 | used_size="$(df -B1 | sed -n -e 's/^.*\/dev\/disk0s1s1 //p'| sed -e 's/^[ \t]*//' | sed 's/[^ ]* //' | sed 's/ .*//')" 32 | system_size2="$(($used_size+))" 33 | new_system_size="$(($system_size2/8192+3))" 34 | hfs_resize /mnt1 $system_size2 35 | System_GUID="$((echo -e "i\n1\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 36 | Data_GUID="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 37 | (echo -e "d\n1\nd\n2\nd\n3\nd\nn\n1\n\n$new_system_size\n\nc\nSystem\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n\nc\n1\n$System_GUID\nc\n2\n$Data_GUID\nw\nY\n") | gptfdisk /dev/rdisk0s1 38 | data_size="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition size: //p' | sed 's/ .*//')" 39 | data_size2="$(($data_size-3))" 40 | new_data_size="$(($data_size2*8192))" 41 | ./hfs_resize /mnt1 $system_size2; ./hfs_resize /mnt2 $new_data_size; ./kloader iBEC 42 | 43 | 44 | -------------------------------------------------------------------------------- /restore_ipad3_cellular_ios5.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | dpkg -i /dualbootstuff.deb 3 | rm /dualbootstuff.deb 4 | mkdir /mnt1 5 | mkdir /mnt2 6 | # Check the file systems and mount them. 7 | fsck_hfs -fy /dev/disk0s1s1 8 | fsck_hfs -fy /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s1 /mnt1 && cp -a /mnt1/etc/fstab /var 9 | umount /mnt1 10 | # Edit the partition table to make room for the file system that we'll flash using asr later. 11 | system_size="$((+))" 12 | systemsize="$(($system_size*1024*1024/4096+5))" 13 | (echo -e "d\n1\nd\n2\nn\n\1\n\n$systemsize\n\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n49\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 14 | sync 15 | sync 16 | sync && (echo -e "d\n1\nn\n\1\n\n\n\nd\n2\n\nn\n2\n\n\n\nc\n1\nSystem\nc\n2\nData\nx\na\n2\n48\n49\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 17 | sync 18 | sync 19 | sync 20 | # Erase the file systems using newfs_hfs. 21 | newfs_hfs -s -v System -J /dev/disk0s1s1 && newfs_hfs -s -v Data -J -P /dev/disk0s1s2 && fsck_hfs -fy /dev/disk0s1s1 && fsck_hfs -fy /dev/disk0s1s2 22 | # Flash the file system. 23 | asr restore -source /var/UDZO.dmg -target /dev/disk0s1s1 -erase -noprompt -puppetstrings && fsck_hfs -f /dev/disk0s1s1 && mount -t hfs /dev/disk0s1s1 /mnt1 && fsck_hfs -f /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s2 /mnt2 && cd /usr/standalone/firmware/Baseband/Mav4/ && mkdir -p /mnt1/usr/standalone/firmware/Baseband/Mav4 && cp -a /usr/standalone/firmware/Baseband/Mav4/Mav4-personalized.zip /mnt1/usr/standalone/firmware/Baseband/Mav4 && mv -v /mnt1/var/* /mnt2 && cp -a /var/fstab /mnt1/etc && umount /mnt2 && mount -t hfs /dev/disk0s1s2 /var && fixkeybag && umount -f /var && mount -t hfs /dev/disk0s1s2 /mnt2 && mv /kernelcache /mnt1/System/Library/Caches/com.apple.kernelcaches && rm -rf /var/UDZO.dmg && 24 | mv /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/Support/softwareupdateservicesd /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/ && cd /mnt2/mobile/Media 25 | cp -a /iBEC /usr/bin/hfs_resize /usr/bin/kloader . 26 | ./hfs_resize 27 | ./kloader 28 | # Destroy partitions made by CoolBooter and use kloader to jump to a pwned iBEC. 29 | used_size="$(df -B1 | sed -n -e 's/^.*\/dev\/disk0s1s1 //p'| sed -e 's/^[ \t]*//' | sed 's/[^ ]* //' | sed 's/ .*//')" 30 | system_size2="$(($used_size+))" 31 | new_system_size="$(($system_size2/4096+5))" 32 | hfs_resize /mnt1 $system_size2 33 | System_GUID="$((echo -e "i\n1\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 34 | Data_GUID="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 35 | (echo -e "d\n1\nd\n2\nd\n3\nd\n4\nn\n1\n\n$new_system_size\n\nc\nSystem\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n49\n\nc\n1\n$System_GUID\n\nc\n2\n$Data_GUID\nw\nY\n") | gptfdisk /dev/rdisk0s1 36 | data_size="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition size: //p' | sed 's/ .*//')" 37 | data_size2="$(($data_size-5))" 38 | new_data_size="$(($data_size2*4096))" 39 | ./hfs_resize /mnt2 $new_data_size; ./kloader iBEC 40 | -------------------------------------------------------------------------------- /restore_ipad3_cellular_ios6.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | dpkg -i /dualbootstuff.deb 3 | rm /dualbootstuff.deb 4 | mkdir /mnt1 5 | mkdir /mnt2 6 | # Check the file systems and mount them. 7 | fsck_hfs -fy /dev/disk0s1s1 8 | fsck_hfs -fy /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s1 /mnt1 && cp -a /mnt1/etc/fstab /var 9 | umount /mnt1 10 | # Edit the partition table to make room for the file system that we'll flash using asr later. 11 | system_size="$((+))" 12 | systemsize="$(($system_size*1024*1024/4096+5))" 13 | (echo -e "d\n1\nd\n2\nn\n\1\n\n$systemsize\n\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n49\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 14 | sync 15 | sync 16 | sync && (echo -e "d\n1\nn\n\1\n\n\n\nd\n2\n\nn\n2\n\n\n\nc\n1\nSystem\nc\n2\nData\nx\na\n2\n48\n49\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 17 | sync 18 | sync 19 | sync 20 | # Erase the file systems using newfs_hfs. 21 | newfs_hfs -s -v System -J /dev/disk0s1s1 && newfs_hfs -s -v Data -J -P /dev/disk0s1s2 && fsck_hfs -fy /dev/disk0s1s1 && fsck_hfs -fy /dev/disk0s1s2 22 | # Flash the file system. 23 | asr restore -source /var/UDZO.dmg -target /dev/disk0s1s1 -erase -noprompt -puppetstrings && fsck_hfs -f /dev/disk0s1s1 && mount -t hfs /dev/disk0s1s1 /mnt1 && fsck_hfs -f /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s2 /mnt2 && cd /usr/local/standalone/firmware/Baseband/Mav4/ && mkdir -p /mnt1/usr/local/standalone/firmware/Baseband/Mav4 && cp -a /usr/local/standalone/firmware/Baseband/Mav4/Mav4-personalized.zip /mnt1/usr/local/standalone/firmware/Baseband/Mav4 && mv -v /mnt1/var/* /mnt2 && cp -a /var/fstab /mnt1/etc && umount /mnt2 && mount -t hfs /dev/disk0s1s2 /var && fixkeybag && umount -f /var && mount -t hfs /dev/disk0s1s2 /mnt2 && mv /kernelcache /mnt1/System/Library/Caches/com.apple.kernelcaches && rm -rf /var/UDZO.dmg && 24 | mv /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/Support/softwareupdateservicesd /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/ && cd /mnt2/mobile/Media 25 | cp -a /iBEC /usr/bin/hfs_resize /usr/bin/kloader . 26 | ./hfs_resize 27 | ./kloader 28 | # Destroy partitions made by CoolBooter and use kloader to jump to a pwned iBEC. 29 | used_size="$(df -B1 | sed -n -e 's/^.*\/dev\/disk0s1s1 //p'| sed -e 's/^[ \t]*//' | sed 's/[^ ]* //' | sed 's/ .*//')" 30 | system_size2="$(($used_size+))" 31 | new_system_size="$(($system_size2/4096+5))" 32 | hfs_resize /mnt1 $system_size2 33 | System_GUID="$((echo -e "i\n1\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 34 | Data_GUID="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 35 | (echo -e "d\n1\nd\n2\nd\n3\nd\n4\nn\n1\n\n$new_system_size\n\nc\nSystem\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n49\n\nc\n1\n$System_GUID\n\nc\n2\n$Data_GUID\nw\nY\n") | gptfdisk /dev/rdisk0s1 36 | data_size="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition size: //p' | sed 's/ .*//')" 37 | data_size2="$(($data_size-5))" 38 | new_data_size="$(($data_size2*4096))" 39 | ./hfs_resize /mnt2 $new_data_size; ./kloader iBEC 40 | -------------------------------------------------------------------------------- /restore_ipad3_cellular_ios7.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | dpkg -i /dualbootstuff.deb 3 | rm /dualbootstuff.deb 4 | mkdir /mnt1 5 | mkdir /mnt2 6 | # Check the file systems and mount them. 7 | fsck_hfs -fy /dev/disk0s1s1 8 | fsck_hfs -fy /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s1 /mnt1 && cp -a /mnt1/etc/fstab /var 9 | mkdir /var/Mav4 10 | cp -a /mnt1/usr/local/standalone/firmware/Baseband/Mav4/* /var/Mav4 11 | cp -a /mnt1/System/Library/Caches/apticket.der / 12 | umount /mnt1 13 | # Edit the partition table to make room for the file system that we'll flash using asr later. 14 | system_size="$((+))" 15 | systemsize="$(($system_size*1024*1024/4096+5))" 16 | (echo -e "d\n1\nd\n2\nn\n\1\n\n$systemsize\n\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n49\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 17 | sync 18 | sync 19 | sync && (echo -e "d\n1\nn\n\1\n\n\n\nd\n2\n\nn\n2\n\n\n\nc\n1\nSystem\nc\n2\nData\nx\na\n2\n48\n49\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 20 | sync 21 | sync 22 | sync 23 | # Erase the file systems using newfs_hfs. 24 | newfs_hfs -s -v System -J /dev/disk0s1s1 && newfs_hfs -s -v Data -J -P /dev/disk0s1s2 && fsck_hfs -fy /dev/disk0s1s1 && fsck_hfs -fy /dev/disk0s1s2 25 | # Flash the file system. 26 | asr restore -source /var/UDZO.dmg -target /dev/disk0s1s1 -erase -noprompt -puppetstrings && fsck_hfs -f /dev/disk0s1s1 && mount -t hfs /dev/disk0s1s1 /mnt1 && fsck_hfs -f /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s2 /mnt2 && cd /usr/local/standalone/firmware/Baseband/Mav4/ && mkdir -p /mnt1/usr/local/standalone/firmware/Baseband/Mav4 && cp -a /var/Mav4/* /mnt1/usr/local/standalone/firmware/Baseband/Mav4 && mv -v /mnt1/var/* /mnt2 && cp -a /var/fstab /mnt1/etc && umount /mnt2 && mount -t hfs /dev/disk0s1s2 /var && fixkeybag && umount -f /var && mount -t hfs /dev/disk0s1s2 /mnt2 && mv /kernelcache /mnt1/System/Library/Caches/com.apple.kernelcaches && rm -rf /var/UDZO.dmg && 27 | mv /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/Support/softwareupdateservicesd /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/ && cd /mnt2/mobile/Media 28 | cp -a /iBEC /usr/bin/hfs_resize /usr/bin/kloader . 29 | ./hfs_resize 30 | ./kloader 31 | # Destroy partitions made by CoolBooter and use kloader to jump to a pwned iBEC. 32 | used_size="$(df -B1 | sed -n -e 's/^.*\/dev\/disk0s1s1 //p'| sed -e 's/^[ \t]*//' | sed 's/[^ ]* //' | sed 's/ .*//')" 33 | system_size2="$(($used_size+))" 34 | new_system_size="$(($system_size2/4096+5))" 35 | hfs_resize /mnt1 $system_size2 36 | System_GUID="$((echo -e "i\n1\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 37 | Data_GUID="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 38 | (echo -e "d\n1\nd\n2\nd\n3\nd\n4\nn\n1\n\n$new_system_size\n\nc\nSystem\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n49\n\nc\n1\n$System_GUID\n\nc\n2\n$Data_GUID\nw\nY\n") | gptfdisk /dev/rdisk0s1 39 | data_size="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition size: //p' | sed 's/ .*//')" 40 | data_size2="$(($data_size-5))" 41 | new_data_size="$(($data_size2*4096))" 42 | ./hfs_resize /mnt2 $new_data_size; ./kloader iBEC 43 | -------------------------------------------------------------------------------- /restore_ipad3_cellular_ios9.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | dpkg -i /dualbootstuff.deb 3 | rm /dualbootstuff.deb 4 | mkdir /mnt1 5 | mkdir /mnt2 6 | # Check the file systems and mount them. 7 | fsck_hfs -fy /dev/disk0s1s1 8 | fsck_hfs -fy /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s1 /mnt1 && cp -a /mnt1/etc/fstab /var 9 | mkdir /var/Mav4 10 | cp -a /mnt1/usr/local/standalone/firmware/Baseband/Mav4/* /var/Mav4 11 | cp -a /mnt1/System/Library/Caches/apticket.der / 12 | umount /mnt1 13 | # Edit the partition table to make room for the file system that we'll flash using asr later. 14 | system_size="$((+))" 15 | systemsize="$(($system_size*1024*1024/4096+5))" 16 | (echo -e "d\n1\nd\n2\nn\n\1\n\n$systemsize\n\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n49\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 17 | sync 18 | sync 19 | sync && (echo -e "d\n1\nn\n\1\n\n\n\nd\n2\n\nn\n2\n\n\n\nc\n1\nSystem\nc\n2\nData\nx\na\n2\n48\n49\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 20 | sync 21 | sync 22 | sync 23 | # Erase the file systems using newfs_hfs. 24 | newfs_hfs -s -v System -J /dev/disk0s1s1 && newfs_hfs -s -v Data -J -P /dev/disk0s1s2 && fsck_hfs -fy /dev/disk0s1s1 && fsck_hfs -fy /dev/disk0s1s2 25 | # Flash the file system. 26 | asr restore -source /var/UDZO.dmg -target /dev/disk0s1s1 -erase -noprompt -puppetstrings && fsck_hfs -f /dev/disk0s1s1 && mount -t hfs /dev/disk0s1s1 /mnt1 && fsck_hfs -f /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s2 /mnt2 && cd /usr/local/standalone/firmware/Baseband/Mav4/ && mkdir -p /mnt1/usr/local/standalone/firmware/Baseband/Mav4 && cp -a /var/Mav4/* /mnt1/usr/local/standalone/firmware/Baseband/Mav4 && mv -v /mnt1/var/* /mnt2 && cp -a /var/fstab /mnt1/etc && umount /mnt2 && mount -t hfs /dev/disk0s1s2 /var && fixkeybag && umount -f /var && mount -t hfs /dev/disk0s1s2 /mnt2 && mv /kernelcache /mnt1/System/Library/Caches/com.apple.kernelcaches && rm -rf /var/UDZO.dmg && 27 | mv /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/Support/softwareupdateservicesd /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/ && cd /mnt2/mobile/Media 28 | cp -a /iBEC /usr/bin/hfs_resize /usr/bin/kloader . 29 | ./hfs_resize 30 | ./kloader 31 | # Destroy partitions made by CoolBooter and use kloader to jump to a pwned iBEC. 32 | used_size="$(df -B1 | sed -n -e 's/^.*\/dev\/disk0s1s1 //p'| sed -e 's/^[ \t]*//' | sed 's/[^ ]* //' | sed 's/ .*//')" 33 | system_size2="$(($used_size+))" 34 | new_system_size="$(($system_size2/4096+5))" 35 | hfs_resize /mnt1 $system_size2 36 | System_GUID="$((echo -e "i\n1\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 37 | Data_GUID="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 38 | (echo -e "d\n1\nd\n2\nd\n3\nd\n4\nn\n1\n\n$new_system_size\n\nc\nSystem\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n49\n\nc\n1\n$System_GUID\n\nc\n2\n$Data_GUID\nw\nY\n") | gptfdisk /dev/rdisk0s1 39 | data_size="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition size: //p' | sed 's/ .*//')" 40 | data_size2="$(($data_size-5))" 41 | new_data_size="$(($data_size2*4096))" 42 | ./hfs_resize /mnt1 $system_size2; ./hfs_resize /mnt2 $new_data_size; ./kloader iBEC 43 | -------------------------------------------------------------------------------- /restore_ipad3_ios6.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | dpkg -i /dualbootstuff.deb 3 | rm /dualbootstuff.deb 4 | mkdir /mnt1 5 | mkdir /mnt2 6 | # Check the file systems and mount them. 7 | fsck_hfs -fy /dev/disk0s1s1 8 | fsck_hfs -fy /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s1 /mnt1 && cp -a /mnt1/etc/fstab /var 9 | umount /mnt1 10 | # Edit the partition table to make room for the file system that we'll flash using asr later. 11 | system_size="$((+))" 12 | systemsize="$(($system_size*1024*1024/4096+5))" 13 | (echo -e "d\n1\nd\n2\nn\n\1\n\n$systemsize\n\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n49\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 14 | sync 15 | sync 16 | sync && (echo -e "d\n1\nn\n\1\n\n\n\nd\n2\n\nn\n2\n\n\n\nc\n1\nSystem\nc\n2\nData\nx\na\n2\n48\n49\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 17 | sync 18 | sync 19 | sync 20 | # Erase the file systems using newfs_hfs. 21 | newfs_hfs -s -v System -J /dev/disk0s1s1 && newfs_hfs -s -v Data -J -P /dev/disk0s1s2 && fsck_hfs -fy /dev/disk0s1s1 && fsck_hfs -fy /dev/disk0s1s2 22 | # Flash the file system. 23 | asr restore -source /var/UDZO.dmg -target /dev/disk0s1s1 -erase -noprompt -puppetstrings && fsck_hfs -f /dev/disk0s1s1 && mount -t hfs /dev/disk0s1s1 /mnt1 && fsck_hfs -f /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s2 /mnt2 && mv -v /mnt1/var/* /mnt2 && cp -a /var/fstab /mnt1/etc && umount /mnt2 && mount -t hfs /dev/disk0s1s2 /var && fixkeybag && umount -f /var && mount -t hfs /dev/disk0s1s2 /mnt2 && mv /kernelcache /mnt1/System/Library/Caches/com.apple.kernelcaches && rm -rf /var/UDZO.dmg && 24 | mv /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/Support/softwareupdateservicesd /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/ && cd /mnt2/mobile/Media 25 | cp -a /iBEC /usr/bin/hfs_resize /usr/bin/kloader . 26 | ./hfs_resize 27 | ./kloader 28 | # Destroy partitions made by CoolBooter and use kloader to jump to a pwned iBEC. 29 | used_size="$(df -B1 | sed -n -e 's/^.*\/dev\/disk0s1s1 //p'| sed -e 's/^[ \t]*//' | sed 's/[^ ]* //' | sed 's/ .*//')" 30 | system_size2="$(($used_size+))" 31 | new_system_size="$(($system_size2/4096+5))" 32 | hfs_resize /mnt1 $system_size2 33 | System_GUID="$((echo -e "i\n1\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 34 | Data_GUID="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 35 | (echo -e "d\n1\nd\n2\nd\n3\nd\n4\nn\n1\n\n$new_system_size\n\nc\nSystem\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n49\n\nc\n1\n$System_GUID\n\nc\n2\n$Data_GUID\nw\nY\n") | gptfdisk /dev/rdisk0s1 36 | data_size="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition size: //p' | sed 's/ .*//')" 37 | data_size2="$(($data_size-5))" 38 | new_data_size="$(($data_size2*4096))" 39 | ./hfs_resize /mnt2 $new_data_size; ./kloader iBEC 40 | -------------------------------------------------------------------------------- /restore_ipad3_ios7.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | dpkg -i /dualbootstuff.deb 3 | rm /dualbootstuff.deb 4 | mkdir /mnt1 5 | mkdir /mnt2 6 | # Check the file systems and mount them. 7 | fsck_hfs -fy /dev/disk0s1s1 8 | fsck_hfs -fy /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s1 /mnt1 && cp -a /mnt1/etc/fstab /var 9 | cp -a /mnt1/System/Library/Caches/apticket.der / 10 | umount /mnt1 11 | # Edit the partition table to make room for the file system that we'll flash using asr later. 12 | system_size="$((+))" 13 | systemsize="$(($system_size*1024*1024/4096+5))" 14 | (echo -e "d\n1\nd\n2\nn\n\1\n\n$systemsize\n\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n49\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 15 | sync 16 | sync 17 | sync && (echo -e "d\n1\nn\n\1\n\n\n\nd\n2\n\nn\n2\n\n\n\nc\n1\nSystem\nc\n2\nData\nx\na\n2\n48\n49\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 18 | sync 19 | sync 20 | sync 21 | # Erase the file systems using newfs_hfs. 22 | newfs_hfs -s -v System -J /dev/disk0s1s1 && newfs_hfs -s -v Data -J -P /dev/disk0s1s2 && fsck_hfs -fy /dev/disk0s1s1 && fsck_hfs -fy /dev/disk0s1s2 23 | # Flash the file system. 24 | asr restore -source /var/UDZO.dmg -target /dev/disk0s1s1 -erase -noprompt -puppetstrings && fsck_hfs -f /dev/disk0s1s1 && mount -t hfs /dev/disk0s1s1 /mnt1 && fsck_hfs -f /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s2 /mnt2 && mv -v /mnt1/var/* /mnt2 && cp -a /var/fstab /mnt1/etc && umount /mnt2 && mount -t hfs /dev/disk0s1s2 /var && fixkeybag && umount -f /var && mount -t hfs /dev/disk0s1s2 /mnt2 && mv /apticket.der /mnt1/System/Library/Caches && mv /kernelcache /mnt1/System/Library/Caches/com.apple.kernelcaches && rm -rf /var/UDZO.dmg && 25 | mv /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/Support/softwareupdateservicesd /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/ && cd /mnt2/mobile/Media 26 | cp -a /iBEC /usr/bin/hfs_resize /usr/bin/kloader . 27 | ./hfs_resize 28 | ./kloader 29 | # Destroy partitions made by CoolBooter and use kloader to jump to a pwned iBEC. 30 | used_size="$(df -B1 | sed -n -e 's/^.*\/dev\/disk0s1s1 //p'| sed -e 's/^[ \t]*//' | sed 's/[^ ]* //' | sed 's/ .*//')" 31 | system_size2="$(($used_size+))" 32 | new_system_size="$(($system_size2/4096+5))" 33 | hfs_resize /mnt1 $system_size2 34 | System_GUID="$((echo -e "i\n1\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 35 | Data_GUID="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 36 | (echo -e "d\n1\nd\n2\nd\n3\nd\n4\nn\n1\n\n$new_system_size\n\nc\nSystem\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n49\n\nc\n1\n$System_GUID\n\nc\n2\n$Data_GUID\nw\nY\n") | gptfdisk /dev/rdisk0s1 37 | data_size="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition size: //p' | sed 's/ .*//')" 38 | data_size2="$(($data_size-5))" 39 | new_data_size="$(($data_size2*4096))" 40 | ./hfs_resize /mnt2 $new_data_size; ./kloader iBEC 41 | -------------------------------------------------------------------------------- /restore_ipad3_ios9.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | dpkg -i /dualbootstuff.deb 3 | rm /dualbootstuff.deb 4 | mkdir /mnt1 5 | mkdir /mnt2 6 | # Check the file systems and mount them. 7 | fsck_hfs -fy /dev/disk0s1s1 8 | fsck_hfs -fy /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s1 /mnt1 && cp -a /mnt1/etc/fstab /var 9 | cp -a /mnt1/System/Library/Caches/apticket.der / 10 | umount /mnt1 11 | # Edit the partition table to make room for the file system that we'll flash using asr later. 12 | system_size="$((+))" 13 | systemsize="$(($system_size*1024*1024/4096+5))" 14 | (echo -e "d\n1\nd\n2\nn\n\1\n\n$systemsize\n\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n49\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 15 | sync 16 | sync 17 | sync && (echo -e "d\n1\nn\n\1\n\n\n\nd\n2\n\nn\n2\n\n\n\nc\n1\nSystem\nc\n2\nData\nx\na\n2\n48\n49\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 18 | sync 19 | sync 20 | sync 21 | # Erase the file systems using newfs_hfs. 22 | newfs_hfs -s -v System -J /dev/disk0s1s1 && newfs_hfs -s -v Data -J -P /dev/disk0s1s2 && fsck_hfs -fy /dev/disk0s1s1 && fsck_hfs -fy /dev/disk0s1s2 23 | # Flash the file system. 24 | asr restore -source /var/UDZO.dmg -target /dev/disk0s1s1 -erase -noprompt -puppetstrings && fsck_hfs -f /dev/disk0s1s1 && mount -t hfs /dev/disk0s1s1 /mnt1 && fsck_hfs -f /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s2 /mnt2 && mv -v /mnt1/var/* /mnt2 && cp -a /var/fstab /mnt1/etc && umount /mnt2 && mount -t hfs /dev/disk0s1s2 /var && fixkeybag && umount -f /var && mount -t hfs /dev/disk0s1s2 /mnt2 && mv /apticket.der /mnt1/System/Library/Caches && mv /kernelcache /mnt1/System/Library/Caches/com.apple.kernelcaches && rm -rf /var/UDZO.dmg && 25 | mv /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/Support/softwareupdateservicesd /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/ && cd /mnt2/mobile/Media 26 | cp -a /iBEC /usr/bin/hfs_resize /usr/bin/kloader . 27 | ./hfs_resize 28 | ./kloader 29 | # Destroy partitions made by CoolBooter and use kloader to jump to a pwned iBEC. 30 | used_size="$(df -B1 | sed -n -e 's/^.*\/dev\/disk0s1s1 //p'| sed -e 's/^[ \t]*//' | sed 's/[^ ]* //' | sed 's/ .*//')" 31 | system_size2="$(($used_size+))" 32 | new_system_size="$(($system_size2/4096+5))" 33 | hfs_resize /mnt1 $system_size2 34 | System_GUID="$((echo -e "i\n1\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 35 | Data_GUID="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 36 | (echo -e "d\n1\nd\n2\nd\n3\nd\n4\nn\n1\n\n$new_system_size\n\nc\nSystem\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n49\n\nc\n1\n$System_GUID\n\nc\n2\n$Data_GUID\nw\nY\n") | gptfdisk /dev/rdisk0s1 37 | data_size="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition size: //p' | sed 's/ .*//')" 38 | data_size2="$(($data_size-5))" 39 | new_data_size="$(($data_size2*4096))" 40 | ./hfs_resize /mnt1 $system_size2; ./hfs_resize /mnt2 $new_data_size; ./kloader iBEC 41 | -------------------------------------------------------------------------------- /restore_ipad4_cellular_ios6.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | dpkg -i /dualbootstuff.deb 3 | rm /dualbootstuff.deb 4 | mkdir /mnt1 5 | mkdir /mnt2 6 | # Check the file systems and mount them. 7 | fsck_hfs -fy /dev/disk0s1s1 8 | fsck_hfs -fy /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s1 /mnt1 && cp -a /mnt1/etc/fstab /var 9 | umount /mnt1 10 | # Edit the partition table to make room for the file system that we'll flash using asr later. 11 | system_size="$((+))" 12 | systemsize="$(($system_size*1024*1024/4096+5))" 13 | (echo -e "d\n1\nd\n2\nn\n\1\n\n$systemsize\n\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n49\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 14 | sync 15 | sync 16 | sync && (echo -e "d\n1\nn\n\1\n\n\n\nd\n2\n\nn\n2\n\n\n\nc\n1\nSystem\nc\n2\nData\nx\na\n2\n48\n49\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 17 | sync 18 | sync 19 | sync 20 | # Erase the file systems using newfs_hfs. 21 | newfs_hfs -s -v System -J /dev/disk0s1s1 && newfs_hfs -s -v Data -J -P /dev/disk0s1s2 && fsck_hfs -fy /dev/disk0s1s1 && fsck_hfs -fy /dev/disk0s1s2 22 | # Flash the file system. 23 | asr restore -source /var/UDZO.dmg -target /dev/disk0s1s1 -erase -noprompt -puppetstrings && fsck_hfs -f /dev/disk0s1s1 && mount -t hfs /dev/disk0s1s1 /mnt1 && fsck_hfs -f /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s2 /mnt2 && cd /usr/local/standalone/firmware/Baseband/Mav5/ && mkdir -p /mnt1/usr/local/standalone/firmware/Baseband/Mav5 && cp -a /usr/local/standalone/firmware/Baseband/Mav5/Mav5-personalized.zip /mnt1/usr/local/standalone/firmware/Baseband/Mav5 && mv -v /mnt1/var/* /mnt2 && cp -a /var/fstab /mnt1/etc && umount /mnt2 && mount -t hfs /dev/disk0s1s2 /var && fixkeybag && umount -f /var && mount -t hfs /dev/disk0s1s2 /mnt2 && mv /kernelcache /mnt1/System/Library/Caches/com.apple.kernelcaches && rm -rf /var/UDZO.dmg && 24 | mv /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/Support/softwareupdateservicesd /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/ && cd /mnt2/mobile/Media 25 | cp -a /iBEC /usr/bin/hfs_resize /usr/bin/kloader . 26 | ./hfs_resize 27 | ./kloader 28 | # Destroy partitions made by CoolBooter and use kloader to jump to a pwned iBEC. 29 | used_size="$(df -B1 | sed -n -e 's/^.*\/dev\/disk0s1s1 //p'| sed -e 's/^[ \t]*//' | sed 's/[^ ]* //' | sed 's/ .*//')" 30 | system_size2="$(($used_size+))" 31 | new_system_size="$(($system_size2/4096+5))" 32 | hfs_resize /mnt1 $system_size2 33 | System_GUID="$((echo -e "i\n1\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 34 | Data_GUID="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 35 | (echo -e "d\n1\nd\n2\nd\n3\nd\n4\nn\n1\n\n$new_system_size\n\nc\nSystem\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n49\n\nc\n1\n$System_GUID\n\nc\n2\n$Data_GUID\nw\nY\n") | gptfdisk /dev/rdisk0s1 36 | data_size="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition size: //p' | sed 's/ .*//')" 37 | data_size2="$(($data_size-5))" 38 | new_data_size="$(($data_size2*4096))" 39 | ./hfs_resize /mnt2 $new_data_size; ./kloader iBEC 40 | -------------------------------------------------------------------------------- /restore_ipad4_cellular_ios7.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | dpkg -i /dualbootstuff.deb 3 | rm /dualbootstuff.deb 4 | mkdir /mnt1 5 | mkdir /mnt2 6 | # Check the file systems and mount them. 7 | fsck_hfs -fy /dev/disk0s1s1 8 | fsck_hfs -fy /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s1 /mnt1 && cp -a /mnt1/etc/fstab /var 9 | mkdir /var/Mav5 10 | cp -a /mnt1/usr/local/standalone/firmware/Baseband/Mav5/* /var/Mav5 11 | cp -a /mnt1/System/Library/Caches/apticket.der / 12 | umount /mnt1 13 | # Edit the partition table to make room for the file system that we'll flash using asr later. 14 | system_size="$((+))" 15 | systemsize="$(($system_size*1024*1024/4096+5))" 16 | (echo -e "d\n1\nd\n2\nn\n\1\n\n$systemsize\n\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n49\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 17 | sync 18 | sync 19 | sync && (echo -e "d\n1\nn\n\1\n\n\n\nd\n2\n\nn\n2\n\n\n\nc\n1\nSystem\nc\n2\nData\nx\na\n2\n48\n49\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 20 | sync 21 | sync 22 | sync 23 | # Erase the file systems using newfs_hfs. 24 | newfs_hfs -s -v System -J /dev/disk0s1s1 && newfs_hfs -s -v Data -J -P /dev/disk0s1s2 && fsck_hfs -fy /dev/disk0s1s1 && fsck_hfs -fy /dev/disk0s1s2 25 | # Flash the file system. 26 | asr restore -source /var/UDZO.dmg -target /dev/disk0s1s1 -erase -noprompt -puppetstrings && fsck_hfs -f /dev/disk0s1s1 && mount -t hfs /dev/disk0s1s1 /mnt1 && fsck_hfs -f /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s2 /mnt2 && cd /usr/local/standalone/firmware/Baseband/Mav5/ && mkdir -p /mnt1/usr/local/standalone/firmware/Baseband/Mav5 && cp -a /var/Mav5/* /mnt1/usr/local/standalone/firmware/Baseband/Mav5 && mv -v /mnt1/var/* /mnt2 && cp -a /var/fstab /mnt1/etc && umount /mnt2 && mount -t hfs /dev/disk0s1s2 /var && fixkeybag && umount -f /var && mount -t hfs /dev/disk0s1s2 /mnt2 && mv /kernelcache /mnt1/System/Library/Caches/com.apple.kernelcaches && rm -rf /var/UDZO.dmg && 27 | mv /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/Support/softwareupdateservicesd /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/ && cd /mnt2/mobile/Media 28 | cp -a /iBEC /usr/bin/hfs_resize /usr/bin/kloader . 29 | ./hfs_resize 30 | ./kloader 31 | # Destroy partitions made by CoolBooter and use kloader to jump to a pwned iBEC. 32 | used_size="$(df -B1 | sed -n -e 's/^.*\/dev\/disk0s1s1 //p'| sed -e 's/^[ \t]*//' | sed 's/[^ ]* //' | sed 's/ .*//')" 33 | system_size2="$(($used_size+))" 34 | new_system_size="$(($system_size2/4096+5))" 35 | hfs_resize /mnt1 $system_size2 36 | System_GUID="$((echo -e "i\n1\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 37 | Data_GUID="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 38 | (echo -e "d\n1\nd\n2\nd\n3\nd\n4\nn\n1\n\n$new_system_size\n\nc\nSystem\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n49\n\nc\n1\n$System_GUID\n\nc\n2\n$Data_GUID\nw\nY\n") | gptfdisk /dev/rdisk0s1 39 | data_size="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition size: //p' | sed 's/ .*//')" 40 | data_size2="$(($data_size-5))" 41 | new_data_size="$(($data_size2*4096))" 42 | ./hfs_resize /mnt2 $new_data_size; ./kloader iBEC 43 | -------------------------------------------------------------------------------- /restore_ipad4_cellular_ios9.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | dpkg -i /dualbootstuff.deb 3 | rm /dualbootstuff.deb 4 | mkdir /mnt1 5 | mkdir /mnt2 6 | # Check the file systems and mount them. 7 | fsck_hfs -fy /dev/disk0s1s1 8 | fsck_hfs -fy /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s1 /mnt1 && cp -a /mnt1/etc/fstab /var 9 | mkdir /var/Mav5 10 | cp -a /mnt1/usr/local/standalone/firmware/Baseband/Mav5/* /var/Mav5 11 | cp -a /mnt1/System/Library/Caches/apticket.der / 12 | umount /mnt1 13 | # Edit the partition table to make room for the file system that we'll flash using asr later. 14 | system_size="$((+))" 15 | systemsize="$(($system_size*1024*1024/4096+5))" 16 | (echo -e "d\n1\nd\n2\nn\n\1\n\n$systemsize\n\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n49\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 17 | sync 18 | sync 19 | sync && (echo -e "d\n1\nn\n\1\n\n\n\nd\n2\n\nn\n2\n\n\n\nc\n1\nSystem\nc\n2\nData\nx\na\n2\n48\n49\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 20 | sync 21 | sync 22 | sync 23 | # Erase the file systems using newfs_hfs. 24 | newfs_hfs -s -v System -J /dev/disk0s1s1 && newfs_hfs -s -v Data -J -P /dev/disk0s1s2 && fsck_hfs -fy /dev/disk0s1s1 && fsck_hfs -fy /dev/disk0s1s2 25 | # Flash the file system. 26 | asr restore -source /var/UDZO.dmg -target /dev/disk0s1s1 -erase -noprompt -puppetstrings && fsck_hfs -f /dev/disk0s1s1 && mount -t hfs /dev/disk0s1s1 /mnt1 && fsck_hfs -f /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s2 /mnt2 && cd /usr/local/standalone/firmware/Baseband/Mav5/ && mkdir -p /mnt1/usr/local/standalone/firmware/Baseband/Mav5 && cp -a /var/Mav5/* /mnt1/usr/local/standalone/firmware/Baseband/Mav5 && mv -v /mnt1/var/* /mnt2 && cp -a /var/fstab /mnt1/etc && umount /mnt2 && mount -t hfs /dev/disk0s1s2 /var && fixkeybag && umount -f /var && mount -t hfs /dev/disk0s1s2 /mnt2 && mv /kernelcache /mnt1/System/Library/Caches/com.apple.kernelcaches && rm -rf /var/UDZO.dmg && 27 | mv /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/Support/softwareupdateservicesd /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/ && cd /mnt2/mobile/Media 28 | cp -a /iBEC /usr/bin/hfs_resize /usr/bin/kloader . 29 | ./hfs_resize 30 | ./kloader 31 | # Destroy partitions made by CoolBooter and use kloader to jump to a pwned iBEC. 32 | used_size="$(df -B1 | sed -n -e 's/^.*\/dev\/disk0s1s1 //p'| sed -e 's/^[ \t]*//' | sed 's/[^ ]* //' | sed 's/ .*//')" 33 | system_size2="$(($used_size+))" 34 | new_system_size="$(($system_size2/4096+5))" 35 | hfs_resize /mnt1 $system_size2 36 | System_GUID="$((echo -e "i\n1\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 37 | Data_GUID="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 38 | (echo -e "d\n1\nd\n2\nd\n3\nd\n4\nn\n1\n\n$new_system_size\n\nc\nSystem\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n49\n\nc\n1\n$System_GUID\n\nc\n2\n$Data_GUID\nw\nY\n") | gptfdisk /dev/rdisk0s1 39 | data_size="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition size: //p' | sed 's/ .*//')" 40 | data_size2="$(($data_size-5))" 41 | new_data_size="$(($data_size2*4096))" 42 | ./hfs_resize /mnt1 $system_size2; ./hfs_resize /mnt2 $new_data_size; ./kloader iBEC 43 | -------------------------------------------------------------------------------- /restore_iphone4s_ios5.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | dpkg -i /dualbootstuff.deb 3 | rm /dualbootstuff.deb 4 | mkdir /mnt1 5 | mkdir /mnt2 6 | # Check the file systems and mount them. 7 | fsck_hfs -fy /dev/disk0s1s1 8 | fsck_hfs -fy /dev/disk0s1s2; mount -t hfs /dev/disk0s1s1 /mnt1 && cp -a /mnt1/etc/fstab /var 9 | mkdir /var/Trek 10 | cp -a /mnt1/usr/standalone/firmware/Baseband/Trek/* /var/Trek 11 | umount /mnt1 12 | # Edit the partition table to make room for the file system that we'll flash using asr later. 13 | system_size="$((+))" 14 | systemsize="$(($system_size*1024*1024/4096+5))" 15 | (echo -e "d\n1\nd\n2\nn\n\1\n\n$systemsize\n\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 16 | sync 17 | sync 18 | sync && (echo -e "d\n1\nn\n\1\n\n\n\nd\n2\n\nn\n2\n\n\n\nc\n1\nSystem\nc\n2\nData\nx\na\n2\n48\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 19 | sync 20 | sync 21 | sync 22 | # Erase the file systems using newfs_hfs. 23 | newfs_hfs -s -v System -J /dev/disk0s1s1 && newfs_hfs -s -v Data -J -P /dev/disk0s1s2 && fsck_hfs -fy /dev/disk0s1s1 && fsck_hfs -fy /dev/disk0s1s2 24 | # Flash the file system. 25 | asr restore -source /var/UDZO.dmg -target /dev/disk0s1s1 -erase -noprompt -puppetstrings && fsck_hfs -fy /dev/disk0s1s1 && mount -t hfs /dev/disk0s1s1 /mnt1 && fsck_hfs -fy /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s2 /mnt2 && cd /usr/standalone/firmware/Baseband/Trek/ && mkdir -p /mnt1/usr/standalone/firmware/Baseband/Trek && cp -a /var/Trek/* /mnt1/usr/standalone/firmware/Baseband/Trek && mv -v /mnt1/private/var/* /mnt2 && cp -a /var/fstab /mnt1/etc && umount /mnt2 && mount -t hfs /dev/disk0s1s2 /var && fixkeybag && umount -f /var && mount -t hfs /dev/disk0s1s2 /mnt2 && mv /kernelcache /mnt1/System/Library/Caches/com.apple.kernelcaches && echo Cleaning up... && rm -rf /var/UDZO.dmg && 26 | mv /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/Support/softwareupdateservicesd /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/ 27 | cd /mnt2/mobile/Media 28 | cp -a /iBSS /usr/bin/hfs_resize /usr/bin/kloader . 29 | ./hfs_resize 30 | ./kloader 31 | # Destroy partitions made by CoolBooter and use kloader to jump to a pwned iBSS. 32 | used_size="$(df -B1 | sed -n -e 's/^.*\/dev\/disk0s1s1 //p'| sed -e 's/^[ \t]*//' | sed 's/[^ ]* //' | sed 's/ .*//')" 33 | system_size2="$(($used_size+))" 34 | new_system_size="$(($system_size2/4096+5))" 35 | hfs_resize /mnt1 $system_size2 36 | System_GUID="$((echo -e "i\n1\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 37 | Data_GUID="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 38 | (echo -e "d\n1\nd\n2\nd\n3\nd\nn\n1\n\n$new_system_size\n\nc\nSystem\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n\nc\n1\n$System_GUID\nc\n2\n$Data_GUID\nw\nY\n") | gptfdisk /dev/rdisk0s1 39 | data_size="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition size: //p' | sed 's/ .*//')" 40 | data_size2="$(($data_size-5))" 41 | new_data_size="$(($data_size2*4096))" 42 | ./hfs_resize /mnt2 $new_data_size; ./kloader iBSS 43 | 44 | 45 | -------------------------------------------------------------------------------- /restore_iphone4s_ios6.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | dpkg -i /dualbootstuff.deb 3 | rm /dualbootstuff.deb 4 | mkdir /mnt1 5 | mkdir /mnt2 6 | # Check the file systems and mount them. 7 | fsck_hfs -fy /dev/disk0s1s1 8 | fsck_hfs -fy /dev/disk0s1s2; mount -t hfs /dev/disk0s1s1 /mnt1 && cp -a /mnt1/etc/fstab /var 9 | mkdir /var/Trek 10 | cp -a /mnt1/usr/local/standalone/firmware/Baseband/Trek/* /var/Trek 11 | umount /mnt1 12 | # Edit the partition table to make room for the file system that we'll flash using asr later. 13 | system_size="$((+))" 14 | systemsize="$(($system_size*1024*1024/4096+5))" 15 | (echo -e "d\n1\nd\n2\nn\n\1\n\n$systemsize\n\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 16 | sync 17 | sync 18 | sync && (echo -e "d\n1\nn\n\1\n\n\n\nd\n2\n\nn\n2\n\n\n\nc\n1\nSystem\nc\n2\nData\nx\na\n2\n48\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 19 | sync 20 | sync 21 | sync 22 | # Erase the file systems using newfs_hfs. 23 | newfs_hfs -s -v System -J /dev/disk0s1s1 && newfs_hfs -s -v Data -J -P /dev/disk0s1s2 && fsck_hfs -fy /dev/disk0s1s1 && fsck_hfs -fy /dev/disk0s1s2 24 | # Flash the file system. 25 | asr restore -source /var/UDZO.dmg -target /dev/disk0s1s1 -erase -noprompt -puppetstrings && fsck_hfs -fy /dev/disk0s1s1 && mount -t hfs /dev/disk0s1s1 /mnt1 && fsck_hfs -fy /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s2 /mnt2 && cd /usr/local/standalone/firmware/Baseband/Trek/ && mkdir -p /mnt1/usr/local/standalone/firmware/Baseband/Trek && cp -a /var/Trek/* /mnt1/usr/local/standalone/firmware/Baseband/Trek && mv -v /mnt1/private/var/* /mnt2 && cp -a /var/fstab /mnt1/etc && umount /mnt2 && mount -t hfs /dev/disk0s1s2 /var && fixkeybag && umount -f /var && mount -t hfs /dev/disk0s1s2 /mnt2 && mv /kernelcache /mnt1/System/Library/Caches/com.apple.kernelcaches && echo Cleaning up... && rm -rf /var/UDZO.dmg && 26 | mv /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/Support/softwareupdateservicesd /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/ 27 | cd /mnt2/mobile/Media 28 | cp -a /iBSS /usr/bin/hfs_resize /usr/bin/kloader . 29 | ./hfs_resize 30 | ./kloader 31 | # Destroy partitions made by CoolBooter and use kloader to jump to a pwned iBSS. 32 | used_size="$(df -B1 | sed -n -e 's/^.*\/dev\/disk0s1s1 //p'| sed -e 's/^[ \t]*//' | sed 's/[^ ]* //' | sed 's/ .*//')" 33 | system_size2="$(($used_size+))" 34 | new_system_size="$(($system_size2/4096+5))" 35 | hfs_resize /mnt1 $system_size2 36 | System_GUID="$((echo -e "i\n1\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 37 | Data_GUID="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 38 | (echo -e "d\n1\nd\n2\nd\n3\nd\nn\n1\n\n$new_system_size\n\nc\nSystem\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n\nc\n1\n$System_GUID\nc\n2\n$Data_GUID\nw\nY\n") | gptfdisk /dev/rdisk0s1 39 | data_size="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition size: //p' | sed 's/ .*//')" 40 | data_size2="$(($data_size-5))" 41 | new_data_size="$(($data_size2*4096))" 42 | ./hfs_resize /mnt2 $new_data_size; ./kloader iBSS 43 | 44 | 45 | -------------------------------------------------------------------------------- /restore_iphone4s_ios7.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | dpkg -i /dualbootstuff.deb 3 | rm /dualbootstuff.deb 4 | mkdir /mnt1 5 | mkdir /mnt2 6 | # Check the file systems and mount them. 7 | fsck_hfs -fy /dev/disk0s1s1 8 | fsck_hfs -fy /dev/disk0s1s2; mount -t hfs /dev/disk0s1s1 /mnt1 && cp -a /mnt1/etc/fstab /var 9 | mkdir /var/Trek 10 | cp -a /mnt1/usr/local/standalone/firmware/Baseband/Trek/* /var/Trek 11 | cp -a /mnt1/System/Library/Caches/apticket.der / 12 | rm -rf /var/Trek/Trek-personalized.zip 13 | umount /mnt1 14 | # Edit the partition table to make room for the file system that we'll flash using asr later. 15 | system_size="$((+))" 16 | systemsize="$(($system_size*1024*1024/4096+5))" 17 | (echo -e "d\n1\nd\n2\nn\n\1\n\n$systemsize\n\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 18 | sync 19 | sync 20 | sync && (echo -e "d\n1\nn\n\1\n\n\n\nd\n2\n\nn\n2\n\n\n\nc\n1\nSystem\nc\n2\nData\nx\na\n2\n48\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 21 | sync 22 | sync 23 | sync 24 | # Erase the file systems using newfs_hfs. 25 | newfs_hfs -s -v System -J /dev/disk0s1s1 && newfs_hfs -s -v Data -J -P /dev/disk0s1s2 && fsck_hfs -fy /dev/disk0s1s1 && fsck_hfs -fy /dev/disk0s1s2 26 | # Flash the file system. 27 | asr restore -source /var/UDZO.dmg -target /dev/disk0s1s1 -erase -noprompt -puppetstrings && fsck_hfs -fy /dev/disk0s1s1 && mount -t hfs /dev/disk0s1s1 /mnt1 && fsck_hfs -fy /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s2 /mnt2 && cd /usr/local/standalone/firmware/Baseband/Trek/ && mkdir -p /mnt1/usr/local/standalone/firmware/Baseband/Trek && cp -a /var/Trek/* /mnt1/usr/local/standalone/firmware/Baseband/Trek && mv -v /mnt1/private/var/* /mnt2 && cp -a /var/fstab /mnt1/etc && umount /mnt2 && mount -t hfs /dev/disk0s1s2 /var && fixkeybag && umount -f /var && mount -t hfs /dev/disk0s1s2 /mnt2 && mv /apticket.der /mnt1/System/Library/Caches && mv /kernelcache /mnt1/System/Library/Caches/com.apple.kernelcaches && rm -rf /var/UDZO.dmg && 28 | mv /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/Support/softwareupdateservicesd /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/ 29 | cd /mnt2/mobile/Media 30 | cp -a /iBSS /usr/bin/hfs_resize /usr/bin/kloader . 31 | ./hfs_resize 32 | ./kloader 33 | # Destroy partitions made by CoolBooter and use kloader to jump to a pwned iBSS. 34 | used_size="$(df -B1 | sed -n -e 's/^.*\/dev\/disk0s1s1 //p'| sed -e 's/^[ \t]*//' | sed 's/[^ ]* //' | sed 's/ .*//')" 35 | system_size2="$(($used_size+))" 36 | new_system_size="$(($system_size2/4096+5))" 37 | hfs_resize /mnt1 $system_size2 38 | System_GUID="$((echo -e "i\n1\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 39 | Data_GUID="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 40 | (echo -e "d\n1\nd\n2\nd\n3\nd\nn\n1\n\n$new_system_size\n\nc\nSystem\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n\nc\n1\n$System_GUID\nc\n2\n$Data_GUID\nw\nY\n") | gptfdisk /dev/rdisk0s1 41 | data_size="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition size: //p' | sed 's/ .*//')" 42 | data_size2="$(($data_size-5))" 43 | new_data_size="$(($data_size2*4096))" 44 | ./hfs_resize /mnt2 $new_data_size; ./kloader iBSS 45 | 46 | -------------------------------------------------------------------------------- /restore_iphone4s_ios9.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | dpkg -i /dualbootstuff.deb 3 | rm /dualbootstuff.deb 4 | mkdir /mnt1 5 | mkdir /mnt2 6 | # Check the file systems and mount them. 7 | fsck_hfs -fy /dev/disk0s1s1 8 | fsck_hfs -fy /dev/disk0s1s2; mount -t hfs /dev/disk0s1s1 /mnt1 && cp -a /mnt1/etc/fstab /var 9 | mkdir /var/Trek 10 | cp -a /mnt1/usr/local/standalone/firmware/Baseband/Trek/* /var/Trek 11 | cp -a /mnt1/System/Library/Caches/apticket.der / 12 | rm -rf /var/Trek/Trek-personalized.zip 13 | umount /mnt1 14 | # Edit the partition table to make room for the file system that we'll flash using asr later. 15 | system_size="$((+))" 16 | systemsize="$(($system_size*1024*1024/4096+5))" 17 | (echo -e "d\n1\nd\n2\nn\n\1\n\n$systemsize\n\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n49\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 18 | sync 19 | sync 20 | sync && (echo -e "d\n1\nn\n\1\n\n\n\nd\n2\n\nn\n2\n\n\n\nc\n1\nSystem\nc\n2\nData\nx\na\n2\n48\n49\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 21 | sync 22 | sync 23 | sync 24 | # Erase the file systems using newfs_hfs. 25 | newfs_hfs -s -v System -J /dev/disk0s1s1 && newfs_hfs -s -v Data -J -P /dev/disk0s1s2 && fsck_hfs -fy /dev/disk0s1s1 && fsck_hfs -fy /dev/disk0s1s2 26 | # Flash the file system. 27 | asr restore -source /var/UDZO.dmg -target /dev/disk0s1s1 -erase -noprompt -puppetstrings && fsck_hfs -fy /dev/disk0s1s1 && mount -t hfs /dev/disk0s1s1 /mnt1 && fsck_hfs -fy /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s2 /mnt2 && cd /usr/local/standalone/firmware/Baseband/Trek/ && mkdir -p /mnt1/usr/local/standalone/firmware/Baseband/Trek && cp -a /var/Trek/* /mnt1/usr/local/standalone/firmware/Baseband/Trek && mv -v /mnt1/private/var/* /mnt2 && cp -a /var/fstab /mnt1/etc && umount /mnt2 && mount -t hfs /dev/disk0s1s2 /var && fixkeybag && umount -f /var && mount -t hfs /dev/disk0s1s2 /mnt2 && mv /apticket.der /mnt1/System/Library/Caches && mv /kernelcache /mnt1/System/Library/Caches/com.apple.kernelcaches && rm -rf /var/UDZO.dmg && 28 | mv /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/Support/softwareupdateservicesd /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/ 29 | cd /mnt2/mobile/Media 30 | cp -a /iBSS /usr/bin/hfs_resize /usr/bin/kloader . 31 | ./hfs_resize 32 | ./kloader 33 | # Destroy partitions made by CoolBooter and use kloader to jump to a pwned iBSS. 34 | used_size="$(df -B1 | sed -n -e 's/^.*\/dev\/disk0s1s1 //p'| sed -e 's/^[ \t]*//' | sed 's/[^ ]* //' | sed 's/ .*//')" 35 | system_size2="$(($used_size+))" 36 | new_system_size="$(($system_size2/4096+5))" 37 | System_GUID="$((echo -e "i\n1\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 38 | Data_GUID="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 39 | (echo -e "d\n1\nd\n2\nd\n3\nd\nn\n1\n\n$new_system_size\n\nc\nSystem\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n49\n\nc\n1\n$System_GUID\nc\n2\n$Data_GUID\nw\nY\n") | gptfdisk /dev/rdisk0s1 40 | data_size="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition size: //p' | sed 's/ .*//')" 41 | data_size2="$(($data_size-5))" 42 | new_data_size="$(($data_size2*4096))" 43 | ./hfs_resize /mnt1 $system_size2; ./hfs_resize /mnt2 $new_data_size; ./kloader iBSS 44 | 45 | -------------------------------------------------------------------------------- /restore_iphone5_ios6.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | dpkg -i /dualbootstuff.deb 3 | rm /dualbootstuff.deb 4 | mkdir /mnt1 5 | mkdir /mnt2 6 | # Check the file systems and mount them. 7 | fsck_hfs -fy /dev/disk0s1s1 8 | fsck_hfs -fy /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s1 /mnt1 && cp -a /mnt1/etc/fstab /var 9 | mkdir /var/Mav5 10 | cp -a /mnt1/usr/local/standalone/firmware/Baseband/Mav5/* /var/Mav5 11 | umount /mnt1 12 | umount /mnt1 13 | # Edit the partition table to make room for the file system that we'll flash using asr later. 14 | system_size="$((+))" 15 | systemsize="$(($system_size*1024*1024/4096+5))" 16 | (echo -e "d\n1\nd\n2\nn\n\1\n\n$systemsize\n\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n49\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 17 | sync 18 | sync 19 | sync && (echo -e "d\n1\nn\n\1\n\n\n\nd\n2\n\nn\n2\n\n\n\nc\n1\nSystem\nc\n2\nData\nx\na\n2\n48\n49\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 20 | sync 21 | sync 22 | sync 23 | # Erase the file systems using newfs_hfs. 24 | newfs_hfs -s -v System -J /dev/disk0s1s1 && newfs_hfs -s -v Data -J -P /dev/disk0s1s2 && fsck_hfs -fy /dev/disk0s1s1 && fsck_hfs -fy /dev/disk0s1s2 25 | # Flash the file system. 26 | asr restore -source /var/UDZO.dmg -target /dev/disk0s1s1 -erase -noprompt -puppetstrings && fsck_hfs -fy /dev/disk0s1s1 && mount -t hfs /dev/disk0s1s1 /mnt1 && fsck_hfs -fy /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s2 /mnt2 && cd /usr/local/standalone/firmware/Baseband/Mav5/ && mkdir -p /mnt1/usr/local/standalone/firmware/Baseband/Mav5 && cp -a /usr/local/standalone/firmware/Baseband/Mav5/Mav5-personalized.zip /mnt1/usr/local/standalone/firmware/Baseband/Mav5 && cp -a /var/fstab /mnt1/etc && umount /mnt2 && mount -t hfs /dev/disk0s1s2 /var && fixkeybag && umount -f /var && mount -t hfs /dev/disk0s1s2 /mnt2 && mv /kernelcache /mnt1/System/Library/Caches/com.apple.kernelcaches && echo Cleaning up... && rm -rf /var/UDZO.dmg && mv /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/Support/softwareupdateservicesd /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/ && cd /mnt2/mobile/Media 27 | cp -a /iBSS /usr/bin/hfs_resize /usr/bin/kloader . 28 | ./hfs_resize 29 | ./kloader 30 | # Destroy partitions made by CoolBooter and use kloader to jump to a pwned iBEC. 31 | used_size="$(df -B1 | sed -n -e 's/^.*\/dev\/disk0s1s1 //p'| sed -e 's/^[ \t]*//' | sed 's/[^ ]* //' | sed 's/ .*//')" 32 | system_size2="$(($used_size+))" 33 | new_system_size="$(($system_size2/4096 + 5))" 34 | hfs_resize /mnt1 $system_size2 35 | System_GUID="$((echo -e "i\n1\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 36 | Data_GUID="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 37 | (echo -e "d\n1\nd\n2\nd\n3\nd\n4\nn\n1\n\n$new_system_size\n\nc\nSystem\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n49\n\nc\n1\n$System_GUID\n\nc\n2\n$Data_GUID\nw\nY\n") | gptfdisk /dev/rdisk0s1 38 | data_size="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition size: //p' | sed 's/ .*//')" 39 | data_size2="$(($data_size-5))" 40 | new_data_size="$(($data_size2*4096))" 41 | ./hfs_resize /mnt2 $new_data_size; ./kloader iBSS 42 | 43 | -------------------------------------------------------------------------------- /restore_iphone5_ios7.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | dpkg -i /dualbootstuff.deb 3 | rm /dualbootstuff.deb 4 | mkdir /mnt1 5 | mkdir /mnt2 6 | # Check the file systems and mount them. 7 | fsck_hfs -fy /dev/disk0s1s1 8 | fsck_hfs -fy /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s1 /mnt1 && cp -a /mnt1/etc/fstab /var 9 | mkdir /var/Mav5 10 | cp -a /mnt1/usr/local/standalone/firmware/Baseband/Mav5/* /var/Mav5 11 | cp -a /mnt1/System/Library/Caches/apticket.der / 12 | umount /mnt1 13 | umount /mnt1 14 | # Edit the partition table to make room for the file system that we'll flash using asr later. 15 | system_size="$((+))" 16 | systemsize="$(($system_size*1024*1024/4096+5))" 17 | (echo -e "d\n1\nd\n2\nn\n\1\n\n$systemsize\n\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n49\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 18 | sync 19 | sync 20 | sync && (echo -e "d\n1\nn\n\1\n\n\n\nd\n2\n\nn\n2\n\n\n\nc\n1\nSystem\nc\n2\nData\nx\na\n2\n48\n49\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 21 | sync 22 | sync 23 | sync 24 | # Erase the file systems using newfs_hfs. 25 | newfs_hfs -s -v System -J /dev/disk0s1s1 && newfs_hfs -s -v Data -J -P /dev/disk0s1s2 && fsck_hfs -fy /dev/disk0s1s1 && fsck_hfs -fy /dev/disk0s1s2 26 | # Flash the file system. 27 | asr restore -source /var/UDZO.dmg -target /dev/disk0s1s1 -erase -noprompt -puppetstrings && fsck_hfs -fy /dev/disk0s1s1 && mount -t hfs /dev/disk0s1s1 /mnt1 && fsck_hfs -fy /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s2 /mnt2 && cd /usr/local/standalone/firmware/Baseband/Mav5/ && mkdir -p /mnt1/usr/local/standalone/firmware/Baseband/Mav5 && cp -a /var/Mav5/* /mnt1/usr/local/standalone/firmware/Baseband/Mav5 && mv -v /mnt1/private/var/* /mnt2 && cp -a /var/fstab /mnt1/etc && umount /mnt2 && mount -t hfs /dev/disk0s1s2 /var && fixkeybag && umount -f /var && mount -t hfs /dev/disk0s1s2 /mnt2 && mv /apticket.der /mnt1/System/Library/Caches && mv /kernelcache /mnt1/System/Library/Caches/com.apple.kernelcaches && echo Cleaning up... && rm -rf /var/UDZO.dmg && 28 | mv /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/Support/softwareupdateservicesd /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/ && cd /mnt2/mobile/Media 29 | cp -a /iBSS /usr/bin/hfs_resize /usr/bin/kloader . 30 | ./hfs_resize 31 | ./kloader 32 | # Destroy partitions made by CoolBooter and use kloader to jump to a pwned iBSS. 33 | used_size="$(df -B1 | sed -n -e 's/^.*\/dev\/disk0s1s1 //p'| sed -e 's/^[ \t]*//' | sed 's/[^ ]* //' | sed 's/ .*//')" 34 | system_size2="$(($used_size+))" 35 | new_system_size="$(($system_size2/4096+5))" 36 | hfs_resize /mnt1 $system_size2 37 | System_GUID="$((echo -e "i\n1\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 38 | Data_GUID="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 39 | (echo -e "d\n1\nd\n2\nd\n3\nd\n4\nn\n1\n\n$new_system_size\n\nc\nSystem\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n49\n\nc\n1\n$System_GUID\n\nc\n2\n$Data_GUID\nw\nY\n") | gptfdisk /dev/rdisk0s1 40 | data_size="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition size: //p' | sed 's/ .*//')" 41 | data_size2="$(($data_size-5))" 42 | new_data_size="$(($data_size2*4096))" 43 | ./hfs_resize /mnt2 $new_data_size; ./kloader iBSS 44 | 45 | -------------------------------------------------------------------------------- /restore_iphone5_ios9.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | dpkg -i /dualbootstuff.deb 3 | rm /dualbootstuff.deb 4 | mkdir /mnt1 5 | mkdir /mnt2 6 | # Check the file systems and mount them. 7 | fsck_hfs -fy /dev/disk0s1s1 8 | fsck_hfs -fy /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s1 /mnt1 && cp -a /mnt1/etc/fstab /var 9 | mkdir /var/Mav5 10 | cp -a /mnt1/usr/local/standalone/firmware/Baseband/Mav5/* /var/Mav5 11 | cp -a /mnt1/System/Library/Caches/apticket.der / 12 | umount /mnt1 13 | umount /mnt1 14 | # Edit the partition table to make room for the file system that we'll flash using asr later. 15 | system_size="$((+))" 16 | systemsize="$(($system_size*1024*1024/4096+5))" 17 | (echo -e "d\n1\nd\n2\nn\n\1\n\n$systemsize\n\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n49\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 18 | sync 19 | sync 20 | sync && (echo -e "d\n1\nn\n\1\n\n\n\nd\n2\n\nn\n2\n\n\n\nc\n1\nSystem\nc\n2\nData\nx\na\n2\n48\n49\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 21 | sync 22 | sync 23 | sync 24 | # Erase the file systems using newfs_hfs. 25 | newfs_hfs -s -v System -J /dev/disk0s1s1 && newfs_hfs -s -v Data -J -P /dev/disk0s1s2 && fsck_hfs -fy /dev/disk0s1s1 && fsck_hfs -fy /dev/disk0s1s2 26 | # Flash the file system. 27 | asr restore -source /var/UDZO.dmg -target /dev/disk0s1s1 -erase -noprompt -puppetstrings && fsck_hfs -fy /dev/disk0s1s1 && mount -t hfs /dev/disk0s1s1 /mnt1 && fsck_hfs -fy /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s2 /mnt2 && cd /usr/local/standalone/firmware/Baseband/Mav5/ && mkdir -p /mnt1/usr/local/standalone/firmware/Baseband/Mav5 && cp -a /var/Mav5/* /mnt1/usr/local/standalone/firmware/Baseband/Mav5 && mv -v /mnt1/private/var/* /mnt2 && cp -a /var/fstab /mnt1/etc && umount /mnt2 && mount -t hfs /dev/disk0s1s2 /var && fixkeybag && umount -f /var && mount -t hfs /dev/disk0s1s2 /mnt2 && mv /apticket.der /mnt1/System/Library/Caches && mv /kernelcache /mnt1/System/Library/Caches/com.apple.kernelcaches && echo Cleaning up... && rm -rf /var/UDZO.dmg && 28 | mv /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/Support/softwareupdateservicesd /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/ && cd /mnt2/mobile/Media 29 | cp -a /iBSS /usr/bin/hfs_resize /usr/bin/kloader . 30 | ./hfs_resize 31 | ./kloader 32 | # Destroy partitions made by CoolBooter and use kloader to jump to a pwned iBEC. 33 | used_size="$(df -B1 | sed -n -e 's/^.*\/dev\/disk0s1s1 //p'| sed -e 's/^[ \t]*//' | sed 's/[^ ]* //' | sed 's/ .*//')" 34 | system_size2="$(($used_size+))" 35 | new_system_size="$(($system_size2/4096 + 5))" 36 | System_GUID="$((echo -e "i\n1\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 37 | Data_GUID="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 38 | (echo -e "d\n1\nd\n2\nd\n3\nd\n4\nn\n1\n\n$new_system_size\n\nc\nSystem\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n49\n\nc\n1\n$System_GUID\n\nc\n2\n$Data_GUID\nw\nY\n") | gptfdisk /dev/rdisk0s1 39 | data_size="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition size: //p' | sed 's/ .*//')" 40 | data_size2="$(($data_size-5))" 41 | new_data_size="$(($data_size2*4096))" 42 | ./hfs_resize /mnt1 $system_size2; ./hfs_resize /mnt2 $new_data_size; ./kloader iBSS 43 | 44 | -------------------------------------------------------------------------------- /restore_iphone5c_ios7.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | dpkg -i /dualbootstuff.deb 3 | rm /dualbootstuff.deb 4 | mkdir /mnt1 5 | mkdir /mnt2 6 | # Check the file systems and mount them. 7 | fsck_hfs -fy /dev/disk0s1s1 8 | fsck_hfs -fy /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s1 /mnt1 && cp -a /mnt1/etc/fstab /var 9 | mkdir /var/Mav7Mav8 10 | cp -a /mnt1/usr/local/standalone/firmware/Baseband/Mav7Mav8/* /var/Mav7Mav8 11 | cp -a /mnt1/System/Library/Caches/apticket.der / 12 | umount /mnt1 13 | umount /mnt1 14 | # Edit the partition table to make room for the file system that we'll flash using asr later. 15 | system_size="$((+))" 16 | systemsize="$(($system_size*1024*1024/4096+5))" 17 | (echo -e "d\n1\nd\n2\nn\n\1\n\n$systemsize\n\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n49\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 18 | sync 19 | sync 20 | sync && (echo -e "d\n1\nn\n\1\n\n\n\nd\n2\n\nn\n2\n\n\n\nc\n1\nSystem\nc\n2\nData\nx\na\n2\n48\n49\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 21 | sync 22 | sync 23 | sync 24 | # Erase the file systems using newfs_hfs. 25 | newfs_hfs -s -v System -J /dev/disk0s1s1 && newfs_hfs -s -v Data -J -P /dev/disk0s1s2 && fsck_hfs -fy /dev/disk0s1s1 && fsck_hfs -fy /dev/disk0s1s2 26 | # Flash the file system. 27 | asr restore -source /var/UDZO.dmg -target /dev/disk0s1s1 -erase -noprompt -puppetstrings && fsck_hfs -fy /dev/disk0s1s1 && mount -t hfs /dev/disk0s1s1 /mnt1 && fsck_hfs -fy /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s2 /mnt2 && cd /usr/local/standalone/firmware/Baseband/Mav7Mav8/ && mkdir -p /mnt1/usr/local/standalone/firmware/Baseband/Mav7Mav8 && cp -a /var/Mav7Mav8/* /mnt1/usr/local/standalone/firmware/Baseband/Mav7Mav8 && mv -v /mnt1/private/var/* /mnt2 && cp -a /var/fstab /mnt1/etc && umount /mnt2 && mount -t hfs /dev/disk0s1s2 /var && fixkeybag && umount -f /var && mount -t hfs /dev/disk0s1s2 /mnt2 && mv /apticket.der /mnt1/System/Library/Caches && mv /kernelcache /mnt1/System/Library/Caches/com.apple.kernelcaches && echo Cleaning up... && rm -rf /var/UDZO.dmg && 28 | mv /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/Support/softwareupdateservicesd /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/ && cd /mnt2/mobile/Media 29 | cp -a /iBSS /usr/bin/hfs_resize /usr/bin/kloader . 30 | ./hfs_resize 31 | ./kloader 32 | # Destroy partitions made by CoolBooter and use kloader to jump to a pwned iBSS. 33 | used_size="$(df -B1 | sed -n -e 's/^.*\/dev\/disk0s1s1 //p'| sed -e 's/^[ \t]*//' | sed 's/[^ ]* //' | sed 's/ .*//')" 34 | system_size2="$(($used_size+))" 35 | new_system_size="$(($system_size2/4096+5))" 36 | hfs_resize /mnt1 $system_size2 37 | System_GUID="$((echo -e "i\n1\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 38 | Data_GUID="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 39 | (echo -e "d\n1\nd\n2\nd\n3\nd\n4\nn\n1\n\n$new_system_size\n\nc\nSystem\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n49\n\nc\n1\n$System_GUID\n\nc\n2\n$Data_GUID\nw\nY\n") | gptfdisk /dev/rdisk0s1 40 | data_size="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition size: //p' | sed 's/ .*//')" 41 | data_size2="$(($data_size-5))" 42 | new_data_size="$(($data_size2*4096))" 43 | ./hfs_resize /mnt2 $new_data_size; ./kloader iBSS 44 | 45 | -------------------------------------------------------------------------------- /restore_iphone5c_ios9.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | dpkg -i /dualbootstuff.deb 3 | rm /dualbootstuff.deb 4 | mkdir /mnt1 5 | mkdir /mnt2 6 | # Check the file systems and mount them. 7 | fsck_hfs -fy /dev/disk0s1s1 8 | fsck_hfs -fy /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s1 /mnt1 && cp -a /mnt1/etc/fstab /var 9 | mkdir /var/Mav5 10 | cp -a /mnt1/usr/local/standalone/firmware/Baseband/Mav7Mav8/* /var/Mav7Mav8 11 | cp -a /mnt1/System/Library/Caches/apticket.der / 12 | umount /mnt1 13 | umount /mnt1 14 | # Edit the partition table to make room for the file system that we'll flash using asr later. 15 | system_size="$((+))" 16 | systemsize="$(($system_size*1024*1024/4096+5))" 17 | (echo -e "d\n1\nd\n2\nn\n\1\n\n$systemsize\n\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n49\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 18 | sync 19 | sync 20 | sync && (echo -e "d\n1\nn\n\1\n\n\n\nd\n2\n\nn\n2\n\n\n\nc\n1\nSystem\nc\n2\nData\nx\na\n2\n48\n49\n\nw\nY\n") | gptfdisk /dev/rdisk0s1 21 | sync 22 | sync 23 | sync 24 | # Erase the file systems using newfs_hfs. 25 | newfs_hfs -s -v System -J /dev/disk0s1s1 && newfs_hfs -s -v Data -J -P /dev/disk0s1s2 && fsck_hfs -fy /dev/disk0s1s1 && fsck_hfs -fy /dev/disk0s1s2 26 | # Flash the file system. 27 | asr restore -source /var/UDZO.dmg -target /dev/disk0s1s1 -erase -noprompt -puppetstrings && fsck_hfs -fy /dev/disk0s1s1 && mount -t hfs /dev/disk0s1s1 /mnt1 && fsck_hfs -fy /dev/disk0s1s2 && mount -t hfs /dev/disk0s1s2 /mnt2 && cd /usr/local/standalone/firmware/Baseband/Mav7Mav8/ && mkdir -p /mnt1/usr/local/standalone/firmware/Baseband/Mav7Mav8 && cp -a /var/Mav7Mav8/* /mnt1/usr/local/standalone/firmware/Baseband/Mav7Mav8 && mv -v /mnt1/private/var/* /mnt2 && cp -a /var/fstab /mnt1/etc && umount /mnt2 && mount -t hfs /dev/disk0s1s2 /var && fixkeybag && umount -f /var && mount -t hfs /dev/disk0s1s2 /mnt2 && mv /apticket.der /mnt1/System/Library/Caches && mv /kernelcache /mnt1/System/Library/Caches/com.apple.kernelcaches && echo Cleaning up... && rm -rf /var/UDZO.dmg && 28 | mv /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/Support/softwareupdateservicesd /mnt1/System/Library/PrivateFrameworks/SoftwareUpdateServices.framework/ && cd /mnt2/mobile/Media 29 | cp -a /iBSS /usr/bin/hfs_resize /usr/bin/kloader . 30 | ./hfs_resize 31 | ./kloader 32 | # Destroy partitions made by CoolBooter and use kloader to jump to a pwned iBEC. 33 | used_size="$(df -B1 | sed -n -e 's/^.*\/dev\/disk0s1s1 //p'| sed -e 's/^[ \t]*//' | sed 's/[^ ]* //' | sed 's/ .*//')" 34 | system_size2="$(($used_size+))" 35 | new_system_size="$(($system_size2/4096 + 5))" 36 | System_GUID="$((echo -e "i\n1\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 37 | Data_GUID="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition unique GUID: //p')" 38 | (echo -e "d\n1\nd\n2\nd\n3\nd\n4\nn\n1\n\n$new_system_size\n\nc\nSystem\nn\n2\n\n\n\nc\n2\nData\nx\na\n2\n48\n49\n\nc\n1\n$System_GUID\n\nc\n2\n$Data_GUID\nw\nY\n") | gptfdisk /dev/rdisk0s1 39 | data_size="$((echo -e "i\n2\nq") | gptfdisk /dev/rdisk0s1 | sed -n -e 's/^.*Partition size: //p' | sed 's/ .*//')" 40 | data_size2="$(($data_size-5))" 41 | new_data_size="$(($data_size2*4096))" 42 | ./hfs_resize /mnt1 $system_size2; ./hfs_resize /mnt2 $new_data_size; ./kloader iBSS 43 | 44 | --------------------------------------------------------------------------------