From ca630a24042209707862dbb9f94b125ae8e22502 Mon Sep 17 00:00:00 2001 From: BALATON Zoltan Date: Tue, 15 Sep 2015 00:40:36 +0200 Subject: Do not save personalized components with debug, add a new option for it --- src/idevicerestore.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/idevicerestore.c b/src/idevicerestore.c index a8eea2f..acf171d 100644 --- a/src/idevicerestore.c +++ b/src/idevicerestore.c @@ -67,12 +67,12 @@ static struct option longopts[] = { { "cydia", no_argument, NULL, 's' }, { "exclude", no_argument, NULL, 'x' }, { "shsh", no_argument, NULL, 't' }, + { "keep-pers", no_argument, NULL, 'k' }, { "pwn", no_argument, NULL, 'p' }, { "no-action", no_argument, NULL, 'n' }, { "cache-path", required_argument, NULL, 'C' }, { NULL, 0, NULL, 0 } }; -#endif void usage(int argc, char* argv[]) { char* name = strrchr(argv[0], '/'); @@ -93,7 +93,8 @@ void usage(int argc, char* argv[]) { printf(" -s, --cydia\t\tuse Cydia's signature service instead of Apple's\n"); printf(" -x, --exclude\t\texclude nor/baseband upgrade\n"); printf(" -t, --shsh\t\tfetch TSS record and save to .shsh file, then exit\n"); - printf(" -p, --pwn\t\tPut device in pwned DFU mode and exit (limera1n devices only)\n"); + printf(" -k, --keep-pers\twrite personalized components to files for debugging\n"); + printf(" -p, --pwn\t\tput device in pwned DFU mode and exit (limera1n devices only)\n"); printf(" -n, --no-action\tDo not perform any restore action. If combined with -l option\n"); printf(" \tthe on demand ipsw download is performed before exiting.\n"); printf(" -C, --cache-path DIR\tUse specified directory for caching extracted\n"); @@ -101,6 +102,9 @@ void usage(int argc, char* argv[]) { printf("\n"); printf("Homepage: <" PACKAGE_URL ">\n"); } +#endif + +static int idevicerestore_keep_pers = 0; static int load_version_data(struct idevicerestore_client_t* client) { @@ -1105,6 +1109,10 @@ int main(int argc, char* argv[]) { client->flags |= FLAG_SHSHONLY; break; + case 'k': + idevicerestore_keep_pers = 1; + break; + case 'p': client->flags |= FLAG_PWN; break; @@ -1737,7 +1745,7 @@ int personalize_component(const char *component_name, const unsigned char* compo free(component_blob); } - if (idevicerestore_debug) { + if (idevicerestore_keep_pers) { write_file(component_name, stitched_component, stitched_component_size); } -- cgit v1.1-32-gdbae