adb: Android serial numbers are not all 16 characters long, so accept other lengths.

I can't find any documentation of how long it should be. Hard to imagine
it being shorter than 4 characters though, so put that in as a conservative
lower bound.

This commit was sponsored by Nick Piper on Patreon.
This commit is contained in:
Joey Hess 2018-06-12 13:56:01 -04:00
parent 98168e8f2e
commit 90a3afb60f
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 14 additions and 1 deletions

View file

@ -236,7 +236,7 @@ enumerateAdbConnected =
where
parse l =
let (serial, desc) = separate (== '\t') l
in if null desc || length serial /= 16
in if null desc || length serial < 4
then Nothing
else Just (AndroidSerial serial)