added iPhone 6
This commit is contained in:
parent
6bd90a5133
commit
029d22ecef
32
ios-deploy.c
32
ios-deploy.c
@ -292,8 +292,6 @@ const CFStringRef get_device_hardware_name(const AMDeviceRef device) {
|
|||||||
CFStringRef model = AMDeviceCopyValue(device, 0, CFSTR("HardwareModel"));
|
CFStringRef model = AMDeviceCopyValue(device, 0, CFSTR("HardwareModel"));
|
||||||
const char *hwmodel = CFStringGetCStringPtr(model, CFStringGetSystemEncoding());
|
const char *hwmodel = CFStringGetCStringPtr(model, CFStringGetSystemEncoding());
|
||||||
|
|
||||||
printf("-->Hardware model: %s\n", hwmodel);
|
|
||||||
|
|
||||||
if (hwmodel && !strcmp("M68AP", hwmodel))
|
if (hwmodel && !strcmp("M68AP", hwmodel))
|
||||||
return CFSTR("iPhone");
|
return CFSTR("iPhone");
|
||||||
if (hwmodel && !strcmp("N45AP", hwmodel))
|
if (hwmodel && !strcmp("N45AP", hwmodel))
|
||||||
@ -346,6 +344,8 @@ const CFStringRef get_device_hardware_name(const AMDeviceRef device) {
|
|||||||
return CFSTR("iPhone 5s (GSM)");
|
return CFSTR("iPhone 5s (GSM)");
|
||||||
if (hwmodel && !strcmp("N53AP", hwmodel))
|
if (hwmodel && !strcmp("N53AP", hwmodel))
|
||||||
return CFSTR("iPhone 5s (Global/CDMA)");
|
return CFSTR("iPhone 5s (Global/CDMA)");
|
||||||
|
if (hwmodel && !strcmp("N61AP", hwmodel))
|
||||||
|
return CFSTR("iPhone 6 (GSM)");
|
||||||
if (hwmodel && !strcmp("J1AP", hwmodel))
|
if (hwmodel && !strcmp("J1AP", hwmodel))
|
||||||
return CFSTR("iPad 3");
|
return CFSTR("iPad 3");
|
||||||
if (hwmodel && !strcmp("J2AP", hwmodel))
|
if (hwmodel && !strcmp("J2AP", hwmodel))
|
||||||
@ -367,7 +367,8 @@ const CFStringRef get_device_hardware_name(const AMDeviceRef device) {
|
|||||||
if (hwmodel && !strcmp("J33IAP", hwmodel))
|
if (hwmodel && !strcmp("J33IAP", hwmodel))
|
||||||
return CFSTR("Apple TV 3.1G");
|
return CFSTR("Apple TV 3.1G");
|
||||||
|
|
||||||
return CFSTR("Unknown Device");
|
return CFStringCreateWithFormat(NULL, NULL, CFSTR("%s"), hwmodel);
|
||||||
|
//return CFSTR("Unknown Device");
|
||||||
}
|
}
|
||||||
|
|
||||||
char * MYCFStringCopyUTF8String(CFStringRef aString) {
|
char * MYCFStringCopyUTF8String(CFStringRef aString) {
|
||||||
@ -393,28 +394,26 @@ CFStringRef get_device_full_name(const AMDeviceRef device) {
|
|||||||
device_name = NULL,
|
device_name = NULL,
|
||||||
model_name = NULL;
|
model_name = NULL;
|
||||||
|
|
||||||
kern_return_t ret = AMDeviceConnect(device);
|
AMDeviceConnect(device);
|
||||||
printf("-->AMDeviceConnect: %08x\n",ret);
|
|
||||||
|
|
||||||
device_name = AMDeviceCopyValue(device, 0, CFSTR("DeviceName")),
|
device_name = AMDeviceCopyValue(device, 0, CFSTR("DeviceName")),
|
||||||
model_name = get_device_hardware_name(device);
|
model_name = get_device_hardware_name(device);
|
||||||
|
|
||||||
printf("-->[%s] %ld\n",CFStringGetCStringPtr(device_name, CFStringGetSystemEncoding()), CFStringGetLength(device_name));
|
if (verbose)
|
||||||
printf("-->[%s] %ld\n",CFStringGetCStringPtr(device_name, kCFStringEncodingUTF8), CFStringGetLength(device_name));
|
{
|
||||||
printf("-->[%s] %ld\n",CFStringGetCStringPtr(model_name, CFStringGetSystemEncoding()), CFStringGetLength(model_name));
|
char *devName = MYCFStringCopyUTF8String(device_name);
|
||||||
printf("-->[%s] %ld\n",CFStringGetCStringPtr(device_udid, CFStringGetSystemEncoding()), CFStringGetLength(device_udid));
|
printf("Device Name:[%s]\n",devName);
|
||||||
|
CFShow(device_name);
|
||||||
CFShowStr(device_name);
|
printf("\n");
|
||||||
printf("-->[%s] bytes\n",MYCFStringCopyUTF8String(device_name));
|
free(devName);
|
||||||
|
}
|
||||||
if((device_name != NULL) && CFStringGetLength(device_name) > 0 && (model_name != NULL) && CFStringGetLength(model_name)>0)
|
|
||||||
|
if(device_name != NULL && model_name != NULL)
|
||||||
{
|
{
|
||||||
printf("In if\n");
|
|
||||||
full_name = CFStringCreateWithFormat(NULL, NULL, CFSTR("%@ '%@' (%@)"), model_name, device_name, device_udid);
|
full_name = CFStringCreateWithFormat(NULL, NULL, CFSTR("%@ '%@' (%@)"), model_name, device_name, device_udid);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf("In else: %s\n",CFStringGetCStringPtr(device_udid, CFStringGetSystemEncoding()));
|
|
||||||
full_name = CFStringCreateWithFormat(NULL, NULL, CFSTR("(%@ss)"), device_udid);
|
full_name = CFStringCreateWithFormat(NULL, NULL, CFSTR("(%@ss)"), device_udid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -427,7 +426,6 @@ CFStringRef get_device_full_name(const AMDeviceRef device) {
|
|||||||
if(model_name != NULL)
|
if(model_name != NULL)
|
||||||
CFRelease(model_name);
|
CFRelease(model_name);
|
||||||
|
|
||||||
printf("-->[%s]\n",CFStringGetCStringPtr(full_name, CFStringGetSystemEncoding()));
|
|
||||||
return full_name;
|
return full_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user