mirror of
https://github.com/tihmstar/futurerestore.git
synced 2025-07-06 15:40:33 +00:00
--no-restore argument (#32)
* --no-restore — exit before sending NOR Data
This commit is contained in:
parent
21ac80b258
commit
1092eb2e68
2
external/idevicerestore
vendored
2
external/idevicerestore
vendored
|
@ -1 +1 @@
|
||||||
Subproject commit 65435ecb53864e3c553c6574b7b38b3b16344212
|
Subproject commit 5d39c3027dc6dfe2e8146f62dab5874ae64ede05
|
|
@ -106,7 +106,7 @@ extern "C"{
|
||||||
};
|
};
|
||||||
|
|
||||||
#pragma mark futurerestore
|
#pragma mark futurerestore
|
||||||
futurerestore::futurerestore(bool isUpdateInstall, bool isPwnDfu, bool noIBSS) : _isUpdateInstall(isUpdateInstall), _isPwnDfu(isPwnDfu), _noIBSS(noIBSS){
|
futurerestore::futurerestore(bool isUpdateInstall, bool isPwnDfu, bool noIBSS, bool noRestore) : _isUpdateInstall(isUpdateInstall), _isPwnDfu(isPwnDfu), _noIBSS(noIBSS), _noRestore(noRestore){
|
||||||
_client = idevicerestore_client_new();
|
_client = idevicerestore_client_new();
|
||||||
if (_client == NULL) throw std::string("could not create idevicerestore client\n");
|
if (_client == NULL) throw std::string("could not create idevicerestore client\n");
|
||||||
|
|
||||||
|
@ -924,6 +924,7 @@ void futurerestore::doRestore(const char *ipsw){
|
||||||
plist_t build_identity = NULL;
|
plist_t build_identity = NULL;
|
||||||
|
|
||||||
client->ipsw = strdup(ipsw);
|
client->ipsw = strdup(ipsw);
|
||||||
|
if (_noRestore) client->flags |= FLAG_NO_RESTORE;
|
||||||
if (!_isUpdateInstall) client->flags |= FLAG_ERASE;
|
if (!_isUpdateInstall) client->flags |= FLAG_ERASE;
|
||||||
|
|
||||||
irecv_device_event_subscribe(&client->irecv_e_ctx, irecv_event_cb, client);
|
irecv_device_event_subscribe(&client->irecv_e_ctx, irecv_event_cb, client);
|
||||||
|
@ -1339,8 +1340,9 @@ void futurerestore::doRestore(const char *ipsw){
|
||||||
mutex_unlock(&client->device_event_mutex);
|
mutex_unlock(&client->device_event_mutex);
|
||||||
|
|
||||||
info("About to restore device... \n");
|
info("About to restore device... \n");
|
||||||
int result = 0;
|
int result = restore_device(client, build_identity, filesystem);
|
||||||
retassure(!(result = restore_device(client, build_identity, filesystem)), "ERROR: Unable to restore device\n");
|
if (result == 2) return;
|
||||||
|
else retassure(!(result), "ERROR: Unable to restore device\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
int futurerestore::doJustBoot(const char *ipsw, string bootargs){
|
int futurerestore::doJustBoot(const char *ipsw, string bootargs){
|
||||||
|
|
|
@ -58,6 +58,7 @@ class futurerestore {
|
||||||
bool _isUpdateInstall = false;
|
bool _isUpdateInstall = false;
|
||||||
bool _isPwnDfu = false;
|
bool _isPwnDfu = false;
|
||||||
bool _noIBSS = false;
|
bool _noIBSS = false;
|
||||||
|
bool _noRestore = false;
|
||||||
|
|
||||||
char *_firmwareJson = NULL;
|
char *_firmwareJson = NULL;
|
||||||
jssytok_t *_firmwareTokens = NULL;;
|
jssytok_t *_firmwareTokens = NULL;;
|
||||||
|
@ -84,7 +85,7 @@ class futurerestore {
|
||||||
void enterPwnRecovery2(plist_t build_identity, std::string bootargs = "");
|
void enterPwnRecovery2(plist_t build_identity, std::string bootargs = "");
|
||||||
|
|
||||||
public:
|
public:
|
||||||
futurerestore(bool isUpdateInstall = false, bool isPwnDfu = false, bool noIBSS = false);
|
futurerestore(bool isUpdateInstall = false, bool isPwnDfu = false, bool noIBSS = false, bool noRestore = false);
|
||||||
bool init();
|
bool init();
|
||||||
int getDeviceMode(bool reRequest);
|
int getDeviceMode(bool reRequest);
|
||||||
uint64_t getDeviceEcid();
|
uint64_t getDeviceEcid();
|
||||||
|
|
|
@ -44,6 +44,7 @@ static struct option longopts[] = {
|
||||||
{ "debug", no_argument, NULL, 'd' },
|
{ "debug", no_argument, NULL, 'd' },
|
||||||
{ "exit-recovery", no_argument, NULL, 'e' },
|
{ "exit-recovery", no_argument, NULL, 'e' },
|
||||||
{ "latest-sep", no_argument, NULL, '0' },
|
{ "latest-sep", no_argument, NULL, '0' },
|
||||||
|
{ "no-restore", no_argument, NULL, 'z' },
|
||||||
{ "latest-baseband", no_argument, NULL, '1' },
|
{ "latest-baseband", no_argument, NULL, '1' },
|
||||||
{ "no-baseband", no_argument, NULL, '2' },
|
{ "no-baseband", no_argument, NULL, '2' },
|
||||||
#ifdef HAVE_LIBIPATCHER
|
#ifdef HAVE_LIBIPATCHER
|
||||||
|
@ -61,6 +62,7 @@ static struct option longopts[] = {
|
||||||
#define FLAG_NO_BASEBAND 1 << 4
|
#define FLAG_NO_BASEBAND 1 << 4
|
||||||
#define FLAG_IS_PWN_DFU 1 << 5
|
#define FLAG_IS_PWN_DFU 1 << 5
|
||||||
#define FLAG_NO_IBSS 1 << 6
|
#define FLAG_NO_IBSS 1 << 6
|
||||||
|
#define FLAG_NO_RESTORE_FR 1 << 7
|
||||||
|
|
||||||
void cmd_help(){
|
void cmd_help(){
|
||||||
printf("Usage: futurerestore [OPTIONS] iPSW\n");
|
printf("Usage: futurerestore [OPTIONS] iPSW\n");
|
||||||
|
@ -72,6 +74,7 @@ void cmd_help(){
|
||||||
printf(" -w, --wait\t\t\tKeep rebooting until ApNonce matches APTicket (ApNonce collision, unreliable)\n");
|
printf(" -w, --wait\t\t\tKeep rebooting until ApNonce matches APTicket (ApNonce collision, unreliable)\n");
|
||||||
printf(" -d, --debug\t\t\tShow all code, use to save a log for debug testing\n");
|
printf(" -d, --debug\t\t\tShow all code, use to save a log for debug testing\n");
|
||||||
printf(" -e, --exit-recovery\t\tExit recovery mode and quit\n");
|
printf(" -e, --exit-recovery\t\tExit recovery mode and quit\n");
|
||||||
|
printf(" -z, --no-restore\t\tDo not restore and end right before NOR data is sent\n");
|
||||||
|
|
||||||
#ifdef HAVE_LIBIPATCHER
|
#ifdef HAVE_LIBIPATCHER
|
||||||
printf("\nOptions for downgrading with Odysseus:\n");
|
printf("\nOptions for downgrading with Odysseus:\n");
|
||||||
|
@ -117,6 +120,7 @@ int main_r(int argc, const char * argv[]) {
|
||||||
int opt = 0;
|
int opt = 0;
|
||||||
long flags = 0;
|
long flags = 0;
|
||||||
bool exitRecovery = false;
|
bool exitRecovery = false;
|
||||||
|
bool noRestore = false;
|
||||||
|
|
||||||
int isSepManifestSigned = 0;
|
int isSepManifestSigned = 0;
|
||||||
int isBasebandSigned = 0;
|
int isBasebandSigned = 0;
|
||||||
|
@ -138,7 +142,7 @@ int main_r(int argc, const char * argv[]) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
while ((opt = getopt_long(argc, (char* const *)argv, "ht:b:p:s:m:wude0123", longopts, &optindex)) > 0) {
|
while ((opt = getopt_long(argc, (char* const *)argv, "ht:b:p:s:m:wudez0123", longopts, &optindex)) > 0) {
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
case 't': // long option: "apticket"; can be called as short option
|
case 't': // long option: "apticket"; can be called as short option
|
||||||
apticketPaths.push_back(optarg);
|
apticketPaths.push_back(optarg);
|
||||||
|
@ -185,6 +189,9 @@ int main_r(int argc, const char * argv[]) {
|
||||||
case 'e': // long option: "exit-recovery"; can be called as short option
|
case 'e': // long option: "exit-recovery"; can be called as short option
|
||||||
exitRecovery = true;
|
exitRecovery = true;
|
||||||
break;
|
break;
|
||||||
|
case 'z': // long option: "no-restore"; can be called as short option
|
||||||
|
flags |= FLAG_NO_RESTORE_FR;
|
||||||
|
break;
|
||||||
case 'd': // long option: "debug"; can be called as short option
|
case 'd': // long option: "debug"; can be called as short option
|
||||||
idevicerestore_debug = 1;
|
idevicerestore_debug = 1;
|
||||||
break;
|
break;
|
||||||
|
@ -213,7 +220,7 @@ int main_r(int argc, const char * argv[]) {
|
||||||
return -5;
|
return -5;
|
||||||
}
|
}
|
||||||
|
|
||||||
futurerestore client(flags & FLAG_UPDATE, flags & FLAG_IS_PWN_DFU, flags & FLAG_NO_IBSS);
|
futurerestore client(flags & FLAG_UPDATE, flags & FLAG_IS_PWN_DFU, flags & FLAG_NO_IBSS, flags & FLAG_NO_RESTORE_FR);
|
||||||
retassure(client.init(),"can't init, no device found\n");
|
retassure(client.init(),"can't init, no device found\n");
|
||||||
|
|
||||||
printf("futurerestore init done\n");
|
printf("futurerestore init done\n");
|
||||||
|
|
Loading…
Reference in a new issue