View Single Post
Old 01-31-2015, 03:18 AM   #3
ShellShock
Wizard
ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.
 
ShellShock's Avatar
 
Posts: 1,178
Karma: 2431850
Join Date: Sep 2008
Device: IPad Mini 2 Retina
The usbmuxd library (Windows & Linux).

In libusbmuxd.c, usbmuxd_get_device_list, add a check for product_id != 0, e.g., in the Windows version (Linux should be very similar):

Code:
got_device_list:

	// explicitly close connection
	UNLOCK;
	socket_close(sfd);

	// create copy of device info entries from collection
	newlist = (usbmuxd_device_info_t*)malloc(sizeof(usbmuxd_device_info_t) * (collection_count(&tmpdevs) + 1));
	dev_cnt = 0;
	FOREACH(usbmuxd_device_info_t *di, &tmpdevs, usbmuxd_device_info_t *) {
		/* Devices connected by WIFI or USB may be reported. Ignore any without a valid USB product_id, i.e., WIFI connected. */
		if (di && di->product_id != 0) {
			memcpy(&newlist[dev_cnt], di, sizeof(usbmuxd_device_info_t));
			free(di);
			dev_cnt++;
		}
	} ENDFOREACH
	collection_free(&tmpdevs);
I did investigate changing the Python code instead, but that is a lot more complex to do, mainly because (as I recall) the product_id is not propagated back up into the Python code, so it would have probably meant changing the libimobiledevice API.
ShellShock is offline   Reply With Quote