diff options
| author | 2013-11-04 23:43:11 +0100 | |
|---|---|---|
| committer | 2013-11-04 23:43:11 +0100 | |
| commit | 6e09b5942bc175a907c0f7de19e7fe9680a2840f (patch) | |
| tree | 9153dbdc111765229a315e3827b7a0758a913b97 | |
| parent | dee792dc79246d3fe7b0e5ddccc3c44c8a5379a6 (diff) | |
| download | ideviceinstaller-6e09b5942bc175a907c0f7de19e7fe9680a2840f.tar.gz ideviceinstaller-6e09b5942bc175a907c0f7de19e7fe9680a2840f.tar.bz2 | |
iOS 7: Read BundleIdentifier from Info.plist and use during install/upgrade
| -rw-r--r-- | src/ideviceinstaller.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/ideviceinstaller.c b/src/ideviceinstaller.c index 3aac8ae..0877c86 100644 --- a/src/ideviceinstaller.c +++ b/src/ideviceinstaller.c | |||
| @@ -858,12 +858,20 @@ run_again: | |||
| 858 | } | 858 | } |
| 859 | 859 | ||
| 860 | char *bundleexecutable = NULL; | 860 | char *bundleexecutable = NULL; |
| 861 | char *bundleidentifier = NULL; | ||
| 861 | 862 | ||
| 862 | plist_t bname = plist_dict_get_item(info, "CFBundleExecutable"); | 863 | plist_t bname = plist_dict_get_item(info, "CFBundleExecutable"); |
| 863 | if (bname) { | 864 | if (bname) { |
| 864 | plist_get_string_val(bname, &bundleexecutable); | 865 | plist_get_string_val(bname, &bundleexecutable); |
| 865 | } | 866 | } |
| 867 | |||
| 868 | bname = plist_dict_get_item(info, "CFBundleIdentifier"); | ||
| 869 | if (bname) { | ||
| 870 | plist_get_string_val(bname, &bundleidentifier); | ||
| 871 | printf("Installing bundle %s.\n", bundleidentifier); | ||
| 872 | } | ||
| 866 | plist_free(info); | 873 | plist_free(info); |
| 874 | info = NULL; | ||
| 867 | 875 | ||
| 868 | if (!bundleexecutable) { | 876 | if (!bundleexecutable) { |
| 869 | fprintf(stderr, "Could not determine value for CFBundleExecutable!\n"); | 877 | fprintf(stderr, "Could not determine value for CFBundleExecutable!\n"); |
| @@ -892,7 +900,7 @@ run_again: | |||
| 892 | 900 | ||
| 893 | /* copy archive to device */ | 901 | /* copy archive to device */ |
| 894 | pkgname = NULL; | 902 | pkgname = NULL; |
| 895 | if (asprintf(&pkgname, "%s/%s", PKG_PATH, basename(appid)) < 0) { | 903 | if (asprintf(&pkgname, "%s/%s", PKG_PATH, bundleidentifier) < 0) { |
| 896 | fprintf(stderr, "Out of memory!?\n"); | 904 | fprintf(stderr, "Out of memory!?\n"); |
| 897 | goto leave_cleanup; | 905 | goto leave_cleanup; |
| 898 | } | 906 | } |
| @@ -906,6 +914,9 @@ run_again: | |||
| 906 | 914 | ||
| 907 | printf("done.\n"); | 915 | printf("done.\n"); |
| 908 | 916 | ||
| 917 | if (bundleidentifier) { | ||
| 918 | instproxy_client_options_add(client_opts, "CFBundleIdentifier", bundleidentifier, NULL); | ||
| 919 | } | ||
| 909 | if (sinf) { | 920 | if (sinf) { |
| 910 | instproxy_client_options_add(client_opts, "ApplicationSINF", sinf, NULL); | 921 | instproxy_client_options_add(client_opts, "ApplicationSINF", sinf, NULL); |
| 911 | } | 922 | } |
