diff --git a/.gitignore b/.gitignore
index 9a51a1dcd..126de11f0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,34 +1,22 @@
-*.patch
-*.diff
-.*.swp
-Makefile
-Makefile.in
+*.DS_Store
+*.a
+*.o
+*.la
+*.lo
+*/.libs/*
+*/.deps/*
+Makefile*
aclocal.m4
autom4te.cache
-depcomp
compile
-config.h
-config.h.in
-config.log
-config.status
-config.guess
-config.sub
+config.*
configure
+depcomp
install-sh
libtool
ltmain.sh
m4
missing
-futurerestore/*.o
-futurerestore/*.la
-futurerestore/*.lo
-futurerestore/futurerestore
-futurerestore/futurerestore.exe
-futurerestore/.libs
-futurerestore/.deps
+*/config.h.bak
+*/futurerestore*
stamp-h1
-
-# Clion
-.idea/
-cmake-*/
-CMakeLists.txt
diff --git a/.gitmodules b/.gitmodules
index cc305fc38..b31f3b669 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,9 +1,9 @@
[submodule "external/img4tool"]
path = external/img4tool
- url = https://github.com/encounter/img4tool.git
+ url = https://github.com/s0uthwest/img4tool.git
[submodule "external/tsschecker"]
path = external/tsschecker
- url = https://github.com/encounter/tsschecker.git
+ url = https://github.com/s0uthwest/tsschecker.git
[submodule "external/idevicerestore"]
path = external/idevicerestore
- url = https://github.com/encounter/idevicerestore.git
+ url = https://github.com/s0uthwest/idevicerestore.git
diff --git a/LICENSE b/LICENSE.txt
similarity index 100%
rename from LICENSE
rename to LICENSE.txt
diff --git a/README.md b/README.md
deleted file mode 100644
index 65713c4c6..000000000
--- a/README.md
+++ /dev/null
@@ -1,177 +0,0 @@
-# futurerestore
-_futurerestore is a hacked up idevicerestore wrapper, which allows manually specifying SEP and Baseband for restoring_
-
-Latest compiled version can be found here:
-(macOS & Windows)
-https://github.com/encounter/futurerestore/releases
-
----
-
-# Features
-* Supports the following downgrade methods
- * Prometheus 64bit devices (generator and nonce collision mode)
- * Odysseus for 32bit devices
- * Re-restoring 32bit devices to iOS 9 with @alitek123's no-nonce method
-* Allows restoring any nonmatching signed iOS/Sep/Baseband
-
-# Help
-_(might become outdated):_
-
-```
-Usage: futurerestore [OPTIONS] /path/to/ipsw
-
-Options:
-
- -t, --apticket PATH APTicket used for restoring
- -u, --update Update instead of erase install (requires appropriate APTicket)
- -w, --wait Keep rebooting until nonce matches APTicket (nonce collision, unreliable)
- -d, --debug Verbose debug output (useful for error logs)
- --latest-sep Use latest signed sep instead of manually specifying one (may cause bad restore)
- --latest-baseband Use latest signed baseband instead of manually specifying one (may cause bad restore)
- --no-baseband Skip checks and don't flash baseband
- WARNING: only use this for device without a baseband (eg. iPod or some wifi only iPads)
-
-To extract baseband/SEP automatically from IPSW:
-
- -i, --source-ipsw PATH Source IPSW to extract baseband/SEP from
-
-To manually specify baseband/SEP:
-
- -b, --baseband PATH Baseband to be flashed
- -p, --baseband-manifest PATH BuildManifest for requesting baseband ticket
- -s, --sep PATH SEP to be flashed
- -m, --sep-manifest PATH BuildManifest for requesting sep ticket
-```
-
-# Dependencies
-* ## Runtime
- * On macOS and Windows, futurerestore requires no runtime dependencies, the following are only for compiling.
- * On Linux, [usbmuxd](https://github.com/libimobiledevice/usbmuxd) is required at runtime.
-* ## External Libs
- Make sure these are installed
- * libzip
- * libcurl
- * openssl (or CommonCrypto on OSX)
- * [libplist](https://github.com/libimobiledevice/libplist)
-* ## Submodules
- Make sure these projects compile on your system (install their dependencies)
- * [tsschecker](https://github.com/encounter/tsschecker)
- * [img4tool](https://github.com/tihmstar/img4tool)
- * [idevicerestore](https://github.com/encounter/idevicerestore)
-
-# Building from source
-See [COMPILING.md](COMPILING.md)
-
----
-
-## 0) What futurerestore can do
-**Downgrade/Upgrade/Re-restore same iOS.**
-Whenever you read "downgrade" nowadays it means you can also upgrade and re-restore if you're on the same iOS. Basically this allows restoring an iOS and the installed iOS doesn't matter.
-
----
-
-## 1) Prometheus (64bit device) - generator method
-
-### Requirements
-- Jailbreak
-- SHSH2 files with a generator
-- nonceEnabler patch enabled
-
-### Info
-You can downgrade if the destination iOS is compatible with the latest signed SEP and if you have shsh2 files with a generator for that iOS.
-
-### How to use
-1. Device must be jailbroken and nonceEnabler patch must be active
-2. Open shsh file and look up the generator
- * Looks like this: `generator0xde3318d224cf14a1`
-3. Write the generator to device's NVRAM
- * SSH into the device and run `nvram com.apple.System.boot-nonce=0xde3318d224cf14a1` to set the generator *0xde3318d224cf14a1*
- * verify with `nvram -p`
-4. Connect your device in normal mode to computer
-5. On the computer run `futurerestore -t ticket.shsh --latest-baseband --latest-sep ios.ipsw`
-
-### Youtube
-
-*Prometheus*
-
-
-*NonceEnabler*
-
-### Recommended method to active nonceEnabler patch
-1. Get nvpatch https://github.com/Siguza/ios-kern-utils/releases/
-2. Run on the device `nvpatch com.apple.System.boot-nonce`
-
-### Activate tfp0 if jailbreak doesn't allow it
-#### Method 1 (if jailbroken on 9.3.x)
- * reboot
- * reactivate jailbreak with https://jbme.qwertyoruiop.com/
- * done
-
-#### Method 2
- * Use cl0ver (https://github.com/Siguza/cl0ver)
-
----
-
-## 2) Prometheus (64bit device) - nonce collision method
-
-### Requirements
-- iPhone5s or iPad Air on iOS 9.1 - 10.2
-- No Jailbreak required
-- SHSH files with customly chosen APNonce
-- The shsh file needs to have one of the nonces, which the device generates a lot
-
-### Info
-You can downgrade if the destination iOS is compatible with the latest signed SEP. You also need to have special shsh files. If you don't know what this is, you probably can **NOT** use this method!
-
-### How to use
-1. Connect your device in normal mode or recovery mode
-2. On the computer run `futurerestore -w -t ticket.shsh --latest-baseband --latest-sep ios.ipsw`
-* If you have saved multiple tickets with different nonces you can specify more than
-one to speed up the process: `futurerestore -w -t t1.shsh -t t2.shsh -t t3.shsh -t t4.shsh --latest-baseband --latest-sep ios.ipsw`
-
----
-
-## 3) Odysseus (32bit devices)
-
-### Requirements
-- futurerestore compiled with libipatcher (odysseus support)
-- Jailbreak or bootrom exploit (limera1n)
-- Firmware keys for the device/destination iOS must be public (check ipsw.me)
-- SHSH files for the destination iOS (OTA blobs work too!)
-
-### Info
-If you have a jailbroken 32bit device you can downgrade to any iOS you have blobs for. You can still get OTA blobs for iOS 6.1.3 and 8.4.1 for some devices and use those.
-
-### How to use
-1. Get device into kDFU/pwnDFU
- * Pre-iPhone4s (limera1n devices):
- * Enter pwndfu mode with redsn0w or any other tool
- * iPhone4s and later:
- * Jailbreak required!
- * Enter kDFU mode with kDFU app (cydia: repo.tihmstar.net) or by loading a pwniBSS from any existing odysseus bundle.
-2. Connect your device to computer in kDFU mode (or pwnDFU mode)
-3. On the computer run `futurerestore --use-pwndfu -t ticket.shsh --latest-baseband ios.ipsw`
-
-### Youtube
-
-*Futurerestore + Libipatcher*
-
-
-*kDFU App*
-
-
-*Enter kDFU Mode (watch up to the point where the screen goes black)*
-
-*You can use **any** odysseus bundle for this*
-
-## 4) iOS 9 Re-restore bug (found by @alitek123) (32bit devices):
-### Requirements
-- No Jailbreak required
-- SHSH files without a nonce (noNonce APTickets)
-
-### Info
-If you have shsh files for iOS9 which do not contain a nonce, you can restore to that firmware.
-
-### How to use
-1. Connect your device in DFU mode
-2. On the computer run `futurerestore -t ticket.shsh --latest-baseband ios9.ipsw`
diff --git a/ReadMe.md b/ReadMe.md
new file mode 100644
index 000000000..f5d914afe
--- /dev/null
+++ b/ReadMe.md
@@ -0,0 +1,216 @@
+# futurerestore
+_futurerestore is a hacked up idevicerestore wrapper, which allows manually specifying SEP and Baseband for restoring._
+
+__Only use if you are sure what you're doing.__
+---
+Latest release available [here](https://github.com/s0uthwest/futurerestore/releases) for macOS & Windows. I'll compile only macOS/Windows versions, Linux version won't be compiled by me.
+
+## Features
+* Supports the following downgrade methods:
+ * Prometheus 64-bit devices (generator and ApNonce collision mode);
+ * Odysseus for 32-bit devices;
+ * Re-restoring 32-bit devices to iOS 9 with [alitek123](https://github.com/alitek12) no-ApNonce method (alternative — [idevicererestore](https://github.com/s0uthwest/idevicererestore)).
+* Allows restoring any non-matching signed iOS/SEP/Baseband.
+
+__NOT recommended to use '-u' parameter, if you update jailbroken firmware!__
+# Dependencies
+* ## Runtime
+ * On macOS, futurerestore requires no runtime dependencies, the following are only for compiling;
+ * On Linux, [usbmuxd](https://github.com/libimobiledevice/usbmuxd) is required at runtime;
+
+* ## External Libs
+ Required:
+ * [libzip](https://github.com/nih-at/libzip);
+ * [libfragmentzip](https://github.com/s0uthwest/libfragmentzip);
+ * [libplist](https://github.com/libimobiledevice/libplist);
+ * [libirecovery](https://github.com/s0uthwest/libirecovery);
+ * [libimobiledevice](https://github.com/s0uthwest/libimobiledevice);
+
+ Optional:
+ * [libipatcher](https://github.com/s0uthwest/libipatcher);
+
+* ## Submodules
+ Make sure these projects compile on your system (install their dependencies)
+ * [jssy](https://github.com/tihmstar/jssy);
+ * [tsschecker](https://github.com/s0uthwest/tsschecker);
+ * [img4tool](https://github.com/s0uthwest/img4tool);
+ * [idevicerestore](https://github.com/s0uthwest/idevicerestore)
+
+## Report an issue
+You can do it [here](https://github.com/s0uthwest/futurerestore/issues).
+
+### Restoring on Windows 10
+1. Try to restore the device, error -8 occurs;
+2. Leave the device plugged in, it'll stay on the Recovery screen;
+3. Head over to device manager under control panel in Windows;
+4. Locate "Apple Recovery (iBoot) USB Composite Device" (at the bottom);
+5. Right click and choose "Uninstall device".
+ You may see a tick box that allows you to uninstall the driver software as well, tick that (all the three Apple mobile device entries under USB devices will disappear);
+6. Unplug the device and re-plug it in;
+7. Go back to futurerestore and send the restore command again (just press the up arrow to get it back, then enter).
+ Error -8 is now fixed, but the process will fail again after the screen of your device has turned green;
+8. Go back to device manager and repeat the driver uninstall process as described above (step 4 to 6);
+9. Go back to futurerestore once again and repeat the restore process;
+10. The device will reboot and error -10 will also be solved;
+11. The restore will now proceed and succeed.
+
+## Compiling
+Simple use `bash autogen.sh && make` or use Xcode project. For installing use `make install`.
+
+### Some about [cURL](https://github.com/curl/curl)
+ * Linux: Follow [this guide](https://dev.to/jake/using-libcurl3-and-libcurl4-on-ubuntu-1804-bionic-184g) to use tsschecker on Ubuntu 18.04 (Bionic) as it requires libcurl3 which cannot coexist with libcurl4 on this OS.
+ * macOS: open file [Makefile.am](https://github.com/s0uthwest/futurerestore/blob/master/futurerestore/Makefile.am) and update line with LDADD: `futurerestore_LDADD = $(AM_LDFLAGS) libjssy.a /usr/lib/libcurl.4.dylib`
+---
+
+## 0) What futurerestore can do
+**Downgrade/Upgrade/Re-restore _same_ iOS.**
+Whenever you read "downgrade" nowadays it means you can also upgrade and re-restore if you're on the same iOS. Basically this allows restoring an iOS and the installed iOS doesn't matter.
+
+---
+
+## 1) Prometheus (64-bit device) - generator method
+
+### Requirements
+- __Jailbreak;__
+- Signing tickets (.shsh2) files with a generator;
+- nonceEnabler patch enabled (on iOS 11 and later it's enabled automatically);
+
+### How to use
+1. Device must be jailbroken and nonceEnabler patch must be active;
+2. Open signing ticket and look up the generator:
+ * Looks like this: `generator0xde3318d224cf14a1`;
+3. Write the boot-nonce generator to device's nvram (latest jailbreaks'll (for iOS 11+) unlocking nvram after setting boot-nonce):
+ * SSH into the device and run `nvram com.apple.System.boot-nonce=0xde3318d224cf14a1` to set the boot-nonce generator *0xde3318d224cf14a1*;
+ * verify with `nvram -p` command
+
+### Recommended methods to activate nonceEnabler patch
+#### Method 1: ios-kern-utils (iOS 7.x-10.x):
+1. Install DEB-file of [ios-kern-utils](https://github.com/Siguza/ios-kern-utils/releases/) on device;
+2. Run on the device `nvpatch com.apple.System.boot-nonce`.
+
+#### Method 2: Using special applications
+Use utilities for setting boot-nonce generator:
+1. [PhœnixNonce](https://github.com/Siguza/PhoenixNonce) for iOS 9.x;
+2. [v0rtexnonce](https://github.com/arx8x/v0rtexnonce) for iOS 10.x;
+3. [Nonceset1112](https://github.com/julioverne/NonceSet112) for iOS 11.0-11.1.2;
+4. [noncereboot1131UI](https://github.com/s0uthwest/noncereboot1131UI) for iOS 11.0-11.4b3;
+5. [NonceReboot12xx](https://github.com/ur0/NonceReboot12XX) for iOS 12.0-12.1.2.
+
+#### Method 3: Using jailbreak tools
+Use jailbreak tools for setting boot-nonce generator:
+1. [Meridian](https://meridian.sparkes.zone) for iOS 10.x;
+2. [backr00m](https://nito.tv) or greeng0blin for tvOS 10.2-11.1;
+3. [Electra and ElectraTV](https://coolstar.org/electra) for iOS and tvOS 11.x;
+4. [unc0ver](https://github.com/pwn20wndstuff/Undecimus/releases) for iOS 11.0-12.1.2;
+5. [Chimera and ChimeraTV](https://chimera.sh) for iOS 12.0-12.1.2 and tvOS 12.0-12.1.1.
+
+### Activate tfp0 if jailbreak doesn't allow it
+#### Method 1 (if jailbroken on 9.2-9.3.x)
+ * reboot;
+ * reactivate jailbreak with [Luca Todesco](https://github.com/kpwn)'s [JailbreakMe](https://jbme.qwertyoruiop.com/);
+ * done.
+
+#### Method 2 (if jailbroken on iOS 8.0-8.1 with [Pangu8](https://en.8.pangu.io))
+ * install this [untether DEB-file](http://apt.saurik.com/beta/pangu8-tfp0/io.pangu.xuanyuansword8_0.5_iphoneos-arm.deb) with included tfp0 patch
+
+#### Method 3 (if jailbroken on iOS 7.x with [Pangu7](https://en.7.pangu.io))
+ * install this [untether DEB-file](http://apt.saurik.com/debs/io.pangu.axe7_0.3_iphoneos-arm.deb) with included tfp0 patch
+
+#### Method 4
+ * Use [cl0ver](https://github.com/Siguza/cl0ver) for iOS 9.x.
+
+---
+
+## 2) Prometheus (64-bit device) - ApNonce collision method (Recovery mode);
+
+### Requirements
+- __iPhone 5s, iPad Air, iPad mini 2 (devices with A7 chip) on iOS 9.2 — 10.2 (10.3b1);__
+- Jailbreak doesn't required;
+- Signing tickets (.shsh, .shsh2) with customly chosen ApNonce;
+- Ticket needs to have one of the ApNonces, which the device generates a lot;
+- __collisioned ApNonces available in file 'nonces.txt' in [TSSChecker](https://github.com/s0uthwest/tsschecker) project.__
+
+### How to use
+1. Connect your device in normal / recovery mode;
+2. On the computer run `futurerestore -w -t ticket.shsh --latest-baseband --latest-sep ios.ipsw`.
+* If you have saved multiple tickets with different ApNonces you can specify more than
+one to speed up the process: `futurerestore -w -t t1.shsh -t t2.shsh -t t3.shsh -t t4.shsh --latest-baseband --latest-sep ios.ipsw`.
+
+---
+
+## 3) Prometheus (64-bit device) - ApNonce collision method (DFU mode);
+
+### Requirements
+- __Devices with A7 (iPhone 5s, iPad Air, iPad mini 2), A8 (iPhone 6 [+], iPad mini [2,3,4], iPod touch [6th generation]) and A8X (iPad Air 2) chips on all iOS firmwares;__
+- __Devices have been released after ~September, 2015;__
+- Jailbreak doesn't required;
+- Signing tickets (.shsh, .shsh2) with customly chosen ApNonce;
+- Ticket needs to have one of the ApNonces, which the device generates a lot;
+- __[img4tool](https://github.com/s0uthwest/img4tool) can't be used for Windows [problem with signing iBSS/iBEC], now it's TO-DO;__
+- __collisioned ApNonces available in file 'nonces.txt' in [TSSChecker](https://github.com/s0uthwest/tsschecker) project.__
+
+### How to use
+1. Connect your device in DFU mode;
+2. Use [irecovery](https://github.com/s0uthwest/libirecovery) for checking ApNonce, which booted in DFU;
+3. Extract iBSS/iBEC from target firmware for downgrade (unsigned);
+4. Check DFU-collisioned ApNonces with [irecovery](https://github.com/s0uthwest/irecovery/releases), which booted in DFU.
+ You can't automatically collision DFU ApNonces.
+
+ __If ApNonce is not collisioned, "use hands" for DFU booting.__
+
+ __If ApNonce is successfully coliisioned, use this SHSH2 for sign iBSS/iBEC.__
+5. Use [img4tool](https://github.com/s0uthwest/img4tool/releases) for sign iBSS:
+ `img4tool -s ticket.shsh -c iBSS.signed -p `;
+6. Use [img4tool](https://github.com/s0uthwest/img4tool/releases) for sign iBEC:
+ `img4tool -s ticket.shsh -c iBEC.signed -p `;
+7. So, after signing we can boot into Recovery with [irecovery](https://github.com/s0uthwest/libirecovery/releases):
+
+ `irecovery -f iBSS.signed` - loading iBSS;
+
+ `irecovery -f iBEC.signed` - loading iBEC;
+8. So good! On the computer run `futurerestore -t ticket.shsh --latest-baseband --latest-sep -w ios.ipsw`.
+
+---
+
+## 4) Odysseus (32-bit devices)
+
+### Requirements
+- futurerestore compiled with [libipatcher](https://github.com/s0uthwest/libipatcher) ([Odysseus](https://dayt0n.com/articles/Odysseus) method support);
+- Jailbreak or bootROM exploit (limera1n);
+- Firmware keys for the device/destination iOS must be public;
+- Signing tickets (.shsh, .shsh2) for the destination iOS (OTA blobs work too!);
+- _Odysseus bundle (You can use any successfully created bundle for this)._
+
+### How to use
+1. Get device into kDFU/pwnDFU mode:
+ * limera1n devices:
+ * Enter pwnDFU mode with redsn0w or any other tool;
+ * Other 32-bit devices:
+ * Jailbreak required;
+ * Enter kDFU mode by loading a pwnediBSS from any existing Odysseus bundle.
+2. Connect your device to computer in kDFU / pwnDFU mode;
+3. On the computer run `futurerestore --use-pwndfu -t ticket.shsh --latest-baseband ios.ipsw`
+
+---
+
+## 5) iOS 9 Re-restore bug (found by [@alitek123](https://github.com/alitek12), 32-bit devices only):
+### Requirements
+- Jailbreak doesn't required;
+- __Signing tickets (.shsh, .shsh2) without a ApNonce (noNonce APTickets);__
+
+### Info
+If you have signing tickets for iOS 9.x which do not contain an ApNonce, you can restore to that firmware.
+
+### How to use
+1. Connect your device in DFU mode;
+2. On the computer run `futurerestore -t ticket.shsh --latest-baseband ios9.ipsw`
+
+---
+
+## Credits
+Creator of [original project](https://github.com/tihmstar/futurerestore) - [tihmstar](https://github.com/tihmstar).
+
+
+ReadMe updated on:
+
+ 2019-07-02
diff --git a/autogen.sh b/autogen.sh
index 24134441f..8c450d825 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -25,4 +25,3 @@ if [ -z "$NOCONFIGURE" ]; then
./configure "$@"
fi
./setBuildVersion.sh
-
diff --git a/configure.ac b/configure.ac
index 48d765825..68e5e62df 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,9 +1,9 @@
AC_PREREQ(2.64)
-AC_INIT([futurerestore], [1.0], [https://github.com/encounter/futurerestore/issues],, [https://github.com/encounter/futurerestore])
+AC_INIT([futurerestore], [1.0], [https://github.com/s0uthwest/futurerestore/issues])
AC_CANONICAL_SYSTEM
-
AC_CANONICAL_HOST
+
# Check for operating system
AC_MSG_CHECKING([whether we need platform-specific build settings])
case $host_os in
@@ -28,16 +28,17 @@ AC_CONFIG_MACRO_DIRS([m4])
AC_CONFIG_SUBDIRS(external/idevicerestore external/img4tool external/tsschecker)
AC_CONFIG_SRCDIR([futurerestore])
+# Check for libraries
AC_SEARCH_LIBS([pthread_create], [pthread])
-PKG_CHECK_MODULES(libplist, libplist >= 1.12)
+PKG_CHECK_MODULES(libplist, libplist >= 2.0.0)
PKG_CHECK_MODULES(libzip, libzip >= 0.10)
PKG_CHECK_MODULES(libimobiledevice, libimobiledevice-1.0 >= 1.2.1)
+PKG_CHECK_MODULES(libfragmentzip, libfragmentzip >= 1.0)
PKG_CHECK_MODULES(libirecovery, libirecovery >= 0.2.0)
AC_PROG_CC
AC_PROG_CXX
-
# Optional module libipatcher
AC_ARG_WITH([libipatcher],
[AS_HELP_STRING([--without-libipatcher],
@@ -81,7 +82,6 @@ Makefile
futurerestore/Makefile
])
-
echo "
Configuration for $PACKAGE $VERSION:
-------------------------------------------
diff --git a/external/idevicerestore b/external/idevicerestore
index 396777645..b10634c81 160000
--- a/external/idevicerestore
+++ b/external/idevicerestore
@@ -1 +1 @@
-Subproject commit 39677764510f5da14a4d5357204e0cd8575dae25
+Subproject commit b10634c81b47bc6842538358e889063e9cbcdbd4
diff --git a/external/img4tool b/external/img4tool
index b3bb5040e..8780189f2 160000
--- a/external/img4tool
+++ b/external/img4tool
@@ -1 +1 @@
-Subproject commit b3bb5040e0defdc50ba66ace029910e48597efd8
+Subproject commit 8780189f2dd064395d15d996f490d5f4435e8aa0
diff --git a/external/tsschecker b/external/tsschecker
index e2243e8d5..78c1203bc 160000
--- a/external/tsschecker
+++ b/external/tsschecker
@@ -1 +1 @@
-Subproject commit e2243e8d5256f9d1ba402069f10d0e0a0cd83d57
+Subproject commit 78c1203bcb326dcc813cc24cce2df6b88c01eef4
diff --git a/futurerestore.xcodeproj/project.pbxproj b/futurerestore.xcodeproj/project.pbxproj
index c79de8748..2532ed9ce 100644
--- a/futurerestore.xcodeproj/project.pbxproj
+++ b/futurerestore.xcodeproj/project.pbxproj
@@ -3,19 +3,39 @@
archiveVersion = 1;
classes = {
};
- objectVersion = 46;
+ objectVersion = 48;
objects = {
/* Begin PBXBuildFile section */
+ 56043D502205BEC100559249 /* json_plist.c in Sources */ = {isa = PBXBuildFile; fileRef = 56043D4C2205BEC100559249 /* json_plist.c */; };
+ 56043D512205BEC100559249 /* jsmn.c in Sources */ = {isa = PBXBuildFile; fileRef = 56043D4F2205BEC100559249 /* jsmn.c */; };
+ 56043D552205BF3B00559249 /* libbz2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 56043D542205BF3A00559249 /* libbz2.a */; };
+ 5604B7C7219B3630004C22EE /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 5604B7C6219B3630004C22EE /* libz.tbd */; };
+ 5604B7C9219B3632004C22EE /* libcurl.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 5604B7C8219B3632004C22EE /* libcurl.tbd */; };
+ 560D59EF21FE225200553AEC /* libcommon.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 560D59EE21FE225200553AEC /* libcommon.a */; };
+ 560D59F121FE225E00553AEC /* libcrypto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 560D59F021FE225D00553AEC /* libcrypto.a */; };
+ 560D59F321FE226E00553AEC /* libfragmentzip.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 560D59F221FE226E00553AEC /* libfragmentzip.a */; };
+ 560D59F521FE227700553AEC /* libimobiledevice.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 560D59F421FE227700553AEC /* libimobiledevice.a */; };
+ 560D59F721FE228000553AEC /* libipatcher.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 560D59F621FE228000553AEC /* libipatcher.a */; };
+ 560D59F921FE228B00553AEC /* libirecovery.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 560D59F821FE228B00553AEC /* libirecovery.a */; };
+ 560D59FB21FE229700553AEC /* liblzfse.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 560D59FA21FE229600553AEC /* liblzfse.a */; };
+ 560D59FD21FE22A100553AEC /* libpartialzip-1.0.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 560D59FC21FE22A100553AEC /* libpartialzip-1.0.a */; };
+ 560D59FF21FE22A800553AEC /* libplist.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 560D59FE21FE22A800553AEC /* libplist.a */; };
+ 560D5A0121FE22C500553AEC /* libpng16.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 560D5A0021FE22C500553AEC /* libpng16.a */; };
+ 560D5A0321FE22D000553AEC /* libssl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 560D5A0221FE22D000553AEC /* libssl.a */; };
+ 560D5A0521FE22DA00553AEC /* libusbmuxd.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 560D5A0421FE22DA00553AEC /* libusbmuxd.a */; };
+ 560D5A0721FE22E500553AEC /* libxpwn.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 560D5A0621FE22E500553AEC /* libxpwn.a */; };
+ 560D5A0821FE235D00553AEC /* debug.h in Sources */ = {isa = PBXBuildFile; fileRef = 56163B0B21E514B00069A0B0 /* debug.h */; };
+ 56520BEB21B1BA91005BD3F7 /* lzssdec.c in Sources */ = {isa = PBXBuildFile; fileRef = 56520BE921B1BA90005BD3F7 /* lzssdec.c */; };
+ 56520BEF21B1BADE005BD3F7 /* endianness.h in Sources */ = {isa = PBXBuildFile; fileRef = 878587571D89D1C1008689F0 /* endianness.h */; };
+ 56520BF021B1BAE6005BD3F7 /* limera1n_payload.h in Sources */ = {isa = PBXBuildFile; fileRef = 878587661D89D1C1008689F0 /* limera1n_payload.h */; };
+ 56520BFA21B1BB14005BD3F7 /* jssy.c in Sources */ = {isa = PBXBuildFile; fileRef = 56520BF221B1BB13005BD3F7 /* jssy.c */; };
+ 56520BFB21B1BB14005BD3F7 /* cmain.c in Sources */ = {isa = PBXBuildFile; fileRef = 56520BF321B1BB13005BD3F7 /* cmain.c */; };
+ 56520BFC21B1BB14005BD3F7 /* jssy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 56520BF621B1BB13005BD3F7 /* jssy.cpp */; };
+ 56DA634021E3462300821A21 /* ptr_smart.hpp in Sources */ = {isa = PBXBuildFile; fileRef = 56520BF721B1BB13005BD3F7 /* ptr_smart.hpp */; };
+ 56DA634121E3462600821A21 /* jssy.hpp in Sources */ = {isa = PBXBuildFile; fileRef = 56520BF421B1BB13005BD3F7 /* jssy.hpp */; };
+ 56DA634221E3463900821A21 /* helper.h in Sources */ = {isa = PBXBuildFile; fileRef = 56520BF521B1BB13005BD3F7 /* helper.h */; };
878587471D89CFDC008689F0 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 878587461D89CFDC008689F0 /* main.cpp */; };
- 878587A71D89D56E008689F0 /* libplist.3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 878587A61D89D56E008689F0 /* libplist.3.dylib */; };
- 878587AB1D89D590008689F0 /* libimobiledevice.6.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 878587AA1D89D590008689F0 /* libimobiledevice.6.dylib */; };
- 878587AD1D89D59E008689F0 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 878587AC1D89D59E008689F0 /* libz.tbd */; };
- 878587AF1D89D5A5008689F0 /* libcurl.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 878587AE1D89D5A5008689F0 /* libcurl.tbd */; };
- 878587B71D89D637008689F0 /* libirecovery.2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 878587B61D89D637008689F0 /* libirecovery.2.dylib */; };
- 8788A6811EE8426A00138E07 /* libipatcher.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8788A6801EE8426A00138E07 /* libipatcher.0.dylib */; };
- 8788A6831EE8544000138E07 /* jssy.c in Sources */ = {isa = PBXBuildFile; fileRef = 8788A6821EE8544000138E07 /* jssy.c */; };
- 878E1AC51F73EB3F00B1565B /* libzip.5.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 878E1AC41F73EB3F00B1565B /* libzip.5.dylib */; };
8799B0B21D89D99D002F4D5F /* futurerestore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8799B0B01D89D99D002F4D5F /* futurerestore.cpp */; };
8799B0B31D89DAE7002F4D5F /* idevicerestore.c in Sources */ = {isa = PBXBuildFile; fileRef = 8785875C1D89D1C1008689F0 /* idevicerestore.c */; settings = {COMPILER_FLAGS = "-D HAVE_CONFIG_H=1 "; }; };
8799B0B41D89DAF6002F4D5F /* tss.c in Sources */ = {isa = PBXBuildFile; fileRef = 878587761D89D1C1008689F0 /* tss.c */; };
@@ -40,8 +60,6 @@
8799B0CA1D89E371002F4D5F /* img4.c in Sources */ = {isa = PBXBuildFile; fileRef = 878587601D89D1C1008689F0 /* img4.c */; };
8799B0CB1D89F796002F4D5F /* tsschecker.c in Sources */ = {isa = PBXBuildFile; fileRef = 8785879F1D89D2BA008689F0 /* tsschecker.c */; };
8799B0CC1D89F7B9002F4D5F /* download.c in Sources */ = {isa = PBXBuildFile; fileRef = 878587981D89D2BA008689F0 /* download.c */; };
- 87F574CB1E151E97008D5C4D /* libfragmentzip.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 87F574CA1E151E97008D5C4D /* libfragmentzip.0.dylib */; };
- 87F574D01E151F44008D5C4D /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 87F574C51E151D42008D5C4D /* libcrypto.dylib */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
@@ -57,6 +75,38 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
+ 56043D4C2205BEC100559249 /* json_plist.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = json_plist.c; sourceTree = ""; };
+ 56043D4D2205BEC100559249 /* json_plist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = json_plist.h; sourceTree = ""; };
+ 56043D4E2205BEC100559249 /* jsmn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsmn.h; sourceTree = ""; };
+ 56043D4F2205BEC100559249 /* jsmn.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = jsmn.c; sourceTree = ""; };
+ 56043D542205BF3A00559249 /* libbz2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libbz2.a; path = ../../../../../usr/local/Cellar/bzip2/1.0.6_1/lib/libbz2.a; sourceTree = ""; };
+ 5604B7C6219B3630004C22EE /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
+ 5604B7C8219B3632004C22EE /* libcurl.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libcurl.tbd; path = usr/lib/libcurl.tbd; sourceTree = SDKROOT; };
+ 560D59EE21FE225200553AEC /* libcommon.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcommon.a; path = ../../../../../usr/local/lib/libcommon.a; sourceTree = ""; };
+ 560D59F021FE225D00553AEC /* libcrypto.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcrypto.a; path = ../../../../../usr/local/lib/libcrypto.a; sourceTree = ""; };
+ 560D59F221FE226E00553AEC /* libfragmentzip.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libfragmentzip.a; path = ../../../../../usr/local/lib/libfragmentzip.a; sourceTree = ""; };
+ 560D59F421FE227700553AEC /* libimobiledevice.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libimobiledevice.a; path = ../../../../../usr/local/lib/libimobiledevice.a; sourceTree = ""; };
+ 560D59F621FE228000553AEC /* libipatcher.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libipatcher.a; path = ../../../../../usr/local/lib/libipatcher.a; sourceTree = ""; };
+ 560D59F821FE228B00553AEC /* libirecovery.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libirecovery.a; path = ../../../../../usr/local/lib/libirecovery.a; sourceTree = ""; };
+ 560D59FA21FE229600553AEC /* liblzfse.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = liblzfse.a; path = ../../../../../usr/local/lib/liblzfse.a; sourceTree = ""; };
+ 560D59FC21FE22A100553AEC /* libpartialzip-1.0.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libpartialzip-1.0.a"; path = "../../../../../usr/local/lib/libpartialzip-1.0.a"; sourceTree = ""; };
+ 560D59FE21FE22A800553AEC /* libplist.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libplist.a; path = ../../../../../usr/local/lib/libplist.a; sourceTree = ""; };
+ 560D5A0021FE22C500553AEC /* libpng16.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpng16.a; path = ../../../../../usr/local/lib/libpng16.a; sourceTree = ""; };
+ 560D5A0221FE22D000553AEC /* libssl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libssl.a; path = ../../../../../usr/local/lib/libssl.a; sourceTree = ""; };
+ 560D5A0421FE22DA00553AEC /* libusbmuxd.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libusbmuxd.a; path = ../../../../../usr/local/lib/libusbmuxd.a; sourceTree = ""; };
+ 560D5A0621FE22E500553AEC /* libxpwn.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libxpwn.a; path = ../../../../../usr/local/lib/libxpwn.a; sourceTree = ""; };
+ 56163B0B21E514B00069A0B0 /* debug.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = debug.h; sourceTree = ""; };
+ 563DA64221BBE40700844624 /* all.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = all.h; sourceTree = ""; };
+ 563DA64321BBE41C00844624 /* all.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = all.h; path = external/tsschecker/tsschecker/all.h; sourceTree = SOURCE_ROOT; };
+ 56520BE921B1BA90005BD3F7 /* lzssdec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = lzssdec.c; sourceTree = ""; };
+ 56520BEA21B1BA90005BD3F7 /* lzssdec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lzssdec.h; sourceTree = ""; };
+ 56520BF221B1BB13005BD3F7 /* jssy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = jssy.c; path = external/tsschecker/external/jssy/jssy/jssy.c; sourceTree = SOURCE_ROOT; };
+ 56520BF321B1BB13005BD3F7 /* cmain.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cmain.c; path = external/tsschecker/external/jssy/jssy/cmain.c; sourceTree = SOURCE_ROOT; };
+ 56520BF421B1BB13005BD3F7 /* jssy.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = jssy.hpp; path = external/tsschecker/external/jssy/jssy/jssy.hpp; sourceTree = SOURCE_ROOT; };
+ 56520BF521B1BB13005BD3F7 /* helper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = helper.h; path = external/tsschecker/external/jssy/jssy/helper.h; sourceTree = SOURCE_ROOT; };
+ 56520BF621B1BB13005BD3F7 /* jssy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = jssy.cpp; path = external/tsschecker/external/jssy/jssy/jssy.cpp; sourceTree = SOURCE_ROOT; };
+ 56520BF721B1BB13005BD3F7 /* ptr_smart.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ptr_smart.hpp; path = external/tsschecker/external/jssy/jssy/ptr_smart.hpp; sourceTree = SOURCE_ROOT; };
+ 56520BF821B1BB13005BD3F7 /* jssy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = jssy.h; path = external/tsschecker/external/jssy/jssy/jssy.h; sourceTree = SOURCE_ROOT; };
878587431D89CFDC008689F0 /* futurerestore */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = futurerestore; sourceTree = BUILT_PRODUCTS_DIR; };
878587461D89CFDC008689F0 /* main.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; };
8785874F1D89D1C1008689F0 /* asr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = asr.c; sourceTree = ""; };
@@ -99,35 +149,18 @@
878587751D89D1C1008689F0 /* thread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread.h; sourceTree = ""; };
878587761D89D1C1008689F0 /* tss.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tss.c; sourceTree = ""; };
878587771D89D1C1008689F0 /* tss.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tss.h; sourceTree = ""; };
- 8785878C1D89D1ED008689F0 /* all_img4tool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = all_img4tool.h; sourceTree = ""; };
8785878E1D89D1ED008689F0 /* img4.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = img4.c; sourceTree = ""; };
8785878F1D89D1ED008689F0 /* img4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = img4.h; sourceTree = ""; };
878587901D89D1ED008689F0 /* img4tool.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = img4tool.c; sourceTree = ""; };
878587941D89D243008689F0 /* img4tool.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = img4tool.h; sourceTree = ""; };
878587951D89D290008689F0 /* config.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = ""; };
- 878587971D89D2BA008689F0 /* all_tsschecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = all_tsschecker.h; sourceTree = ""; };
878587981D89D2BA008689F0 /* download.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = download.c; sourceTree = ""; };
878587991D89D2BA008689F0 /* download.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = download.h; sourceTree = ""; };
- 8785879A1D89D2BA008689F0 /* jsmn.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = jsmn.c; sourceTree = ""; };
- 8785879B1D89D2BA008689F0 /* jsmn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsmn.h; sourceTree = ""; };
8785879F1D89D2BA008689F0 /* tsschecker.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tsschecker.c; sourceTree = ""; };
878587A01D89D2BA008689F0 /* tsschecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tsschecker.h; sourceTree = ""; };
- 878587A61D89D56E008689F0 /* libplist.3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libplist.3.dylib; path = ../../../../usr/local/lib/libplist.3.dylib; sourceTree = ""; };
- 878587A81D89D578008689F0 /* libirecovery.1.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libirecovery.1.dylib; path = ../../../../usr/local/lib/libirecovery.1.dylib; sourceTree = ""; };
- 878587AA1D89D590008689F0 /* libimobiledevice.6.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libimobiledevice.6.dylib; path = ../../../../usr/local/lib/libimobiledevice.6.dylib; sourceTree = ""; };
- 878587AC1D89D59E008689F0 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
- 878587AE1D89D5A5008689F0 /* libcurl.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libcurl.tbd; path = usr/lib/libcurl.tbd; sourceTree = SDKROOT; };
- 878587B21D89D5D5008689F0 /* libzip.4.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libzip.4.dylib; path = ../../../../usr/local/lib/libzip.4.dylib; sourceTree = ""; };
- 878587B41D89D5E6008689F0 /* libpartialzip-1.0.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libpartialzip-1.0.0.dylib"; path = "../../../../usr/local/lib/libpartialzip-1.0.0.dylib"; sourceTree = ""; };
- 878587B61D89D637008689F0 /* libirecovery.2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libirecovery.2.dylib; path = ../../../../usr/local/lib/libirecovery.2.dylib; sourceTree = ""; };
- 8788A6801EE8426A00138E07 /* libipatcher.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libipatcher.0.dylib; path = ../../../../usr/local/lib/libipatcher.0.dylib; sourceTree = ""; };
- 8788A6821EE8544000138E07 /* jssy.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = jssy.c; path = external/tsschecker/external/jssy/jssy/jssy.c; sourceTree = ""; };
- 878E1AC41F73EB3F00B1565B /* libzip.5.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libzip.5.dylib; path = ../../../../usr/local/Cellar/libzip/1.3.0/lib/libzip.5.dylib; sourceTree = ""; };
8799B0B01D89D99D002F4D5F /* futurerestore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = futurerestore.cpp; sourceTree = ""; };
8799B0B11D89D99D002F4D5F /* futurerestore.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = futurerestore.hpp; sourceTree = ""; };
- 87F574C51E151D42008D5C4D /* libcrypto.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcrypto.dylib; path = ../../../../usr/lib/libcrypto.dylib; sourceTree = ""; };
87F574C71E151DA6008D5C4D /* libcommonCrypto.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libcommonCrypto.tbd; path = usr/lib/system/libcommonCrypto.tbd; sourceTree = SDKROOT; };
- 87F574CA1E151E97008D5C4D /* libfragmentzip.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libfragmentzip.0.dylib; path = ../../../../usr/local/lib/libfragmentzip.0.dylib; sourceTree = ""; };
87F574CC1E151EF8008D5C4D /* libcorecrypto.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libcorecrypto.tbd; path = usr/lib/system/libcorecrypto.tbd; sourceTree = SDKROOT; };
87F574CE1E151F11008D5C4D /* libSystem.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libSystem.tbd; path = usr/lib/libSystem.tbd; sourceTree = SDKROOT; };
/* End PBXFileReference section */
@@ -137,33 +170,45 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
- 878E1AC51F73EB3F00B1565B /* libzip.5.dylib in Frameworks */,
- 878587AD1D89D59E008689F0 /* libz.tbd in Frameworks */,
- 8788A6811EE8426A00138E07 /* libipatcher.0.dylib in Frameworks */,
- 87F574D01E151F44008D5C4D /* libcrypto.dylib in Frameworks */,
- 87F574CB1E151E97008D5C4D /* libfragmentzip.0.dylib in Frameworks */,
- 878587B71D89D637008689F0 /* libirecovery.2.dylib in Frameworks */,
- 878587AF1D89D5A5008689F0 /* libcurl.tbd in Frameworks */,
- 878587AB1D89D590008689F0 /* libimobiledevice.6.dylib in Frameworks */,
- 878587A71D89D56E008689F0 /* libplist.3.dylib in Frameworks */,
+ 560D59FF21FE22A800553AEC /* libplist.a in Frameworks */,
+ 5604B7C7219B3630004C22EE /* libz.tbd in Frameworks */,
+ 560D59F321FE226E00553AEC /* libfragmentzip.a in Frameworks */,
+ 560D59F721FE228000553AEC /* libipatcher.a in Frameworks */,
+ 560D5A0321FE22D000553AEC /* libssl.a in Frameworks */,
+ 560D59F921FE228B00553AEC /* libirecovery.a in Frameworks */,
+ 560D5A0121FE22C500553AEC /* libpng16.a in Frameworks */,
+ 560D59F521FE227700553AEC /* libimobiledevice.a in Frameworks */,
+ 560D5A0521FE22DA00553AEC /* libusbmuxd.a in Frameworks */,
+ 560D59EF21FE225200553AEC /* libcommon.a in Frameworks */,
+ 560D59FD21FE22A100553AEC /* libpartialzip-1.0.a in Frameworks */,
+ 560D5A0721FE22E500553AEC /* libxpwn.a in Frameworks */,
+ 56043D552205BF3B00559249 /* libbz2.a in Frameworks */,
+ 560D59FB21FE229700553AEC /* liblzfse.a in Frameworks */,
+ 5604B7C9219B3632004C22EE /* libcurl.tbd in Frameworks */,
+ 560D59F121FE225E00553AEC /* libcrypto.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
+ 561C73F221973D620030617C /* jssy */ = {
+ isa = PBXGroup;
+ children = (
+ 56520BF321B1BB13005BD3F7 /* cmain.c */,
+ 56520BF521B1BB13005BD3F7 /* helper.h */,
+ 56520BF221B1BB13005BD3F7 /* jssy.c */,
+ 56520BF621B1BB13005BD3F7 /* jssy.cpp */,
+ 56520BF821B1BB13005BD3F7 /* jssy.h */,
+ 56520BF421B1BB13005BD3F7 /* jssy.hpp */,
+ 56520BF721B1BB13005BD3F7 /* ptr_smart.hpp */,
+ );
+ name = jssy;
+ sourceTree = "";
+ };
8785873A1D89CFDC008689F0 = {
isa = PBXGroup;
children = (
- 8788A6821EE8544000138E07 /* jssy.c */,
- 878587B61D89D637008689F0 /* libirecovery.2.dylib */,
- 878587B41D89D5E6008689F0 /* libpartialzip-1.0.0.dylib */,
- 878587B21D89D5D5008689F0 /* libzip.4.dylib */,
- 878587AE1D89D5A5008689F0 /* libcurl.tbd */,
- 878587AC1D89D59E008689F0 /* libz.tbd */,
- 878587AA1D89D590008689F0 /* libimobiledevice.6.dylib */,
- 878587A81D89D578008689F0 /* libirecovery.1.dylib */,
- 878587A61D89D56E008689F0 /* libplist.3.dylib */,
878587451D89CFDC008689F0 /* futurerestore */,
878587441D89CFDC008689F0 /* Products */,
87F574C21E151CDE008D5C4D /* Frameworks */,
@@ -193,6 +238,7 @@
8785874D1D89D1A4008689F0 /* external */ = {
isa = PBXGroup;
children = (
+ 561C73F221973D620030617C /* jssy */,
878587961D89D2BA008689F0 /* tsschecker */,
8785878B1D89D1ED008689F0 /* img4tool */,
8785874E1D89D1C1008689F0 /* idevicerestore */,
@@ -224,6 +270,10 @@
878587611D89D1C1008689F0 /* img4.h */,
878587621D89D1C1008689F0 /* ipsw.c */,
878587631D89D1C1008689F0 /* ipsw.h */,
+ 56043D4F2205BEC100559249 /* jsmn.c */,
+ 56043D4E2205BEC100559249 /* jsmn.h */,
+ 56043D4C2205BEC100559249 /* json_plist.c */,
+ 56043D4D2205BEC100559249 /* json_plist.h */,
878587641D89D1C1008689F0 /* limera1n.c */,
878587651D89D1C1008689F0 /* limera1n.h */,
878587661D89D1C1008689F0 /* limera1n_payload.h */,
@@ -251,11 +301,13 @@
8785878B1D89D1ED008689F0 /* img4tool */ = {
isa = PBXGroup;
children = (
- 8785878C1D89D1ED008689F0 /* all_img4tool.h */,
+ 563DA64321BBE41C00844624 /* all.h */,
8785878F1D89D1ED008689F0 /* img4.h */,
8785878E1D89D1ED008689F0 /* img4.c */,
878587941D89D243008689F0 /* img4tool.h */,
878587901D89D1ED008689F0 /* img4tool.c */,
+ 56520BE921B1BA90005BD3F7 /* lzssdec.c */,
+ 56520BEA21B1BA90005BD3F7 /* lzssdec.h */,
);
name = img4tool;
path = external/img4tool/img4tool;
@@ -264,11 +316,10 @@
878587961D89D2BA008689F0 /* tsschecker */ = {
isa = PBXGroup;
children = (
- 878587971D89D2BA008689F0 /* all_tsschecker.h */,
+ 563DA64221BBE40700844624 /* all.h */,
+ 56163B0B21E514B00069A0B0 /* debug.h */,
878587991D89D2BA008689F0 /* download.h */,
878587981D89D2BA008689F0 /* download.c */,
- 8785879B1D89D2BA008689F0 /* jsmn.h */,
- 8785879A1D89D2BA008689F0 /* jsmn.c */,
878587A01D89D2BA008689F0 /* tsschecker.h */,
8785879F1D89D2BA008689F0 /* tsschecker.c */,
);
@@ -279,13 +330,25 @@
87F574C21E151CDE008D5C4D /* Frameworks */ = {
isa = PBXGroup;
children = (
- 878E1AC41F73EB3F00B1565B /* libzip.5.dylib */,
- 8788A6801EE8426A00138E07 /* libipatcher.0.dylib */,
+ 5604B7C8219B3632004C22EE /* libcurl.tbd */,
+ 5604B7C6219B3630004C22EE /* libz.tbd */,
+ 560D59EE21FE225200553AEC /* libcommon.a */,
+ 560D59F021FE225D00553AEC /* libcrypto.a */,
+ 560D59F221FE226E00553AEC /* libfragmentzip.a */,
+ 560D59F421FE227700553AEC /* libimobiledevice.a */,
+ 560D59F621FE228000553AEC /* libipatcher.a */,
+ 560D59F821FE228B00553AEC /* libirecovery.a */,
+ 560D59FA21FE229600553AEC /* liblzfse.a */,
+ 560D59FC21FE22A100553AEC /* libpartialzip-1.0.a */,
+ 560D59FE21FE22A800553AEC /* libplist.a */,
+ 560D5A0021FE22C500553AEC /* libpng16.a */,
+ 560D5A0221FE22D000553AEC /* libssl.a */,
+ 560D5A0421FE22DA00553AEC /* libusbmuxd.a */,
87F574CE1E151F11008D5C4D /* libSystem.tbd */,
87F574CC1E151EF8008D5C4D /* libcorecrypto.tbd */,
- 87F574CA1E151E97008D5C4D /* libfragmentzip.0.dylib */,
87F574C71E151DA6008D5C4D /* libcommonCrypto.tbd */,
- 87F574C51E151D42008D5C4D /* libcrypto.dylib */,
+ 560D5A0621FE22E500553AEC /* libxpwn.a */,
+ 56043D542205BF3A00559249 /* libbz2.a */,
);
name = Frameworks;
sourceTree = "";
@@ -300,6 +363,7 @@
8785873F1D89CFDC008689F0 /* Sources */,
878587401D89CFDC008689F0 /* Frameworks */,
878587411D89CFDC008689F0 /* CopyFiles */,
+ 561C73F621973DC80030617C /* Version bump */,
);
buildRules = (
);
@@ -316,20 +380,20 @@
8785873B1D89CFDC008689F0 /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 0730;
+ LastUpgradeCheck = 1100;
ORGANIZATIONNAME = tihmstar;
TargetAttributes = {
878587421D89CFDC008689F0 = {
CreatedOnToolsVersion = 7.3.1;
+ ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = 8785873E1D89CFDC008689F0 /* Build configuration list for PBXProject "futurerestore" */;
- compatibilityVersion = "Xcode 3.2";
- developmentRegion = English;
+ compatibilityVersion = "Xcode 8.0";
+ developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
- en,
);
mainGroup = 8785873A1D89CFDC008689F0;
productRefGroup = 878587441D89CFDC008689F0 /* Products */;
@@ -341,37 +405,69 @@
};
/* End PBXProject section */
+/* Begin PBXShellScriptBuildPhase section */
+ 561C73F621973DC80030617C /* Version bump */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ );
+ inputPaths = (
+ );
+ name = "Version bump";
+ outputFileListPaths = (
+ );
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "sed -i '.bak' \"s/.*define VERSION_COUNT_FUTURERESTORE.*/#define VERSION_COUNT_FUTURERESTORE \\\"$(git rev-list --count HEAD)\\\"/\" ./futurerestore/config.h 2>/dev/null || sed -i \"s/.*VERSION_COUNT_FUTURERESTORE.*/#define VERSION_COUNT_FUTURERESTORE \\\"$(git rev-list --count HEAD)\\\"/\" ./futurerestore/config.h 2>/dev/null\nsed -i '.bak' \"s/.*define VERSION_SHA_FUTURERESTORE.*/#define VERSION_SHA_FUTURERESTORE \\\"$(git rev-parse HEAD)\\\"/\" ./futurerestore/config.h 2>/dev/null || sed -i \"s/.*VERSION_SHA_FUTURERESTORE.*/#define VERSION_SHA_FUTURERESTORE \\\"$(git rev-parse HEAD)\\\"/\" ./futurerestore/config.h 2>/dev/null\n";
+ };
+/* End PBXShellScriptBuildPhase section */
+
/* Begin PBXSourcesBuildPhase section */
8785873F1D89CFDC008689F0 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- 8788A6831EE8544000138E07 /* jssy.c in Sources */,
+ 56DA634021E3462300821A21 /* ptr_smart.hpp in Sources */,
+ 56520BFB21B1BB14005BD3F7 /* cmain.c in Sources */,
8799B0C11D89DB38002F4D5F /* fls.c in Sources */,
8799B0B41D89DAF6002F4D5F /* tss.c in Sources */,
8799B0C01D89DB38002F4D5F /* fdr.c in Sources */,
8799B0BC1D89DB27002F4D5F /* ipsw.c in Sources */,
+ 56DA634221E3463900821A21 /* helper.h in Sources */,
8799B0CC1D89F7B9002F4D5F /* download.c in Sources */,
+ 560D5A0821FE235D00553AEC /* debug.h in Sources */,
8799B0B91D89DB0D002F4D5F /* img3.c in Sources */,
+ 56DA634121E3462600821A21 /* jssy.hpp in Sources */,
8799B0B51D89DAFF002F4D5F /* common.c in Sources */,
8799B0C41D89DB55002F4D5F /* mbn.c in Sources */,
+ 56043D512205BEC100559249 /* jsmn.c in Sources */,
8799B0B81D89DAFF002F4D5F /* recovery.c in Sources */,
8799B0B31D89DAE7002F4D5F /* idevicerestore.c in Sources */,
8799B0C81D89E2BD002F4D5F /* img4tool.c in Sources */,
8799B0BB1D89DB12002F4D5F /* download.c in Sources */,
+ 56520BEB21B1BA91005BD3F7 /* lzssdec.c in Sources */,
+ 56520BEF21B1BADE005BD3F7 /* endianness.h in Sources */,
8799B0B71D89DAFF002F4D5F /* normal.c in Sources */,
8799B0C31D89DB4B002F4D5F /* socket.c in Sources */,
8799B0C21D89DB46002F4D5F /* thread.c in Sources */,
8799B0B61D89DAFF002F4D5F /* dfu.c in Sources */,
8799B0BD1D89DB27002F4D5F /* limera1n.c in Sources */,
+ 56520BF021B1BAE6005BD3F7 /* limera1n_payload.h in Sources */,
8799B0C51D89DB67002F4D5F /* locking.c in Sources */,
878587471D89CFDC008689F0 /* main.cpp in Sources */,
8799B0BF1D89DB38002F4D5F /* asr.c in Sources */,
+ 56520BFA21B1BB14005BD3F7 /* jssy.c in Sources */,
8799B0BE1D89DB27002F4D5F /* restore.c in Sources */,
8799B0CB1D89F796002F4D5F /* tsschecker.c in Sources */,
8799B0C91D89E2C3002F4D5F /* img4.c in Sources */,
8799B0CA1D89E371002F4D5F /* img4.c in Sources */,
8799B0B21D89D99D002F4D5F /* futurerestore.cpp in Sources */,
+ 56043D502205BEC100559249 /* json_plist.c in Sources */,
+ 56520BFC21B1BB14005BD3F7 /* jssy.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -387,13 +483,23 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
@@ -415,10 +521,24 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- MACOSX_DEPLOYMENT_TARGET = 10.11;
+ HEADER_SEARCH_PATHS = (
+ /opt/local/include,
+ /usr/local/include,
+ /usr/local/opt/openssl/include,
+ );
+ INSTALL_PATH = /usr/local/bin;
+ LIBRARY_SEARCH_PATHS = (
+ /usr/lib,
+ /usr/local/lib,
+ "$(SDKROOT)/usr/lib/system",
+ );
+ MACOSX_DEPLOYMENT_TARGET = 10.12;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
+ PRODUCT_BUNDLE_IDENTIFIER = net.tihmstar.futurerestore;
+ PRODUCT_NAME = futurerestore;
SDKROOT = macosx;
+ USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/external/tsschecker/external/jssy/jssy $(SRCROOT)/external";
};
name = Debug;
};
@@ -431,13 +551,23 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
@@ -453,9 +583,23 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- MACOSX_DEPLOYMENT_TARGET = 10.11;
+ HEADER_SEARCH_PATHS = (
+ /opt/local/include,
+ /usr/local/include,
+ /usr/local/opt/openssl/include,
+ );
+ INSTALL_PATH = /usr/local/bin;
+ LIBRARY_SEARCH_PATHS = (
+ /usr/lib,
+ /usr/local/lib,
+ "$(SDKROOT)/usr/lib/system",
+ );
+ MACOSX_DEPLOYMENT_TARGET = 10.12;
MTL_ENABLE_DEBUG_INFO = NO;
+ PRODUCT_BUNDLE_IDENTIFIER = net.tihmstar.futurerestore;
+ PRODUCT_NAME = futurerestore;
SDKROOT = macosx;
+ USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/external/tsschecker/external/jssy/jssy $(SRCROOT)/external";
};
name = Release;
};
@@ -463,17 +607,25 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = YES;
- HEADER_SEARCH_PATHS = "";
+ CODE_SIGN_IDENTITY = "Apple Development";
+ CODE_SIGN_STYLE = Automatic;
+ DEVELOPMENT_TEAM = "";
+ HEADER_SEARCH_PATHS = (
+ /usr/local/include,
+ /opt/local/include,
+ /usr/local/opt/openssl/include,
+ );
LIBRARY_SEARCH_PATHS = (
/usr/local/lib,
/usr/lib,
- /usr/local/opt/openssl/lib,
"$(SDKROOT)/usr/lib/system",
- /usr/local/Cellar/libzip/1.3.0/lib,
);
+ MACOSX_DEPLOYMENT_TARGET = 10.12;
OTHER_CFLAGS = "-DHAVE_LIBIPATCHER";
+ PRODUCT_BUNDLE_IDENTIFIER = net.tihmstar.futurerestore;
PRODUCT_NAME = "$(TARGET_NAME)";
- USER_HEADER_SEARCH_PATHS = "/usr/local/opt/openssl/include /usr/local/include $(SRCROOT)/external/tsschecker/external/jssy/jssy";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/external/tsschecker/external/jssy/jssy $(SRCROOT)/external";
};
name = Debug;
};
@@ -481,17 +633,25 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = YES;
- HEADER_SEARCH_PATHS = "";
+ CODE_SIGN_IDENTITY = "Apple Development";
+ CODE_SIGN_STYLE = Automatic;
+ DEVELOPMENT_TEAM = "";
+ HEADER_SEARCH_PATHS = (
+ /usr/local/include,
+ /opt/local/include,
+ /usr/local/opt/openssl/include,
+ );
LIBRARY_SEARCH_PATHS = (
/usr/local/lib,
/usr/lib,
- /usr/local/opt/openssl/lib,
"$(SDKROOT)/usr/lib/system",
- /usr/local/Cellar/libzip/1.3.0/lib,
);
+ MACOSX_DEPLOYMENT_TARGET = 10.12;
OTHER_CFLAGS = "-DHAVE_LIBIPATCHER";
+ PRODUCT_BUNDLE_IDENTIFIER = net.tihmstar.futurerestore;
PRODUCT_NAME = "$(TARGET_NAME)";
- USER_HEADER_SEARCH_PATHS = "/usr/local/opt/openssl/include /usr/local/include $(SRCROOT)/external/tsschecker/external/jssy/jssy";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/external/tsschecker/external/jssy/jssy $(SRCROOT)/external";
};
name = Release;
};
diff --git a/futurerestore.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/futurerestore.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
new file mode 100644
index 000000000..18d981003
--- /dev/null
+++ b/futurerestore.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
@@ -0,0 +1,8 @@
+
+
+
+
+ IDEDidComputeMac32BitWarning
+
+
+
diff --git a/futurerestore.xcodeproj/project.xcworkspace/xcuserdata/s0uthwest.xcuserdatad/UserInterfaceState.xcuserstate b/futurerestore.xcodeproj/project.xcworkspace/xcuserdata/s0uthwest.xcuserdatad/UserInterfaceState.xcuserstate
new file mode 100644
index 000000000..b03b2ee21
Binary files /dev/null and b/futurerestore.xcodeproj/project.xcworkspace/xcuserdata/s0uthwest.xcuserdatad/UserInterfaceState.xcuserstate differ
diff --git a/futurerestore.xcodeproj/xcuserdata/s0uthwest.xcuserdatad/xcschemes/xcschememanagement.plist b/futurerestore.xcodeproj/xcuserdata/s0uthwest.xcuserdatad/xcschemes/xcschememanagement.plist
new file mode 100644
index 000000000..19de8b07a
--- /dev/null
+++ b/futurerestore.xcodeproj/xcuserdata/s0uthwest.xcuserdatad/xcschemes/xcschememanagement.plist
@@ -0,0 +1,14 @@
+
+
+
+
+ SchemeUserState
+
+ futurerestore.xcscheme_^#shared#^_
+
+ orderHint
+ 0
+
+
+
+
diff --git a/futurerestore/Makefile.am b/futurerestore/Makefile.am
index 2db56f1a5..bcebfbff9 100644
--- a/futurerestore/Makefile.am
+++ b/futurerestore/Makefile.am
@@ -1,5 +1,5 @@
-AM_CFLAGS = $(libplist_CFLAGS) $(libzip_CFLAGS) $(libimobiledevice_CFLAGS) $(libfragmentzip_CFLAGS) $(libirecovery_CFLAGS) -I$(top_srcdir)/external/tsschecker/external/jssy/jssy -I$(top_srcdir)/external/tsschecker/tsschecker -I$(top_srcdir)/external/img4tool/img4tool -I$(top_srcdir)/external/idevicerestore/src -std=c++11
-AM_LDFLAGS = $(libplist_LIBS) $(libzip_LIBS) $(libimobiledevice_LIBS) $(libfragmentzip_LIBS) $(libirecovery_LIBS)
+AM_CFLAGS = $(libplist_CFLAGS) $(libzip_CFLAGS) $(libimobiledevice_CFLAGS) $(libirecovery_CFLAGS) $(libfragmentzip_CFLAGS) -I$(top_srcdir)/external/tsschecker/external/jssy/jssy -I$(top_srcdir)/external/tsschecker/tsschecker -I$(top_srcdir)/external/img4tool/img4tool -I$(top_srcdir)/external/idevicerestore/src -std=c++11
+AM_LDFLAGS = $(libplist_LIBS) $(libzip_LIBS) $(libimobiledevice_LIBS) $(libirecovery_LIBS) $(libfragmentzip_LIBS)
if HAVE_LIBIPATCHER
AM_LDFLAGS += $(libipatcher_LIBS)
@@ -10,7 +10,7 @@ if WIN32
AM_CFLAGS += -DCURL_STATICLIB
endif
-bin_PROGRAMS = futurerestore
+bin_PROGRAMS = futurerestore
futurerestore_CXXFLAGS = $(AM_CFLAGS)
if WIN32
futurerestore_LDFLAGS = -all-static -static-libgcc -static-libstdc++ $(AM_LDFLAGS)
diff --git a/futurerestore/config.h b/futurerestore/config.h
index d7bbe8a07..acba9d8ad 100644
--- a/futurerestore/config.h
+++ b/futurerestore/config.h
@@ -18,9 +18,9 @@
//idevicerestore config
#define IDEVICERESTORE_NOMAIN
-#undef VERSION_COMMIT_SHA
-#undef VERSION_COMMIT_COUNT
-#define VERSION_COMMIT_COUNT_FUTURERESTORE "undefined version number"
-#define VERSION_COMMIT_SHA_FUTURERESTORE "undefined version commit"
+#undef VERSION_SHA
+#undef VERSION_COUNT
+#define VERSION_COUNT_FUTURERESTORE "undefined number"
+#define VERSION_SHA_FUTURERESTORE "undefined commit"
#endif /* config_h */
diff --git a/futurerestore/futurerestore.cpp b/futurerestore/futurerestore.cpp
index 73e9ad604..353aa20cd 100644
--- a/futurerestore/futurerestore.cpp
+++ b/futurerestore/futurerestore.cpp
@@ -12,11 +12,14 @@
#include
#include
#include
-#include "futurerestore.hpp"
+
#ifdef HAVE_LIBIPATCHER
#include
#endif
+
+#include "futurerestore.hpp"
extern "C"{
+#include
#include "common.h"
#include "../external/img4tool/img4tool/img4.h"
#include "img4tool.h"
@@ -27,11 +30,8 @@ extern "C"{
#include "locking.h"
#include "restore.h"
#include "tsschecker.h"
-#include "all_tsschecker.h"
-#include
}
-
//(re)define __mkdir
#ifdef __mkdir
#undef __mkdir
@@ -74,8 +74,6 @@ extern "C"{
#define safeFree(buf) if (buf) free(buf), buf = NULL
#define safePlistFree(buf) if (buf) plist_free(buf), buf = NULL
-static int zip_test_file(zip_t *za, zip_uint64_t idx, zip_uint64_t size, zip_uint32_t crc);
-
futurerestore::futurerestore(bool isUpdateInstall, bool isPwnDfu) : _isUpdateInstall(isUpdateInstall), _isPwnDfu(isPwnDfu){
_client = idevicerestore_client_new();
if (_client == NULL) throw std::string("could not create idevicerestore client\n");
@@ -92,10 +90,10 @@ bool futurerestore::init(){
if (_didInit) return _didInit;
_didInit = (check_mode(_client) != MODE_UNKNOWN);
if (!(_client->image4supported = is_image4_supported(_client))){
- info("[INFO] 32bit device detected\n");
+ info("[INFO] 32-bit device detected\n");
}else{
- info("[INFO] 64bit device detected\n");
- if (_isPwnDfu) reterror(-90, "isPwnDfu is only allowed for 32bit devices\n");
+ info("[INFO] 64-bit device detected\n");
+ if (_isPwnDfu) reterror(-90, "pwned DFU is only allowed for 32-bit devices\n");
}
return _didInit;
}
@@ -103,9 +101,7 @@ bool futurerestore::init(){
uint64_t futurerestore::getDeviceEcid(){
if (!_didInit) reterror(-1, "did not init\n");
uint64_t ecid;
-
get_ecid(_client, &ecid);
-
return ecid;
}
@@ -131,10 +127,12 @@ void futurerestore::putDeviceIntoRecovery(){
getDeviceMode(false);
info("Found device in %s mode\n", _client->mode->string);
if (_client->mode->index == MODE_NORMAL){
+
#ifdef HAVE_LIBIPATCHER
if (_isPwnDfu)
- reterror(-501, "isPwnDfu enabled, but device was found in normal mode\n");
+ reterror(-501, "pwned DFU enabled, but device was found in normal mode\n");
#endif
+
info("Entering recovery mode...\n");
if (normal_enter_recovery(_client) < 0) {
reterror(-2,"Unable to place device into recovery mode from %s mode\n", _client->mode->string);
@@ -142,23 +140,24 @@ void futurerestore::putDeviceIntoRecovery(){
}else if (_client->mode->index == MODE_RECOVERY){
info("Device already in Recovery mode\n");
}else if (_client->mode->index == MODE_DFU && _isPwnDfu &&
+
#ifdef HAVE_LIBIPATCHER
true
#else
false
#endif
+
){
- info("requesting to get into pwnRecovery later\n");
+ info("requesting to get into pwned DFU later\n");
}else if (!_client->image4supported){
- info("32bit device in DFU mode found, assuming user wants to use iOS9 re-restore bug. Not failing here\n");
+ info("32-bit device in DFU mode found, assuming user wants to use iOS 9.x re-restoring. Not failing here\n");
}else{
- reterror(-3, "unsupported devicemode, please put device in recovery mode or normal mode\n");
+ reterror(-3, "unsupported device mode, please put device in recovery mode or normal mode\n");
}
- //only needs to be freed manually when function did't throw exception
- safeFree(_client->udid);
+ safeFree(_client->udid); // only needs to be freed manually when function did't throw exception
- //these get also freed by destructor
+ // these get also freed by destructor
normal_client_free(_client);
dfu_client_free(_client);
recovery_client_free(_client);
@@ -168,7 +167,7 @@ void futurerestore::setAutoboot(bool val){
if (!_didInit) reterror(-1, "did not init\n");
if (getDeviceMode(false) != MODE_RECOVERY){
- reterror(-2, "can't set autoboot, when device isn't in recovery mode\n");
+ reterror(-2, "can't set auto-boot, when device isn't in recovery mode\n");
}
if (_client->recovery || recovery_client_new(_client) == 0) {
@@ -188,22 +187,21 @@ void futurerestore::exitRecovery() {
plist_t futurerestore::nonceMatchesApTickets(){
if (!_didInit) reterror(-1, "did not init\n");
+
if (getDeviceMode(true) != MODE_RECOVERY){
if (getDeviceMode(false) != MODE_DFU || *_client->version != '9')
- reterror(-10, "Device not in recovery mode, can't check apnonce\n");
+ reterror(-10, "Device isn't in recovery mode, can't check ApNonce\n");
else
- _rerestoreiOS9 = (info("Detected iOS 9 re-restore, proceeding in DFU mode\n"),true);
+ _rerestoreiOS9 = (info("Detected iOS 9.x re-restoring, proceeding in DFU mode\n"),true);
}
-
unsigned char* realnonce;
int realNonceSize = 0;
if (_rerestoreiOS9) {
- info("Skipping APNonce check\n");
+ info("Skipping ApNonce check\n");
}else{
recovery_get_ap_nonce(_client, &realnonce, &realNonceSize);
-
- info("Got APNonce from device: ");
+ info("Got ApNonce from device: ");
int i = 0;
for (i = 0; i < realNonceSize; i++) {
info("%02x ", ((unsigned char *)realnonce)[i]);
@@ -212,7 +210,6 @@ plist_t futurerestore::nonceMatchesApTickets(){
}
vectornonces;
-
if (_client->image4supported){
for (int i=0; i< _im4ms.size(); i++){
if (memcmp(realnonce, (unsigned const char*)getBNCHFromIM4M(_im4ms[i],NULL), realNonceSize) == 0) return _aptickets[i];
@@ -229,25 +226,22 @@ plist_t futurerestore::nonceMatchesApTickets(){
)
)
)
- //either nonce needs to match or using re-restore bug in iOS 9
- return _aptickets[i];
+ return _aptickets[i]; //either ApNonce needs to match or using re-restore bug in iOS 9.x
}
}
-
return NULL;
}
const char *futurerestore::nonceMatchesIM4Ms(){
if (!_didInit) reterror(-1, "did not init\n");
- if (getDeviceMode(true) != MODE_RECOVERY) reterror(-10, "Device not in recovery mode, can't check apnonce\n");
+ if (getDeviceMode(true) != MODE_RECOVERY) reterror(-10, "Device isn't in recovery mode, can't check ApNonce\n");
unsigned char* realnonce;
int realNonceSize = 0;
recovery_get_ap_nonce(_client, &realnonce, &realNonceSize);
vectornonces;
-
if (_client->image4supported) {
for (int i=0; i< _im4ms.size(); i++){
if (memcmp(realnonce, (unsigned const char*)getBNCHFromIM4M(_im4ms[i],NULL), realNonceSize) == 0) return _im4ms[i];
@@ -258,21 +252,17 @@ const char *futurerestore::nonceMatchesIM4Ms(){
}
}
-
return NULL;
}
-
-
void futurerestore::waitForNonce(vectornonces, size_t nonceSize){
if (!_didInit) reterror(-1, "did not init\n");
setAutoboot(false);
-
unsigned char* realnonce;
int realNonceSize = 0;
for (auto nonce : nonces){
- info("waiting for nonce: ");
+ info("waiting for ApNonce: ");
int i = 0;
for (i = 0; i < nonceSize; i++) {
info("%02x ", ((unsigned char *)nonce)[i]);
@@ -287,7 +277,7 @@ void futurerestore::waitForNonce(vectornonces, size_t nonceSize){
usleep(1*USEC_PER_SEC);
}
while (getDeviceMode(true) != MODE_RECOVERY) usleep(USEC_PER_SEC*0.5);
- if (recovery_client_new(_client)) reterror(-4,"Could not connect to device in recovery mode.\n");
+ if (recovery_client_new(_client)) reterror(-4,"Couldn't connect to device in recovery mode.\n");
recovery_get_ap_nonce(_client, &realnonce, &realNonceSize);
info("Got ApNonce from device: ");
@@ -301,17 +291,16 @@ void futurerestore::waitForNonce(vectornonces, size_t nonceSize){
}
} while (_foundnonce == -1);
info("Device has requested ApNonce now\n");
-
setAutoboot(true);
}
+
void futurerestore::waitForNonce(){
if (!_im4ms.size()) reterror(-1, "No IM4M loaded\n");
size_t nonceSize = 0;
vectornonces;
if (!_client->image4supported)
- reterror(-77, "Error: waitForNonce is not supported on 32bit devices\n");
-
+ reterror(-77, "Error: ApNonce collisions isn't supported on 32-bit devices\n");
for (auto im4m : _im4ms){
nonces.push_back(getBNCHFromIM4M(im4m,&nonceSize));
}
@@ -326,7 +315,7 @@ void futurerestore::loadAPTickets(const vector &apticketPaths){
struct stat fst;
if (stat(apticketPath, &fst))
- reterror(-9, "failed to load apticket at %s\n",apticketPath);
+ reterror(-9, "failed to load APTicket at %s\n",apticketPath);
gzFile zf = gzopen(apticketPath, "rb");
if (zf) {
@@ -373,11 +362,11 @@ void futurerestore::loadAPTickets(const vector &apticketPaths){
plist_get_data_val(ticket, &im4m, &im4msize);
if (!im4msize)
- reterror(-38, "Error: failed to load shsh file %s\n",apticketPath);
+ reterror(-38, "Error: failed to load signing ticket %s\n",apticketPath);
_im4ms.push_back(im4m);
_aptickets.push_back(apticket);
- printf("reading ticket %s done\n",apticketPath);
+ printf("reading signing ticket %s is done\n",apticketPath);
}
}
@@ -391,7 +380,7 @@ uint64_t futurerestore::getBasebandGoldCertIDFromDevice(){
plist_t node;
node = plist_dict_get_item(_client->preflight_info, "CertID");
if (!node || plist_get_node_type(node) != PLIST_UINT) {
- error("Unable to find required CertID in in device preflight info\n");
+ error("Unable to find required CertID in device preflight info\n");
return 0;
}
uint64_t val = 0;
@@ -433,7 +422,6 @@ char *futurerestore::getiBootBuild(){
return _ibootBuild;
}
-
pair, size_t> getIPSWComponent(struct idevicerestore_client_t* client, plist_t build_identity, string component){
ptr_smart path;
unsigned char* component_data = NULL;
@@ -452,20 +440,19 @@ pair, size_t> getIPSWComponent(struct idevicerestore_client_t*
return {(char*)component_data,component_size};
}
-
void futurerestore::enterPwnRecovery(plist_t build_identity, string bootargs){
#ifndef HAVE_LIBIPATCHER
reterror(-404, "compiled without libipatcher");
#else
+
int mode = 0;
libipatcher::fw_key iBSSKeys;
libipatcher::fw_key iBECKeys;
if (dfu_client_new(_client) < 0)
- reterror(-91,"Unable to connect to DFU device\n");
+ reterror(-91,"Unable to connect to DFU mode\n");
irecv_get_mode(_client->dfu->client, &mode);
-
try {
iBSSKeys = libipatcher::getFirmwareKey(_client->device->product_type, _client->build, "iBSS");
iBECKeys = libipatcher::getFirmwareKey(_client->device->product_type, _client->build, "iBEC");
@@ -474,23 +461,21 @@ void futurerestore::enterPwnRecovery(plist_t build_identity, string bootargs){
reterror(e.code(), "getting keys failed. Are keys publicly available?");
}
-
auto iBSS = getIPSWComponent(_client, build_identity, "iBSS");
iBSS = move(libipatcher::patchiBSS((char*)iBSS.first, iBSS.second, iBSSKeys));
-
auto iBEC = getIPSWComponent(_client, build_identity, "iBEC");
iBEC = move(libipatcher::patchiBEC((char*)iBEC.first, iBEC.second, iBECKeys, bootargs));
bool modeIsRecovery = false;
if (mode != IRECV_K_DFU_MODE) {
- info("NOTE: device is not in DFU mode, assuming pwn recovery mode.\n");
+ info("NOTE: device isn't in DFU mode, assuming pwned DFU mode.\n");
for (int i=IRECV_K_RECOVERY_MODE_1; i<=IRECV_K_RECOVERY_MODE_4; i++) {
if (mode == i)
modeIsRecovery = true;
}
if (!modeIsRecovery)
- reterror(-505, "device not in recovery mode\n");
+ reterror(-505, "device isn't in recovery mode\n");
}else{
info("Sending %s (%lu bytes)...\n", "iBSS", iBSS.second);
// FIXME: Did I do this right????
@@ -510,9 +495,7 @@ void futurerestore::enterPwnRecovery(plist_t build_identity, string bootargs){
reterror(-92,"ERROR: set configuration failed\n");
}
- /* send iBEC */
info("Sending %s (%lu bytes)...\n", "iBEC", iBEC.second);
- // FIXME: Did I do this right????
irecv_error_t err = irecv_send_buffer(_client->dfu->client, (unsigned char*)(char*)iBEC.first, (unsigned long)iBEC.second, 1);
if (err != IRECV_E_SUCCESS) {
reterror(-92,"ERROR: Unable to send %s component: %s\n", "iBSS", irecv_strerror(err));
@@ -522,7 +505,6 @@ void futurerestore::enterPwnRecovery(plist_t build_identity, string bootargs){
}
dfu_client_free(_client);
-
sleep(7);
// Reconnect to device, but this time make sure we're not still in DFU mode
@@ -550,6 +532,7 @@ void get_custom_component(struct idevicerestore_client_t* client, plist_t build_
#ifndef HAVE_LIBIPATCHER
reterror(-404, "compiled without libipatcher");
#else
+
try {
auto comp = getIPSWComponent(client, build_identity, component);
comp = move(libipatcher::decryptFile3((char*)comp.first, comp.second, libipatcher::getFirmwareKey(client->device->product_type, client->build, component)));
@@ -563,7 +546,6 @@ void get_custom_component(struct idevicerestore_client_t* client, plist_t build_
#endif
}
-
int futurerestore::doRestore(const char *ipsw){
#undef reterror
#define reterror(code, msg ...) { \
@@ -573,11 +555,9 @@ int futurerestore::doRestore(const char *ipsw){
} \
throw int(code); \
}
-
+ // some memory might not get freed if this function throws an exception, but you probably don't want to catch that anyway.
int err = 0;
bool canExitRecovery = false;
- //some memory might not get freed if this function throws an exception, but you probably don't want to catch that anyway.
-
struct idevicerestore_client_t* client = _client;
int unused;
int result = 0;
@@ -586,77 +566,66 @@ int futurerestore::doRestore(const char *ipsw){
plist_t buildmanifest = NULL;
plist_t build_identity = NULL;
plist_t sep_build_identity = NULL;
-
client->ipsw = strdup(ipsw);
+
if (!_isUpdateInstall) client->flags |= FLAG_ERASE;
else if (_enterPwnRecoveryRequested){
- reterror(577, "ERROR: Update install is not supported in pwnDFU mode\n");
+ reterror(577, "ERROR: Update install isn't supported in pwned DFU mode\n");
}
getDeviceMode(true);
info("Found device in %s mode\n", client->mode->string);
if (client->mode->index != MODE_RECOVERY && client->mode->index != MODE_DFU && !_enterPwnRecoveryRequested)
- reterror(-6, "device not in recovery mode\n");
- // discover the device type
+ reterror(-6, "device isn't in recovery mode\n");
client->device = get_irecv_device(client);
if (client->device == NULL) {
reterror(-2,"ERROR: Unable to discover device type\n");
}
info("Identified device as %s, %s\n", client->device->hardware_model, client->device->product_type);
-
canExitRecovery = true;
- // verify if ipsw file exists
+ // verify if iPSW file exists
if (access(client->ipsw, F_OK) < 0) {
- error("ERROR: Firmware file %s does not exist.\n", client->ipsw);
+ error("ERROR: Firmware file %s doesn't exist.\n", client->ipsw);
return -1;
}
- info("Extracting BuildManifest from IPSW\n");
+ info("Extracting BuildManifest from iPSW\n");
if (ipsw_extract_build_manifest(client->ipsw, &buildmanifest, &unused) < 0) {
reterror(-3,"ERROR: Unable to extract BuildManifest from %s. Firmware file might be corrupt.\n", client->ipsw);
}
- /* check if device type is supported by the given build manifest */
if (build_manifest_check_compatibility(buildmanifest, client->device->product_type) < 0) {
- reterror(-4,"ERROR: Could not make sure this firmware is suitable for the current device. Refusing to continue.\n");
+ reterror(-4,"ERROR: Couldn't make sure this firmware is suitable for the current device. Refusing to continue.\n");
}
- /* print iOS information from the manifest */
build_manifest_get_version_information(buildmanifest, client);
-
- info("Product Version: %s\n", client->version);
- info("Product Build: %s Major: %d\n", client->build, client->build_major);
-
+ info("Product version: %s\n", client->version);
+ info("Product build: %s Major: %d\n", client->build, client->build_major);
client->image4supported = is_image4_supported(client);
- info("Device supports Image4: %s\n", (client->image4supported) ? "true" : "false");
+ info("Device supports IMG4: %s\n", (client->image4supported) ? "true" : "false");
- if (_enterPwnRecoveryRequested) //we are in pwnDFU, so we don't need to check nonces
+ if (_enterPwnRecoveryRequested) // we're in pwned DFU, so we don't need to check nonces
client->tss = _aptickets.at(0);
else if (!(client->tss = nonceMatchesApTickets()))
- reterror(-20, "Devicenonce does not match APTicket nonce\n");
+ reterror(-20, "Device ApNonce doesn't match APTicket nonce\n");
plist_dict_remove_item(client->tss, "BBTicket");
plist_dict_remove_item(client->tss, "BasebandFirmware");
if (!(build_identity = getBuildidentityWithBoardconfig(buildmanifest, client->device->hardware_model, _isUpdateInstall)))
- reterror(-5,"ERROR: Unable to find any build identities for IPSW\n");
-
+ reterror(-5,"ERROR: Unable to find any build identities for iPSW\n");
if (_client->image4supported && !(sep_build_identity = getBuildidentityWithBoardconfig(_sepbuildmanifest, client->device->hardware_model, _isUpdateInstall)))
reterror(-5,"ERROR: Unable to find any build identities for SEP\n");
-
- //this is the buildidentity used for restore
- plist_t manifest = plist_dict_get_item(build_identity, "Manifest");
+ plist_t manifest = plist_dict_get_item(build_identity, "Manifest"); // this is the buildidentity used for restore
printf("checking APTicket to be valid for this restore...\n");
- //if we are in pwnDFU, just use first apticket. no need to check nonces
- const char * im4m = (_enterPwnRecoveryRequested || _rerestoreiOS9) ? _im4ms.at(0) : nonceMatchesIM4Ms();
+ const char * im4m = (_enterPwnRecoveryRequested || _rerestoreiOS9) ? _im4ms.at(0) : nonceMatchesIM4Ms(); // NOTE: if we're in pwned DFU, just use first ApTicket. No need to check nonces.
uint64_t deviceEcid = getDeviceEcid();
uint64_t im4mEcid = (_client->image4supported) ? getEcidFromIM4M(im4m) : getEcidFromSCAB(im4m);
if (!im4mEcid)
reterror(-46, "Failed to read ECID from APTicket\n");
-
if (im4mEcid != deviceEcid) {
- error("ECID inside APTicket does not match device ECID\n");
+ error("ECID inside APTicket doesn't match device ECID\n");
printf("APTicket is valid for %16llu (dec) but device is %16llu (dec)\n",im4mEcid,deviceEcid);
reterror(-45, "APTicket can't be used for restoring this device\n");
}else
@@ -665,46 +634,42 @@ int futurerestore::doRestore(const char *ipsw){
if (_client->image4supported) {
printf("checking APTicket to be valid for this restore...\n");
const char * im4m = nonceMatchesIM4Ms();
-
uint64_t deviceEcid = getDeviceEcid();
uint64_t im4mEcid = (_client->image4supported) ? getEcidFromIM4M(im4m) : getEcidFromSCAB(im4m);
if (!im4mEcid)
reterror(-46, "Failed to read ECID from APTicket\n");
-
if (im4mEcid != deviceEcid) {
- error("ECID inside APTicket does not match device ECID\n");
+ error("ECID inside APTicket doesn't match device ECID\n");
printf("APTicket is valid for %16llu (dec) but device is %16llu (dec)\n",im4mEcid,deviceEcid);
reterror(-45, "APTicket can't be used for restoring this device\n");
}else
printf("Verified ECID in APTicket matches device ECID\n");
plist_t ticketIdentity = getBuildIdentityForIM4M(im4m, buildmanifest);
- //TODO: make this nicer!
- //for now a simple pointercompare should be fine, because both plist_t should point into the same buildidentity inside the buildmanifest
+ /* TO-DO: make this nicer! For now a simple pointercompare should be fine, because both plist_t should point into the same buildidentity inside the buildmanifest */
if (ticketIdentity != build_identity ){
- error("BuildIdentity selected for restore does not match APTicket\n\n");
+ error("BuildIdentity selected for restore doesn't match APTicket\n\n");
printf("BuildIdentity selected for restore:\n");
printGeneralBuildIdentityInformation(build_identity);
printf("\nBuildIdentiy valid for the APTicket:\n");
if (ticketIdentity) printGeneralBuildIdentityInformation(ticketIdentity),putchar('\n');
else{
- printf("IM4M is not valid for any restore within the Buildmanifest\n");
+ printf("IM4M isn't valid for any restore with this BuildManifest\n");
printf("This APTicket can't be used for restoring this firmware\n");
}
reterror(-44, "APTicket can't be used for this restore\n");
}else{
if (verifyIM4MSignature(im4m)){
- printf("IM4M signature is not valid!\n");
+ printf("IM4M signature isn't valid!\n");
reterror(-44, "APTicket can't be used for this restore\n");
}
printf("Verified APTicket to be valid for this restore\n");
}
}else if (_enterPwnRecoveryRequested){
- info("[WARNING] skipping ramdisk hash check, since device is in pwnDFU according to user\n");
-
+ info("[WARNING] skipping ramdisk hash check, since device is in pwned DFU according to user\n");
}else{
- info("[WARNING] full buildidentity check is not implemented, only comparing ramdisk hash.\n");
+ info("[WARNING] full buildidentity check isn't implemented, only comparing ramdisk hash.\n");
size_t tickethashSize = 0;
const char *tickethash = getRamdiskHashFromSCAB(im4m, &tickethashSize);
uint64_t manifestDigestSize = 0;
@@ -712,42 +677,38 @@ int futurerestore::doRestore(const char *ipsw){
plist_t restoreRamdisk = plist_dict_get_item(manifest, "RestoreRamDisk");
plist_t digest = plist_dict_get_item(restoreRamdisk, "Digest");
-
plist_get_data_val(digest, &manifestDigest, &manifestDigestSize);
-
if (tickethashSize == manifestDigestSize && memcmp(tickethash, manifestDigest, tickethashSize) == 0){
printf("Verified APTicket to be valid for this restore\n");
free(manifestDigest);
}else{
free(manifestDigest);
- printf("APTicket ramdisk hash does not match the ramdisk we are trying to boot. Are you using correct install type (Update/Erase)?\n");
+ printf("APTicket ramdisk hash doesn't match the ramdisk we're trying to boot. Are you using correct install type (Update/Erase)?\n");
reterror(-44, "APTicket can't be used for this restore\n");
}
}
-
if (_basebandbuildmanifest){
if (!(client->basebandBuildIdentity = getBuildidentityWithBoardconfig(_basebandbuildmanifest, client->device->hardware_model, _isUpdateInstall))){
if (!(client->basebandBuildIdentity = getBuildidentityWithBoardconfig(_basebandbuildmanifest, client->device->hardware_model, !_isUpdateInstall))) {
- reterror(-5, "ERROR: Unable to find any build identities for Baseband\n");
+ reterror(-5, "ERROR: Unable to find any buildidentities for Baseband\n");
} else {
info("[WARNING] Unable to find Baseband buildidentities for restore type %s, using fallback %s\n",
(_isUpdateInstall) ? "Update" : "Erase", (!_isUpdateInstall) ? "Update" : "Erase");
}
}
-
- client->bbfwtmp = (char*)_basebandPath;
+ client->bbfwtmp = (char*)_basebandPath;
plist_t bb_manifest = plist_dict_get_item(client->basebandBuildIdentity, "Manifest");
plist_t bb_baseband = plist_copy(plist_dict_get_item(bb_manifest, "BasebandFirmware"));
plist_dict_set_item(manifest, "BasebandFirmware", bb_baseband);
if (!_client->basebandBuildIdentity)
- reterror(-55, "BasebandBuildIdentity not loaded, refusing to continue");
- }else{
- warning("WARNING: we don't have a basebandbuildmanifest, not flashing baseband!\n");
- }
+ reterror(-55, "BasebandBuildIdentity isn't loaded, refusing to continue");
+ }else{
+ warning("WARNING: we don't have a basebandbuildmanifest, not flashing baseband!\n");
+ }
if (_client->image4supported) {
plist_t sep_manifest = plist_dict_get_item(sep_build_identity, "Manifest");
@@ -759,29 +720,26 @@ int futurerestore::doRestore(const char *ipsw){
uint64_t sephashlen = 0;
plist_t digest = plist_dict_get_item(sep_sep, "Digest");
if (!digest || plist_get_node_type(digest) != PLIST_DATA)
- reterror(-66, "ERROR: can't find sep digest\n");
+ reterror(-66, "ERROR: can't find SEP digest\n");
plist_get_data_val(digest, reinterpret_cast(&sephash), &sephashlen);
-
if (sephashlen == 20)
SHA1((unsigned char*)_client->sepfwdata, (unsigned int)_client->sepfwdatasize, genHash);
else
SHA384((unsigned char*)_client->sepfwdata, (unsigned int)_client->sepfwdatasize, genHash);
if (memcmp(genHash, sephash, sephashlen))
- reterror(-67, "ERROR: SEP does not match sepmanifest\n");
+ reterror(-67, "ERROR: SEP doesn't match SEPManifest\n");
}
- /* print information about current build identity */
build_identity_print_information(build_identity);
- //check for enterpwnrecovery, because we could be in DFU mode
+ // check for pwned DFU, because we could be in DFU mode
if (_enterPwnRecoveryRequested){
if (getDeviceMode(true) != MODE_DFU)
reterror(-6, "unexpected device mode\n");
enterPwnRecovery(build_identity);
}
-
// Get filesystem name from build identity
char* fsname = NULL;
if (build_identity_get_component_path(build_identity, "OS", &fsname) < 0) {
@@ -818,7 +776,7 @@ int futurerestore::doRestore(const char *ipsw){
memset(&st, '\0', sizeof(struct stat));
if (stat(tmpf, &st) == 0) {
- off_t fssize = 0;
+ uint64_t fssize = 0;
ipsw_get_file_size(client->ipsw, fsname, &fssize);
if ((fssize > 0) && (st.st_size == fssize)) {
info("Using cached filesystem from '%s'\n", tmpf);
@@ -856,10 +814,10 @@ int futurerestore::doRestore(const char *ipsw){
}
remove(lockfn);
- // Extract filesystem from IPSW
- info("Extracting filesystem from IPSW\n");
+ // Extract filesystem from iPSW
+ info("Extracting filesystem from iPSW\n");
if (ipsw_extract_to_file_with_progress(client->ipsw, fsname, filesystem, 1) < 0) {
- reterror(-7,"ERROR: Unable to extract filesystem from IPSW\n");
+ reterror(-7,"ERROR: Unable to extract filesystem from iPSW\n");
}
if (strstr(filesystem, ".extract")) {
@@ -884,7 +842,6 @@ int futurerestore::doRestore(const char *ipsw){
sleep(2);
dfu_client_new(client);
- /* send iBEC */
if (dfu_send_component(client, build_identity, "iBEC") < 0) {
error("ERROR: Unable to send iBEC to device\n");
irecv_close(client->dfu->client);
@@ -894,7 +851,6 @@ int futurerestore::doRestore(const char *ipsw){
}else{
if ((client->build_major > 8)) {
if (!client->image4supported) {
- /* send ApTicket */
if (recovery_send_ticket(client) < 0) {
error("WARNING: Unable to send APTicket\n");
}
@@ -902,23 +858,19 @@ int futurerestore::doRestore(const char *ipsw){
}
}
-
-
- if (_enterPwnRecoveryRequested){ //if pwnrecovery send all components decrypted, unless we're dealing with iOS 10
+ if (_enterPwnRecoveryRequested){ // if pwned DFU send all components decrypted, unless we're dealing with iOS 10
if (strncmp(client->version, "10.", 3))
client->recovery_custom_component_function = get_custom_component;
}else if (!_rerestoreiOS9){
- /* now we load the iBEC */
if (recovery_send_ibec(client, build_identity) < 0) {
reterror(-8,"ERROR: Unable to send iBEC\n");
}
printf("waiting for device to reconnect... ");
recovery_client_free(client);
- /* this must be long enough to allow the device to run the iBEC */
- /* FIXME: Probably better to detect if the device is back then */
+ /* this must be long enough to allow the device to run the iBEC
+ FIXME: Probably better to detect if the device is back then */
sleep(7);
}
-
for (int i=0;getDeviceMode(true) != MODE_RECOVERY && i<40; i++) putchar('.'),usleep(USEC_PER_SEC*0.5);
putchar('\n');
@@ -929,12 +881,10 @@ int futurerestore::doRestore(const char *ipsw){
//do magic
if (_client->image4supported) get_sep_nonce(client, &client->sepnonce, &client->sepnonce_size);
get_ap_nonce(client, &client->nonce, &client->nonce_size);
-
get_ecid(client, &client->ecid);
-
if (client->mode->index == MODE_RECOVERY) {
if (client->srnm == NULL) {
- reterror(-9,"ERROR: could not retrieve device serial number. Can't continue.\n");
+ reterror(-9,"ERROR: couldn't retrieve device serial number. Can't continue.\n");
}
if (irecv_send_command(client->recovery->client, "bgcolor 0 255 0") != IRECV_E_SUCCESS) {
error("ERROR: Unable to set bgcolor\n");
@@ -949,18 +899,13 @@ int futurerestore::doRestore(const char *ipsw){
recovery_client_free(client);
}
-
if (_client->image4supported && get_tss_response(client, sep_build_identity, &client->septss) < 0) {
- reterror(-11,"ERROR: Unable to get SHSH blobs for SEP\n");
+ reterror(-11,"ERROR: Unable to get signing tickets for SEP\n");
}
-
-
if (_client->image4supported && (!_client->sepfwdatasize || !_client->sepfwdata))
reterror(-55, "SEP not loaded, refusing to continue");
-
-
if (client->mode->index == MODE_RESTORE) {
info("About to restore device... \n");
canExitRecovery = false;
@@ -972,7 +917,6 @@ int futurerestore::doRestore(const char *ipsw){
info("Cleaning up...\n");
-
error:
safeFree(client->sepfwdata);
safePlistFree(buildmanifest);
@@ -985,22 +929,20 @@ int futurerestore::doRestore(const char *ipsw){
}
int futurerestore::doJustBoot(const char *ipsw, string bootargs){
- int err = 0;
//some memory might not get freed if this function throws an exception, but you probably don't want to catch that anyway.
-
+ int err = 0;
struct idevicerestore_client_t* client = _client;
int unused;
int result = 0;
plist_t buildmanifest = NULL;
plist_t build_identity = NULL;
-
client->ipsw = strdup(ipsw);
getDeviceMode(true);
info("Found device in %s mode\n", client->mode->string);
if (!(client->mode->index == MODE_DFU || client->mode->index == MODE_RECOVERY) || !_enterPwnRecoveryRequested)
- reterror(-6, "device not in DFU/Recovery mode\n");
+ reterror(-6, "device isn't in DFU/Recovery mode\n");
// discover the device type
client->device = get_irecv_device(client);
if (client->device == NULL) {
@@ -1008,39 +950,31 @@ int futurerestore::doJustBoot(const char *ipsw, string bootargs){
}
info("Identified device as %s, %s\n", client->device->hardware_model, client->device->product_type);
- // verify if ipsw file exists
+ // verify if iPSW file exists
if (access(client->ipsw, F_OK) < 0) {
- error("ERROR: Firmware file %s does not exist.\n", client->ipsw);
+ error("ERROR: Firmware file %s doesn't exist.\n", client->ipsw);
return -1;
}
- info("Extracting BuildManifest from IPSW\n");
+ info("Extracting BuildManifest from iPSW\n");
if (ipsw_extract_build_manifest(client->ipsw, &buildmanifest, &unused) < 0) {
reterror(-3,"ERROR: Unable to extract BuildManifest from %s. Firmware file might be corrupt.\n", client->ipsw);
}
- /* check if device type is supported by the given build manifest */
if (build_manifest_check_compatibility(buildmanifest, client->device->product_type) < 0) {
- reterror(-4,"ERROR: Could not make sure this firmware is suitable for the current device. Refusing to continue.\n");
+ reterror(-4,"ERROR: Couldn't make sure this firmware is suitable for the current device. Refusing to continue.\n");
}
- /* print iOS information from the manifest */
build_manifest_get_version_information(buildmanifest, client);
-
- info("Product Version: %s\n", client->version);
- info("Product Build: %s Major: %d\n", client->build, client->build_major);
-
+ info("Product version: %s\n", client->version);
+ info("Product build: %s Major: %d\n", client->build, client->build_major);
client->image4supported = is_image4_supported(client);
- info("Device supports Image4: %s\n", (client->image4supported) ? "true" : "false");
+ info("Device supports IMG4: %s\n", (client->image4supported) ? "true" : "false");
if (!(build_identity = getBuildidentityWithBoardconfig(buildmanifest, client->device->hardware_model, 0)))
- reterror(-5,"ERROR: Unable to find any build identities for IPSW\n");
-
-
- /* print information about current build identity */
+ reterror(-5,"ERROR: Unable to find any build identities for iPSW\n");
build_identity_print_information(build_identity);
-
- //check for enterpwnrecovery, because we could be in DFU mode
+ // check for pwned DFU, because we could be in DFU mode
if (!_enterPwnRecoveryRequested)
- reterror(-6, "enterPwnRecoveryRequested is not set, but required");
+ reterror(-6, "Device isn't in pwned DFU mode\n");
if (getDeviceMode(true) != MODE_DFU && getDeviceMode(false) != MODE_RECOVERY)
reterror(-6, "unexpected device mode\n");
@@ -1050,25 +984,22 @@ int futurerestore::doJustBoot(const char *ipsw, string bootargs){
for (int i=0;getDeviceMode(true) != MODE_RECOVERY && i<40; i++) putchar('.'),usleep(USEC_PER_SEC*0.5);
putchar('\n');
-
if (!check_mode(client))
reterror(-15, "failed to reconnect to device in recovery (iBEC) mode\n");
get_ecid(client, &client->ecid);
-
client->flags |= FLAG_BOOT;
-
if (client->mode->index == MODE_RECOVERY) {
if (client->srnm == NULL) {
- reterror(-9,"ERROR: could not retrieve device serial number. Can't continue.\n");
+ reterror(-9,"ERROR: couldn't retrieve device serial number. Can't continue.\n");
}
if (irecv_send_command(client->recovery->client, "bgcolor 0 255 0") != IRECV_E_SUCCESS) {
error("ERROR: Unable to set bgcolor\n");
return -1;
}
info("[WARNING] Setting bgcolor to green! If you don't see a green screen, then your device didn't boot iBEC correctly\n");
- sleep(2); //show the user a green screen!
- client->image4supported = true; //dirty hack to not require apticket
+ sleep(2);
+ client->image4supported = true; // dirty hack to not require ApTicket
if (recovery_enter_restore(client, build_identity) < 0) {
reterror(-10,"ERROR: Unable to place device into restore mode\n");
}
@@ -1107,7 +1038,7 @@ futurerestore::~futurerestore(){
void futurerestore::loadFirmwareTokens(){
if (!_firmwareTokens){
if (!_firmwareJson) _firmwareJson = getFirmwareJson();
- if (!_firmwareJson) reterror(-6,"[TSSC] could not get firmware.json\n");
+ if (!_firmwareJson) reterror(-6,"[TSSC] couldn't get firmware.json\n");
int cnt = parseTokens(_firmwareJson, &_firmwareTokens);
if (cnt < 1) reterror(-2,"[TSSC] parsing %s.json failed\n",(0) ? "ota" : "firmware");
}
@@ -1115,7 +1046,6 @@ void futurerestore::loadFirmwareTokens(){
irecv_device_t futurerestore::loadDeviceInfo(){
if (!_client->device || !_client->device->product_type){
-
int mode = getDeviceMode(true);
if (mode != MODE_NORMAL && mode != MODE_RECOVERY && mode != MODE_DFU)
reterror(-20, "unexpected device mode=%d\n",mode);
@@ -1156,10 +1086,10 @@ char *futurerestore::getLatestManifest(){
ptr_smartautofree(versVals.version);
__latestFirmwareUrl = getFirmwareUrl(device, &versVals, _firmwareTokens);
- if (!__latestFirmwareUrl) reterror(-21, "could not find url of latest firmware\n");
+ if (!__latestFirmwareUrl) reterror(-21, "couldn't find URL of latest firmware\n");
__latestManifest = getBuildManifest(__latestFirmwareUrl, device, versVals.version, versVals.buildID, 0);
- if (!__latestManifest) reterror(-22, "could not get buildmanifest of latest firmware\n");
+ if (!__latestManifest) reterror(-22, "couldn't get buildmanifest of latest firmware\n");
}
return __latestManifest;
@@ -1172,11 +1102,12 @@ char *futurerestore::getLatestFirmwareUrl(){
void futurerestore::loadLatestBaseband(){
char *manifeststr = getLatestManifest();
char *pathStr = getPathOfElementInManifest("BasebandFirmware", manifeststr, _client, 0);
- info("downloading Baseband\n\n");
+ info("downloading baseband\n\n");
if (downloadPartialzip(getLatestFirmwareUrl(), pathStr, _basebandPath = BASEBAND_TMP_PATH))
- reterror(-32, "could not download baseband\n");
+ reterror(-32, "couldn't download baseband\n");
saveStringToFile(manifeststr, BASEBAND_MANIFEST_TMP_PATH);
- setBasebandPath(BASEBAND_TMP_PATH, BASEBAND_MANIFEST_TMP_PATH);
+ setBasebandPath(BASEBAND_TMP_PATH);
+ setBasebandManifestPath(BASEBAND_MANIFEST_TMP_PATH);
}
void futurerestore::loadLatestSep(){
@@ -1184,133 +1115,50 @@ void futurerestore::loadLatestSep(){
char *pathStr = getPathOfElementInManifest("SEP", manifeststr, _client, 0);
info("downloading SEP\n\n");
if (downloadPartialzip(getLatestFirmwareUrl(), pathStr, SEP_TMP_PATH))
- reterror(-33, "could not download SEP\n");
+ reterror(-33, "couldn't download SEP\n");
+ loadSep(SEP_TMP_PATH);
saveStringToFile(manifeststr, SEP_MANIFEST_TMP_PATH);
- loadSep(SEP_TMP_PATH, SEP_MANIFEST_TMP_PATH);
-}
-
-void futurerestore::loadSepFromIpsw(const char *ipswPath) {
- irecv_device_t device = loadDeviceInfo();
- char *buildManifestString = nullptr;
- uint32_t buildManifestSize;
- plist_t buildIdentity = nullptr;
- char *path = nullptr;
- int unused;
-
- info("Extracting SEP from IPSW...\n");
- if (ipsw_extract_build_manifest(ipswPath, &_sepbuildmanifest, &unused) < 0) {
- reterror(-3, "ERROR: Unable to extract BuildManifest from %s. Firmware file might be corrupt.\n", ipswPath);
- }
- if (build_manifest_check_compatibility(_sepbuildmanifest, device->product_type) < 0) {
- reterror(-4, "ERROR: Could not make sure this firmware is suitable for the current device. Refusing to continue.\n");
- }
- if (!(buildIdentity = getBuildidentityWithBoardconfig(_sepbuildmanifest, device->hardware_model, _isUpdateInstall))) {
- reterror(-5, "ERROR: Unable to find any build identities in IPSW\n");
- }
- if (build_identity_get_component_path(buildIdentity, "SEP", &path) < 0) {
- reterror(-6, "ERROR: Failed to find SEP component path\n");
- }
- if (extract_component(ipswPath, path,
- reinterpret_cast(&_client->sepfwdata),
- reinterpret_cast(&_client->sepfwdatasize)) < 0) {
- reterror(-7, "ERROR: Failed to extract SEP from IPSW\n");
- }
-
- plist_to_xml(_sepbuildmanifest, &buildManifestString, &buildManifestSize);
- saveStringToFile(buildManifestString, SEP_MANIFEST_TMP_PATH);
- _sepbuildmanifestPath = SEP_MANIFEST_TMP_PATH;
- info("Extracted SEP with size %lu\n", _client->sepfwdatasize);
-
- free(buildManifestString);
- free(path);
-}
-
-void futurerestore::loadBasebandFromIpsw(const char *ipswPath) {
- irecv_device_t device = loadDeviceInfo();
- char *buildManifestString = nullptr;
- uint32_t buildManifestSize;
- plist_t buildIdentity = nullptr;
- char *path = nullptr;
- int unused;
- uint8_t *basebandFirmware;
- uint32_t basebandFirmwareSize;
-
- info("Extracting baseband from IPSW...\n");
- if (ipsw_extract_build_manifest(ipswPath, &_basebandbuildmanifest, &unused) < 0) {
- reterror(-3, "ERROR: Unable to extract BuildManifest from %s. Firmware file might be corrupt.\n", ipswPath);
- }
- if (build_manifest_check_compatibility(_basebandbuildmanifest, device->product_type) < 0) {
- reterror(-4, "ERROR: Could not make sure this firmware is suitable for the current device. Refusing to continue.\n");
- }
- if (!(buildIdentity = getBuildidentityWithBoardconfig(_basebandbuildmanifest, device->hardware_model, _isUpdateInstall))) {
- reterror(-5, "ERROR: Unable to find any build identities in IPSW\n");
- }
- if (build_identity_get_component_path(buildIdentity, "BasebandFirmware", &path) < 0) {
- reterror(-6, "ERROR: Failed to find BasebandFirmware component path\n");
- }
- if (extract_component(ipswPath, path, &basebandFirmware, &basebandFirmwareSize) < 0) {
- reterror(-7, "ERROR: Failed to extract BasebandFirmware from IPSW\n");
- }
- FILE *basebandFile = fopen(BASEBAND_TMP_PATH, "wb");
- if (!basebandFile || fwrite(basebandFirmware, 1, basebandFirmwareSize, basebandFile) != basebandFirmwareSize) {
- reterror(-8, "ERROR: Failed to write baseband firmware to temporary file\n");
- }
- fclose(basebandFile);
-
- plist_to_xml(_basebandbuildmanifest, &buildManifestString, &buildManifestSize);
- saveStringToFile(buildManifestString, BASEBAND_MANIFEST_TMP_PATH);
- info("Extracted BasebandFirmware with size %d\n", basebandFirmwareSize);
- setBasebandPath(BASEBAND_TMP_PATH, BASEBAND_MANIFEST_TMP_PATH);
-
- free(basebandFirmware);
- free(buildManifestString);
+ setSepManifestPath(SEP_MANIFEST_TMP_PATH);
}
-void futurerestore::loadSep(const char *sepPath, const char *sepManifestPath) {
+void futurerestore::setSepManifestPath(const char *sepManifestPath){
if (!(_sepbuildmanifest = loadPlistFromFile(_sepbuildmanifestPath = sepManifestPath)))
reterror(-14, "failed to load SEPManifest");
+}
+void futurerestore::setBasebandManifestPath(const char *basebandManifestPath){
+ if (!(_basebandbuildmanifest = loadPlistFromFile(_basebandbuildmanifestPath = basebandManifestPath)))
+ reterror(-14, "failed to load BasebandManifest");
+};
+
+void futurerestore::loadSep(const char *sepPath){
FILE *fsep = fopen(sepPath, "rb");
if (!fsep)
reterror(-15, "failed to read SEP\n");
-
+
fseek(fsep, 0, SEEK_END);
- _client->sepfwdatasize = static_cast(ftell(fsep));
+ _client->sepfwdatasize = ftell(fsep);
fseek(fsep, 0, SEEK_SET);
-
- if (!(_client->sepfwdata = (char *) malloc(_client->sepfwdatasize)))
+
+ if (!(_client->sepfwdata = (char*)malloc(_client->sepfwdatasize)))
reterror(-15, "failed to malloc memory for SEP\n");
-
- size_t freadRet = 0;
+
+ size_t freadRet=0;
if ((freadRet = fread(_client->sepfwdata, 1, _client->sepfwdatasize, fsep)) != _client->sepfwdatasize)
- reterror(-15, "failed to load SEP. size=%zu but fread returned %zu\n", _client->sepfwdatasize, freadRet);
-
+ reterror(-15, "failed to load SEP. size=%zu but fread returned %zu\n",_client->sepfwdatasize,freadRet);
+
fclose(fsep);
}
-void futurerestore::setBasebandPath(const char *basebandPath, const char *basebandManifestPath) {
- if (!(_basebandbuildmanifest = loadPlistFromFile(_basebandbuildmanifestPath = basebandManifestPath)))
- reterror(-14, "failed to load BasebandManifest");
-
- int zerr;
- zip *za = zip_open(basebandPath, 0, &zerr);
- if (!za) {
- reterror(-15, "failed to open baseband '%s': %d\n", basebandPath, zerr);
- }
- struct zip_stat st{};
- zip_int64_t entries = zip_get_num_entries(za, 0);
- for (zip_uint64_t i = 0; i < entries; i++) {
- zerr = zip_stat_index(za, i, 0, &st);
- if (zerr == -1 || (zerr = zip_test_file(za, i, st.size, st.crc))) {
- reterror(-16, "Failed to verify baseband integrity. %d\n", zerr);
- }
- }
- info("Verified baseband integrity.\n");
-
+void futurerestore::setBasebandPath(const char *basebandPath){
+ FILE *fbb = fopen(basebandPath, "rb");
+ if (!fbb)
+ reterror(-15, "failed to read baseband");
_basebandPath = basebandPath;
- zip_close(za);
+ fclose(fbb);
}
+/* static methods */
inline void futurerestore::saveStringToFile(const char *str, const char *path){
FILE *f = fopen(path, "wb");
if (!f) reterror(-41,"can't save file at %s\n",path);
@@ -1329,17 +1177,14 @@ char *futurerestore::getNonceFromSCAB(const char* scab, size_t *nonceSize){
char *nonceOctet = NULL;
if (!scab) reterror(-15, "Got empty SCAB\n");
-
if (asn1ElementsInObject(scab)< 4){
- error("unexpected number of Elements in SCAB sequence\n");
+ error("unexpected number of elements in SCAB sequence\n");
goto error;
}
if (nonceSize) *nonceSize = 0;
mainSet = asn1ElementAtIndex(scab, 1);
-
elems = asn1ElementsInObject(mainSet);
-
for (int i=0; i 0) {
- nsize += (zip_uint64_t) n;
- ncrc = (zip_uint32_t) crc32(ncrc, (const Bytef *) buf, (unsigned int) n);
- }
-
- if (n < 0) {
- fprintf(stderr, "error reading file %" PRIu64 " in archive: %s\n", idx, zip_file_strerror(zf));
- zip_fclose(zf);
- return -1;
- }
-
- zip_fclose(zf);
-
- if (nsize != size) {
- fprintf(stderr, "file %" PRIu64 ": unexpected length %" PRId64 " (should be %" PRId64 ")\n", idx, nsize, size);
- return -2;
- }
- if (ncrc != crc) {
- fprintf(stderr, "file %" PRIu64 ": unexpected length %x (should be %x)\n", idx, ncrc, crc);
- return -2;
- }
-
- return 0;
-}
\ No newline at end of file
diff --git a/futurerestore/futurerestore.hpp b/futurerestore/futurerestore.hpp
index ef3c66e1b..d27af9b5d 100644
--- a/futurerestore/futurerestore.hpp
+++ b/futurerestore/futurerestore.hpp
@@ -9,17 +9,17 @@
#ifndef futurerestore_hpp
#define futurerestore_hpp
-#include "config.h"
#include
#include
#include
-#include "idevicerestore.h"
-#include
#include
+#include
+#include "config.h"
+#include "idevicerestore.h"
+
#if defined _WIN32 || defined __CYGWIN__
-#ifndef WIN32
-//make sure WIN32 is defined if compiling for windows
+#ifndef WIN32 //make sure WIN32 is defined if compiling for windows
#define WIN32
#endif
#endif
@@ -71,7 +71,6 @@ class futurerestore {
//methods
void enterPwnRecovery(plist_t build_identity, std::string bootargs = "");
-
public:
futurerestore(bool isUpdateInstall = false, bool isPwnDfu = false);
bool init();
@@ -94,11 +93,11 @@ class futurerestore {
char *getLatestFirmwareUrl();
void loadLatestBaseband();
void loadLatestSep();
- void loadSepFromIpsw(const char *ipswPath);
- void loadBasebandFromIpsw(const char *ipswPath);
- void loadSep(const char *sepPath, const char *sepManifestPath);
- void setBasebandPath(const char *basebandPath, const char *basebandManifestPath);
+ void setSepManifestPath(const char *sepManifestPath);
+ void setBasebandManifestPath(const char *basebandManifestPath);
+ void loadSep(const char *sepPath);
+ void setBasebandPath(const char *basebandPath);
bool isUpdateInstall(){return _isUpdateInstall;};
plist_t sepManifest(){return _sepbuildmanifest;};
@@ -123,10 +122,6 @@ class futurerestore {
static plist_t loadPlistFromFile(const char *path);
static void saveStringToFile(const char *str, const char *path);
static char *getPathOfElementInManifest(const char *element, const char *manifeststr, struct idevicerestore_client_t* client, int isUpdateInstall);
-
};
-
-
-
#endif /* futurerestore_hpp */
diff --git a/futurerestore/main.cpp b/futurerestore/main.cpp
index 244ee2a58..967f9c84f 100644
--- a/futurerestore/main.cpp
+++ b/futurerestore/main.cpp
@@ -1,4 +1,4 @@
-
+//
// main.cpp
// futurerestore
//
@@ -15,12 +15,14 @@
#include
#include
#include
+
#include "futurerestore.hpp"
-#include "all_tsschecker.h"
#include "tsschecker.h"
+
#ifdef HAVE_LIBIPATCHER
#include
#endif
+
#ifdef WIN32
#include
#ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING
@@ -37,7 +39,6 @@ static struct option longopts[] = {
{ "baseband-manifest", required_argument, NULL, 'p' },
{ "sep", required_argument, NULL, 's' },
{ "sep-manifest", required_argument, NULL, 'm' },
- { "source-ipsw", required_argument, NULL, 'i' },
{ "wait", no_argument, NULL, 'w' },
{ "update", no_argument, NULL, 'u' },
{ "debug", no_argument, NULL, 'd' },
@@ -45,10 +46,12 @@ static struct option longopts[] = {
{ "latest-baseband", no_argument, NULL, '1' },
{ "no-baseband", no_argument, NULL, '2' },
{ "exit-recovery", no_argument, NULL, '5' },
+
#ifdef HAVE_LIBIPATCHER
{ "use-pwndfu", no_argument, NULL, '3' },
{ "just-boot", optional_argument, NULL, '4' },
#endif
+
{ NULL, 0, NULL, 0 }
};
@@ -60,31 +63,37 @@ static struct option longopts[] = {
#define FLAG_IS_PWN_DFU 1 << 5
void cmd_help(){
- printf("Usage: futurerestore [OPTIONS] /path/to/ipsw\n\n");
- printf("Options:\n\n");
-
- printf(" -t, --apticket PATH\t\tAPTicket used for restoring\n");
+ printf("Usage: futurerestore [OPTIONS] iPSW\n");
+ printf("Tool, which supported latest restore unsigned firmware methods for iOS/tvOS devices.\n");
+
+ printf("\nGeneral options:\n");
+ printf(" -t, --apticket PATH\t\tSigning tickets used for restoring\n");
printf(" -u, --update\t\t\tUpdate instead of erase install (requires appropriate APTicket)\n");
- printf(" -w, --wait\t\t\tKeep rebooting until nonce matches APTicket (nonce collision, unreliable)\n");
+ printf(" \t\t\tNOT recommended to use this parameter, if you update from jailbroken firmware!\n");
+ printf(" -w, --wait\t\t\tKeep rebooting until ApNonce matches APTicket (ApNonce collision, unreliable)\n");
printf(" -d, --debug\t\t\tVerbose debug output (useful for error logs)\n");
- printf(" --latest-sep\t\tUse latest signed sep instead of manually specifying one (may cause bad restore)\n");
- printf(" --latest-baseband\t\tUse latest signed baseband instead of manually specifying one (may cause bad restore)\n");
- printf(" --no-baseband\t\tSkip checks and don't flash baseband\n");
- printf(" \t\tWARNING: only use this for device without a baseband (eg. iPod or some wifi only iPads)\n");
printf(" --exit-recovery\t\tExit recovery mode and quit\n");
+
+ printf("\nOptions for SEP:\n");
+ printf(" --latest-sep\t\tUse latest signed SEP instead of manually specifying one (may cause bad restore)\n");
+ printf(" -s, --sep PATH\t\tSEP to be flashed\n");
+ printf(" -m, --sep-manifest PATH\tBuildManifest for requesting SEP ticket\n");
+
#ifdef HAVE_LIBIPATCHER
- printf(" --use-pwndfu\t\tuse this for restoring devices with odysseus method. Device needs to be in kDFU mode already\n");
- printf(" --just-boot=\"-v\"\t\tuse this to tethered boot the device from kDFU mode. You can optionally set bootargs\n");
+ printf("\nOptions for 32-bit downgrading:\n");
+ printf(" --use-pwndfu\t\tuse this for restoring devices with Odysseus method. Device needs to be in pwned DFU mode already\n");
+ printf(" --just-boot=\"-v\"\t\tuse this to tethered boot the device from pwned DFU mode. You can optionally set boot-args\n");
#endif
- printf("\nTo extract baseband/SEP automatically from IPSW:\n\n");
- printf(" -i, --source-ipsw PATH\tSource IPSW to extract baseband/SEP from\n");
- printf("\nTo manually specify baseband/SEP:\n\n");
+
+ printf("\nOptions for baseband:\n");
+ printf(" --latest-baseband\t\tUse latest signed baseband instead of manually specifying one (may cause bad restore)\n");
printf(" -b, --baseband PATH\t\tBaseband to be flashed\n");
printf(" -p, --baseband-manifest PATH\tBuildManifest for requesting baseband ticket\n");
- printf(" -s, --sep PATH\t\tSEP to be flashed\n");
- printf(" -m, --sep-manifest PATH\tBuildManifest for requesting sep ticket\n");
- printf("\n");
- printf("Homepage: <" PACKAGE_URL ">\n");
+ printf(" --no-baseband\t\tSkip checks and don't flash baseband\n");
+ printf(" \t\tWARNING: only use this for device without a baseband (eg. iPod touch or some Wi-Fi only iPads)\n\n");
+
+ printf("Homepage: https://github.com/s0uthwest/futurerestore\n");
+ printf("Original project: https://github.com/tihmstar/futurerestore\n");
}
using namespace std;
@@ -100,12 +109,13 @@ int main(int argc, const char * argv[]) {
int err=0;
int res = -1;
- printf("Version: " VERSION_COMMIT_SHA_FUTURERESTORE" - " VERSION_COMMIT_COUNT_FUTURERESTORE"\n");
+ printf("Version: " VERSION_SHA_FUTURERESTORE" - " VERSION_COUNT_FUTURERESTORE"\n"); // versioning
+
#ifdef HAVE_LIBIPATCHER
printf("%s\n",libipatcher::version().c_str());
- printf("Odysseus Support: yes\n");
+ printf("Odysseus support: yes\n");
#else
- printf("Odysseus Support: no\n");
+ printf("Odysseus support: no\n");
#endif
int optindex = 0;
@@ -113,13 +123,15 @@ int main(int argc, const char * argv[]) {
long flags = 0;
bool exitRecovery = false;
+ int isSepManifestSigned = 0;
+ int isBasebandSigned = 0;
+
const char *ipsw = NULL;
const char *basebandPath = NULL;
const char *basebandManifestPath = NULL;
const char *sepPath = NULL;
const char *sepManifestPath = NULL;
const char *bootargs = NULL;
- const char *sourceIpswPath = nullptr;
vector apticketPaths;
@@ -131,8 +143,7 @@ int main(int argc, const char * argv[]) {
return -1;
}
-
- while ((opt = getopt_long(argc, (char* const *)argv, "t:i:b:p:s:m:wud0123", longopts, &optindex)) > 0) {
+ while ((opt = getopt_long(argc, (char* const *)argv, "t:b:p:s:m:wud0123", longopts, &optindex)) > 0) {
switch (opt) {
case 't': // long option: "apticket"; can be called as short option
apticketPaths.push_back(optarg);
@@ -140,7 +151,7 @@ int main(int argc, const char * argv[]) {
case 'b': // long option: "baseband"; can be called as short option
basebandPath = optarg;
break;
- case 'p': // long option: "baseband-plist"; can be called as short option
+ case 'p': // long option: "baseband-manifest"; can be called as short option
basebandManifestPath = optarg;
break;
case 's': // long option: "sep"; can be called as short option
@@ -149,9 +160,6 @@ int main(int argc, const char * argv[]) {
case 'm': // long option: "sep-manifest"; can be called as short option
sepManifestPath = optarg;
break;
- case 'i': // long option: "source-ipsw"; can be called as short option
- sourceIpswPath = optarg;
- break;
case 'w': // long option: "wait"; can be called as short option
flags |= FLAG_WAIT;
break;
@@ -170,6 +178,7 @@ int main(int argc, const char * argv[]) {
case '5': // long option: "exit-recovery";
exitRecovery = true;
break;
+
#ifdef HAVE_LIBIPATCHER
case '3': // long option: "no-baseband";
flags |= FLAG_IS_PWN_DFU;
@@ -179,6 +188,7 @@ int main(int argc, const char * argv[]) {
break;
break;
#endif
+
case 'd': // long option: "debug"; can be called as short option
idevicerestore_debug = 1;
break;
@@ -192,8 +202,8 @@ int main(int argc, const char * argv[]) {
argv += optind;
ipsw = argv[0];
- }else if (argc == optind && flags & FLAG_WAIT) {
- info("User requested to only wait for APNonce to match, but not actually restoring\n");
+ } else if (argc == optind && flags & FLAG_WAIT) {
+ info("User requested to only wait for ApNonce to match, but not actually restoring\n");
} else if (exitRecovery) {
info("Exiting recovery mode\n");
} else {
@@ -224,8 +234,8 @@ int main(int argc, const char * argv[]) {
if (!(
((apticketPaths.size() && ipsw)
- && ((basebandPath && basebandManifestPath) || sourceIpswPath || (flags & FLAG_LATEST_BASEBAND) || (flags & FLAG_NO_BASEBAND))
- && ((sepPath && sepManifestPath) || sourceIpswPath || (flags & FLAG_LATEST_SEP) || client.is32bit())
+ && ((basebandPath && basebandManifestPath) || ((flags & FLAG_LATEST_BASEBAND) || (flags & FLAG_NO_BASEBAND)))
+ && ((sepPath && sepManifestPath) || (flags & FLAG_LATEST_SEP) || client.is32bit())
) || (ipsw && bootargs && (flags & FLAG_IS_PWN_DFU))
)) {
@@ -248,25 +258,22 @@ int main(int argc, const char * argv[]) {
devVals.deviceBoard = const_cast(device->hardware_model);
if (flags & FLAG_LATEST_SEP) {
- info("user specified to use latest signed sep\n");
+ info("user specified to use latest signed SEP (WARNING, THIS CAN CAUSE A NON-WORKING RESTORE)\n");
client.loadLatestSep();
- } else if (!client.is32bit()) {
- if (sourceIpswPath != nullptr) {
- client.loadSepFromIpsw(sourceIpswPath);
- } else {
- client.loadSep(sepPath, sepManifestPath);
- }
+ }else if (!client.is32bit()){
+ client.loadSep(sepPath);
+ client.setSepManifestPath(sepManifestPath);
}
versVals.basebandMode = kBasebandModeWithoutBaseband;
- if (!client.is32bit() && !isManifestSignedForDevice(client.sepManifestPath(), &devVals, &versVals)) {
- reterror(-3,"sep firmware isn't signed\n");
+ if (!client.is32bit() && !(isSepManifestSigned = isManifestSignedForDevice(client.sepManifestPath(), &devVals, &versVals))){
+ reterror(-3,"SEP firmware isn't signed\n");
}
if (flags & FLAG_NO_BASEBAND){
printf("\nWARNING: user specified not to flash a baseband. This can make the restore fail if the device needs a baseband!\n");
printf("if you added this flag by mistake you can press CTRL-C now to cancel\n");
- int c = 5;
+ int c = 10;
printf("continuing restore in ");
while (c) {
printf("%d ",c--);
@@ -278,11 +285,10 @@ int main(int argc, const char * argv[]) {
if (flags & FLAG_LATEST_BASEBAND) {
info("user specified to use latest signed baseband (WARNING, THIS CAN CAUSE A NON-WORKING RESTORE)\n");
client.loadLatestBaseband();
- } else if (sourceIpswPath != nullptr) {
- client.loadBasebandFromIpsw(sourceIpswPath);
} else {
- client.setBasebandPath(basebandPath, basebandManifestPath);
- printf("Did set sep+baseband path and firmware\n");
+ client.setBasebandPath(basebandPath);
+ client.setBasebandManifestPath(basebandManifestPath);
+ printf("Did set SEP+baseband path and firmware\n");
}
versVals.basebandMode = kBasebandModeOnlyBaseband;
@@ -292,14 +298,14 @@ int main(int argc, const char * argv[]) {
if (!(devVals.bbsnumSize = client.getBBSNumSizeFromDevice())) {
printf("[WARNING] Using tsschecker's fallback BasebandSerialNumber size. This might result in invalid baseband signing status information\n");
}
- if (!isManifestSignedForDevice(client.basebandManifestPath(), &devVals, &versVals)) {
+ if (!(isBasebandSigned = isManifestSignedForDevice(client.basebandManifestPath(), &devVals, &versVals))) {
reterror(-3,"baseband firmware isn't signed\n");
}
}
}
client.putDeviceIntoRecovery();
if (flags & FLAG_WAIT){
- printf("\n[WARNING] -w is ONLY for nonce collision! If you didn't intend this, remove the -w flag.\n\n");
+ printf("\n[WARNING] -w is ONLY for ApNonce collision! If you didn't intend this, remove the -w flag.\n\n");
client.waitForNonce();
}
} catch (int error) {
@@ -314,12 +320,11 @@ int main(int argc, const char * argv[]) {
else
res = client.doRestore(ipsw);
} catch (int error) {
- if (error == -20) error("Set your APNonce before restoring!\n");
+ if (error == -20) error("Set your ApNonce before restoring!\n");
err = error;
}
cout << "Done: restoring "<< (!res ? "succeeded" : "failed")<<"." </dev/null || sed -i "s/.*VERSION_COMMIT_COUNT_FUTURERESTORE.*/#define VERSION_COMMIT_COUNT_FUTURERESTORE \"$(git rev-list --count HEAD)\"/" ./futurerestore/config.h 2>/dev/null
-sed -i '.bak' "s/.*define VERSION_COMMIT_SHA_FUTURERESTORE.*/#define VERSION_COMMIT_SHA_FUTURERESTORE \"$(git rev-parse HEAD)\"/" ./futurerestore/config.h 2>/dev/null || sed -i "s/.*VERSION_COMMIT_SHA_FUTURERESTORE.*/#define VERSION_COMMIT_SHA_FUTURERESTORE \"$(git rev-parse HEAD)\"/" ./futurerestore/config.h 2>/dev/null
+sed -i '.bak' "s/.*define VERSION_COUNT_FUTURERESTORE.*/#define VERSION_COUNT_FUTURERESTORE \"$(git rev-list --count HEAD)\"/" ./futurerestore/config.h 2>/dev/null || sed -i "s/.*VERSION_COUNT_FUTURERESTORE.*/#define VERSION_COUNT_FUTURERESTORE \"$(git rev-list --count HEAD)\"/" ./futurerestore/config.h 2>/dev/null
+sed -i '.bak' "s/.*define VERSION_SHA_FUTURERESTORE.*/#define VERSION_SHA_FUTURERESTORE \"$(git rev-parse HEAD)\"/" ./futurerestore/config.h 2>/dev/null || sed -i "s/.*VERSION_SHA_FUTURERESTORE.*/#define VERSION_SHA_FUTURERESTORE \"$(git rev-parse HEAD)\"/" ./futurerestore/config.h 2>/dev/null