diff options
| author | 2012-08-25 00:17:40 +0200 | |
|---|---|---|
| committer | 2012-08-25 00:17:40 +0200 | |
| commit | 60cf6780c399f71751b4748bcca84c41f1a0b722 (patch) | |
| tree | 36029ba814fab041cb6f945438b6210fd0abbdd6 | |
| parent | 1086db865ee04febf929f0708e7428fda45f38db (diff) | |
| download | ideviceinstaller-60cf6780c399f71751b4748bcca84c41f1a0b722.tar.gz ideviceinstaller-60cf6780c399f71751b4748bcca84c41f1a0b722.tar.bz2 | |
Improve detection of Info.plist in application archive
Some applications appear to provide another Info.plist.
Using zip_name_locate() might locate the wrong one in such a case
which prevented the correct installation of the application.
| -rw-r--r-- | src/ideviceinstaller.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/ideviceinstaller.c b/src/ideviceinstaller.c index 8f5ec5e..bde9d97 100644 --- a/src/ideviceinstaller.c +++ b/src/ideviceinstaller.c | |||
| @@ -631,7 +631,24 @@ run_again: | |||
| 631 | plist_t info = NULL; | 631 | plist_t info = NULL; |
| 632 | zbuf = NULL; | 632 | zbuf = NULL; |
| 633 | len = 0; | 633 | len = 0; |
| 634 | if (zip_get_contents(zf, "Info.plist", ZIP_FL_NODIR, &zbuf, &len) < 0) { | 634 | char filename[256]; |
| 635 | |||
| 636 | /* check for "Payload" directory */ | ||
| 637 | strcpy(filename, zip_get_name(zf, 0, 0)); | ||
| 638 | if (strcmp(filename, "Payload") != 0) { | ||
| 639 | fprintf(stderr, "Unable to locate Payload folder in archive!\n"); | ||
| 640 | zip_unchange_all(zf); | ||
| 641 | zip_close(zf); | ||
| 642 | goto leave_cleanup; | ||
| 643 | } | ||
| 644 | |||
| 645 | /* check for "*.app" directory */ | ||
| 646 | strcpy(filename, zip_get_name(zf, 1, 0)); | ||
| 647 | |||
| 648 | /* construct full filename to Info.plist */ | ||
| 649 | strcat(filename, "Info.plist"); | ||
| 650 | |||
| 651 | if (zip_get_contents(zf, filename, 0, &zbuf, &len) < 0) { | ||
| 635 | zip_unchange_all(zf); | 652 | zip_unchange_all(zf); |
| 636 | zip_close(zf); | 653 | zip_close(zf); |
| 637 | goto leave_cleanup; | 654 | goto leave_cleanup; |
