diff options
author | Nikias Bassen | 2018-10-05 05:22:29 +0200 |
---|---|---|
committer | Nikias Bassen | 2018-10-05 05:22:29 +0200 |
commit | f838cf6dc212c779562984e8a16a4cedfc1d6daf (patch) | |
tree | 6eb2fb7d2658dc7694009e3bd4b16781d9ee291f | |
parent | 49576fdf06e3a7e3ef7824f29136556005f2239d (diff) | |
download | usbmuxd-f838cf6dc212c779562984e8a16a4cedfc1d6daf.tar.gz usbmuxd-f838cf6dc212c779562984e8a16a4cedfc1d6daf.tar.bz2 |
usb: Add hyphen to new style UDIDs introduced with iPhone XS/XR
-rw-r--r-- | src/usb.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -277,12 +277,19 @@ static void get_serial_callback(struct libusb_transfer *transfer) else usbdev->serial[di++] = data[si]; } - usbdev->serial[di] = 0; + usbdev->serial[di] = '\0'; usbmuxd_log(LL_INFO, "Got serial '%s' for device %d-%d", usbdev->serial, usbdev->bus, usbdev->address); libusb_free_transfer(transfer); + /* new style UDID: add hyphen between first 8 and following 16 digits */ + if (di == 24) { + memmove(&usbdev->serial[9], &usbdev->serial[8], 16); + usbdev->serial[8] = '-'; + usbdev->serial[di+1] = '\0'; + } + /* Finish setup now */ if(device_add(usbdev) < 0) { usb_disconnect(usbdev); |