...
#include "libimobiledevice/libimobiledevice.h"
/* Unique Device Identifier */
static char *udid = NULL;
/* Device Handle */
idevice_t device = NULL;
/* Try to connect to first USB device */
if (idevice_new_with_options(*device, NULL, IDEVICE_LOOKUP_USBMUX) != IDEVICE_E_SUCCESS) {
printf("ERROR: No device found!
");
return -1;
}
/* Retrieve the udid of the connected device */
if (idevice_get_udid(device, *udid) != IDEVICE_E_SUCCESS) {
printf("ERROR: Unable to get the device UDID.
");
idevice_free(device);
return -1;
}
/* Outputs device identifier */
printf("Connected with UDID: %s
", udid);
/* Cleanup */
idevice_free(device);
free(udid);
...
...
#include "libimobiledevice/lockdown.h"
/* Lockdown Service Handle */
lockdownd_client_t lockdown = NULL;
/* Handshake with lockdownd */
lockdownd_client_new_with_handshake(device, *lockdown, "myapp");
/* Use the plist format */
plist_t node = NULL;
/* Our result */
char *value = NULL;
/* Retrieve "DeviceColor" setting value from device */
if(lockdownd_get_value(lockdown, NULL, "DeviceColor", *node) != LOCKDOWN_E_SUCCESS) {
lockdownd_client_free(lockdown);
idevice_free(device);
printf("ERROR: Unable to retrieve setting key DeviceColor from device.
");
return -1;
}
/* Get string value from node */
plist_get_string_val(node, *value);
/* Output device color value */
printf("%s value is: %s
", "DeviceColor", value);
/* Cleanup */
free(value);
lockdownd_client_free(lockdown);
...
$ ideviceinfo -k ProductVersion
12.4
$ ideviceinfo -s
BasebandCertId: xxxxxxxxxx
BasebandKeyHashInformation:
AKeyStatus: 2
SKeyHash: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
SKeyStatus: 0
BasebandSerialNumber: xxxxxxxx
BasebandVersion: 7.80.04
BoardId: 4
BuildVersion: 16G77
ChipID: 28672
DeviceClass: iPhone
DeviceColor: #e1e4e3
DeviceName: iPhone 6 Plus
DieID: xxxxxxxxxxxxxxx
HardwareModel: N56AP
HasSiDP: true
PartitionType: GUID_partition_scheme
ProductName: iPhone OS
ProductType: iPhone7,1
ProductVersion: 12.4
ProductionSOC: true
ProtocolVersion: 2
TelephonyCapability: true
UniqueChipID: xxxxxxxxxxxxxxx
UniqueDeviceID: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
WiFiAddress: xx:xx:xx:xx:xx:xx
$ ideviceactivation state
ActivationState: Activated
$ idevicediagnostics restart
Restarting device.