MCPcopy Create free account
hub / github.com/danielpaulus/quicktime_video_hack / Correct24CharacterSerial

Function Correct24CharacterSerial

screencapture/discovery.go:241–247  ·  view source on GitHub ↗

Usually iosDevices have a 40 character USB serial which equals the usbSerial used in usbmuxd, Xcode etc. There is an exception, some devices like the Xr and Xs have a 24 character USB serial. Usbmux, Xcode etc. however insert a dash after the 8th character in this case. To be compatible with other M

(usbSerial string)

Source from the content-addressed store, hash-verified

239//however insert a dash after the 8th character in this case. To be compatible with other MacOS X and iOS tools,
240//we insert the dash here as well.
241func Correct24CharacterSerial(usbSerial string) string {
242 usbSerial = strings.Trim(usbSerial, "\x00")
243 if len(usbSerial) == 24 {
244 return fmt.Sprintf("%s-%s", usbSerial[0:8], usbSerial[8:])
245 }
246 return usbSerial
247}
248
249const sixteenTimesZero = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
250

Callers 2

checkDeviceIsPairedFunction · 0.92
DetailsMapMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected