summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Robert Gadbois2018-03-21 15:06:22 +0100
committerGravatar Nikias Bassen2018-03-21 15:06:22 +0100
commitf37b592788bffcb9a70d211aef8b1f84751114ca (patch)
tree70e615aa7b6722d4f73e9fc370eacde0106bd842
parent739a34ce8c711f975151d2ae6ef1e575d0aed764 (diff)
downloadlibimobiledevice-f37b592788bffcb9a70d211aef8b1f84751114ca.tar.gz
libimobiledevice-f37b592788bffcb9a70d211aef8b1f84751114ca.tar.bz2
idevicediagnostics: Add ioregentry command to query device IORegistry by entry
Starting with iOS 9.1, querying IORegistry by plane stopped working. This commit will add a new command that allows querying by entry that will allow gathering data for devices with newer iOS versions again (including iOS 11).
-rw-r--r--tools/idevicediagnostics.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/tools/idevicediagnostics.c b/tools/idevicediagnostics.c
index 2ea986f..66e192f 100644
--- a/tools/idevicediagnostics.c
+++ b/tools/idevicediagnostics.c
@@ -40,7 +40,8 @@ enum cmd_mode {
CMD_SHUTDOWN,
CMD_DIAGNOSTICS,
CMD_MOBILEGESTALT,
- CMD_IOREGISTRY
+ CMD_IOREGISTRY,
+ CMD_IOREGISTRY_ENTRY
};
static void print_xml(plist_t node)
@@ -156,6 +157,15 @@ int main(int argc, char **argv)
}
continue;
}
+ else if (!strcmp(argv[i], "ioregentry")) {
+ cmd = CMD_IOREGISTRY_ENTRY;
+ /* read key */
+ i++;
+ if (argv[i]) {
+ cmd_arg = strdup(argv[i]);
+ }
+ continue;
+ }
else {
print_usage(argc, argv);
return 0;
@@ -232,6 +242,16 @@ int main(int argc, char **argv)
printf("Unable to query mobilegestalt keys.\n");
}
break;
+ case CMD_IOREGISTRY_ENTRY:
+ if (diagnostics_relay_query_ioregistry_entry(diagnostics_client, cmd_arg == NULL ? "": cmd_arg, "", &node) == DIAGNOSTICS_RELAY_E_SUCCESS) {
+ if (node) {
+ print_xml(node);
+ result = EXIT_SUCCESS;
+ }
+ } else {
+ printf("Unable to retrieve IORegistry from device.\n");
+ }
+ break;
case CMD_IOREGISTRY:
if (diagnostics_relay_query_ioregistry_plane(diagnostics_client, cmd_arg == NULL ? "": cmd_arg, &node) == DIAGNOSTICS_RELAY_E_SUCCESS) {
if (node) {
@@ -292,6 +312,7 @@ void print_usage(int argc, char **argv)
printf(" diagnostics [TYPE]\t\tprint diagnostics information from device by TYPE (All, WiFi, GasGauge, NAND)\n");
printf(" mobilegestalt KEY [...]\tprint mobilegestalt keys passed as arguments seperated by a space.\n");
printf(" ioreg [PLANE]\t\t\tprint IORegistry of device, optionally by PLANE (IODeviceTree, IOPower, IOService) (iOS 5+ only)\n");
+ printf(" ioregentry [KEY]\t\tprint IORegistry entry of device (AppleARMPMUCharger, ASPStorage, ...) (iOS 5+ only)\n");
printf(" shutdown\t\t\tshutdown device\n");
printf(" restart\t\t\trestart device\n");
printf(" sleep\t\t\t\tput device into sleep mode (disconnects from host)\n\n");