Allow the symbols and the disk images to be in different DeviceSupport directories.

This commit is contained in:
Eddie Hillenbrand 2014-11-03 16:09:36 -08:00
parent 63917d796b
commit 4aa233d147

View File

@ -458,22 +458,38 @@ CFStringRef copy_device_support_path(AMDeviceRef device) {
return path; return path;
} }
CFStringRef copy_developer_disk_image_path(CFStringRef deviceSupportPath) { CFStringRef copy_developer_disk_image_path(AMDeviceRef device) {
CFStringRef path = CFStringCreateWithFormat(NULL, NULL, CFSTR("%@/%@"), deviceSupportPath, CFSTR("DeveloperDiskImage.dmg")); CFStringRef version = NULL;
if (!path_exists(path)) { CFStringRef build = AMDeviceCopyValue(device, 0, CFSTR("BuildVersion"));
CFRelease(path); CFStringRef path = NULL;
path = NULL; CFMutableArrayRef version_parts = get_device_product_version_parts(device);
}
if (path == NULL) { while (CFArrayGetCount(version_parts) > 0) {
// Sometimes Latest seems to be missing in Xcode, in that case use find and hope for the best version = CFStringCreateByCombiningStrings(NULL, version_parts, CFSTR("."));
path = copy_long_shot_disk_image_path(); if (path == NULL) {
if (CFStringGetLength(path) < 5) { path = copy_xcode_path_for(CFSTR("iOS DeviceSupport"), CFStringCreateWithFormat(NULL, NULL, CFSTR("%@ (%@)/DeveloperDiskImage.dmg"), version, build));
CFRelease(path);
path = NULL;
} }
if (path == NULL) {
path = copy_xcode_path_for(CFSTR("Platforms/iPhoneOS.platform/DeviceSupport"), CFStringCreateWithFormat(NULL, NULL, CFSTR("%@ (%@)/DeveloperDiskImage.dmg"), version, build));
}
if (path == NULL) {
path = copy_xcode_path_for(CFSTR("Platforms/iPhoneOS.platform/DeviceSupport"), CFStringCreateWithFormat(NULL, NULL, CFSTR("%@ (*)/DeveloperDiskImage.dmg"), version));
}
if (path == NULL) {
path = copy_xcode_path_for(CFSTR("Platforms/iPhoneOS.platform/DeviceSupport"), CFStringCreateWithFormat(NULL, NULL, CFSTR("%@/DeveloperDiskImage.dmg"), version));
}
if (path == NULL) {
path = copy_xcode_path_for(CFSTR("Platforms/iPhoneOS.platform/DeviceSupport/Latest"), CFSTR("DeveloperDiskImage.dmg"));
}
CFRelease(version);
if (path != NULL) {
break;
}
CFArrayRemoveValueAtIndex(version_parts, CFArrayGetCount(version_parts) - 1);
} }
CFRelease(version_parts);
CFRelease(build);
if (path == NULL) if (path == NULL)
{ {
printf("[ !! ] Unable to locate DeveloperDiskImage.dmg.\n[ !! ] This probably means you don't have Xcode installed, you will need to launch the app manually and logging output will not be shown!\n"); printf("[ !! ] Unable to locate DeveloperDiskImage.dmg.\n[ !! ] This probably means you don't have Xcode installed, you will need to launch the app manually and logging output will not be shown!\n");
@ -497,7 +513,7 @@ void mount_callback(CFDictionaryRef dict, int arg) {
void mount_developer_image(AMDeviceRef device) { void mount_developer_image(AMDeviceRef device) {
CFStringRef ds_path = copy_device_support_path(device); CFStringRef ds_path = copy_device_support_path(device);
CFStringRef image_path = copy_developer_disk_image_path(ds_path); CFStringRef image_path = copy_developer_disk_image_path(device);
CFStringRef sig_path = CFStringCreateWithFormat(NULL, NULL, CFSTR("%@.signature"), image_path); CFStringRef sig_path = CFStringCreateWithFormat(NULL, NULL, CFSTR("%@.signature"), image_path);
if (verbose) { if (verbose) {