From 6e09b5942bc175a907c0f7de19e7fe9680a2840f Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Mon, 4 Nov 2013 23:43:11 +0100 Subject: iOS 7: Read BundleIdentifier from Info.plist and use during install/upgrade --- src/ideviceinstaller.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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: } char *bundleexecutable = NULL; + char *bundleidentifier = NULL; plist_t bname = plist_dict_get_item(info, "CFBundleExecutable"); if (bname) { plist_get_string_val(bname, &bundleexecutable); } + + bname = plist_dict_get_item(info, "CFBundleIdentifier"); + if (bname) { + plist_get_string_val(bname, &bundleidentifier); + printf("Installing bundle %s.\n", bundleidentifier); + } plist_free(info); + info = NULL; if (!bundleexecutable) { fprintf(stderr, "Could not determine value for CFBundleExecutable!\n"); @@ -892,7 +900,7 @@ run_again: /* copy archive to device */ pkgname = NULL; - if (asprintf(&pkgname, "%s/%s", PKG_PATH, basename(appid)) < 0) { + if (asprintf(&pkgname, "%s/%s", PKG_PATH, bundleidentifier) < 0) { fprintf(stderr, "Out of memory!?\n"); goto leave_cleanup; } @@ -906,6 +914,9 @@ run_again: printf("done.\n"); + if (bundleidentifier) { + instproxy_client_options_add(client_opts, "CFBundleIdentifier", bundleidentifier, NULL); + } if (sinf) { instproxy_client_options_add(client_opts, "ApplicationSINF", sinf, NULL); } -- cgit v1.1-32-gdbae