summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ideviceinstaller.c41
1 files changed, 8 insertions, 33 deletions
diff --git a/src/ideviceinstaller.c b/src/ideviceinstaller.c
index 5e59e8e..5dcd900 100644
--- a/src/ideviceinstaller.c
+++ b/src/ideviceinstaller.c
@@ -126,7 +126,7 @@ static void print_apps_header()
126{ 126{
127 /* output app details header */ 127 /* output app details header */
128 printf("%s", "CFBundleIdentifier"); 128 printf("%s", "CFBundleIdentifier");
129 printf(", %s", "CFBundleVersion"); 129 printf(", %s", "CFBundleShortVersionString");
130 printf(", %s", "CFBundleDisplayName"); 130 printf(", %s", "CFBundleDisplayName");
131 printf("\n"); 131 printf("\n");
132} 132}
@@ -136,41 +136,15 @@ static void print_apps(plist_t apps)
136 uint32_t i = 0; 136 uint32_t i = 0;
137 for (i = 0; i < plist_array_get_size(apps); i++) { 137 for (i = 0; i < plist_array_get_size(apps); i++) {
138 plist_t app = plist_array_get_item(apps, i); 138 plist_t app = plist_array_get_item(apps, i);
139 plist_t p_bundle_identifier = plist_dict_get_item(app, "CFBundleIdentifier"); 139 plist_t bundle_identifier = plist_dict_get_item(app, "CFBundleIdentifier");
140 char *s_bundle_identifier = NULL;
141 char *s_display_name = NULL;
142 char *s_version = NULL;
143 plist_t display_name = plist_dict_get_item(app, "CFBundleDisplayName"); 140 plist_t display_name = plist_dict_get_item(app, "CFBundleDisplayName");
144 plist_t version = plist_dict_get_item(app, "CFBundleVersion"); 141 plist_t version = plist_dict_get_item(app, "CFBundleShortVersionString");
145
146 if (p_bundle_identifier) {
147 plist_get_string_val(p_bundle_identifier, &s_bundle_identifier);
148 }
149 if (!s_bundle_identifier) {
150 fprintf(stderr, "ERROR: Failed to get bundle identifier!\n");
151 break;
152 }
153
154 if (version) {
155 plist_get_string_val(version, &s_version);
156 }
157 if (display_name) {
158 plist_get_string_val(display_name, &s_display_name);
159 }
160 if (!s_display_name) {
161 s_display_name = strdup(s_bundle_identifier);
162 }
163 142
164 /* output app details */ 143 /* output app details */
165 printf("%s", s_bundle_identifier); 144 printf("%s", plist_get_string_ptr(bundle_identifier, NULL));
166 if (s_version) { 145 printf(", \"%s\"", (version) ? plist_get_string_ptr(version, NULL) : "");
167 printf(", \"%s\"", s_version); 146 printf(", \"%s\"", (display_name) ? plist_get_string_ptr(display_name, NULL) : plist_get_string_ptr(bundle_identifier, NULL));
168 free(s_version);
169 }
170 printf(", \"%s\"", s_display_name);
171 printf("\n"); 147 printf("\n");
172 free(s_display_name);
173 free(s_bundle_identifier);
174 } 148 }
175} 149}
176 150
@@ -795,6 +769,7 @@ run_again:
795 instproxy_client_options_set_return_attributes(client_opts, 769 instproxy_client_options_set_return_attributes(client_opts,
796 "CFBundleIdentifier", 770 "CFBundleIdentifier",
797 "CFBundleDisplayName", 771 "CFBundleDisplayName",
772 "CFBundleShortVersionString",
798 "CFBundleVersion", 773 "CFBundleVersion",
799 "StaticDiskUsage", 774 "StaticDiskUsage",
800 "DynamicDiskUsage", 775 "DynamicDiskUsage",
@@ -1251,7 +1226,7 @@ run_again:
1251 plist_t dispName = 1226 plist_t dispName =
1252 plist_dict_get_item(node, "CFBundleDisplayName"); 1227 plist_dict_get_item(node, "CFBundleDisplayName");
1253 plist_t version = 1228 plist_t version =
1254 plist_dict_get_item(node, "CFBundleVersion"); 1229 plist_dict_get_item(node, "CFBundleShortVersionString");
1255 if (dispName) { 1230 if (dispName) {
1256 plist_get_string_val(dispName, &s_dispName); 1231 plist_get_string_val(dispName, &s_dispName);
1257 } 1232 }