From 90a3afb60fb04923ad2952d3d5d4d9529ef23f6c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 12 Jun 2018 13:56:01 -0400 Subject: [PATCH] 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. --- CHANGELOG | 2 ++ Remote/Adb.hs | 2 +- doc/bugs/git-annex_doesn__39__t_find_adb_device.mdwn | 1 + ...comment_1_56070e29ea7f19d24d4ff0f56adf08a0._comment | 10 ++++++++++ 4 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 doc/bugs/git-annex_doesn__39__t_find_adb_device/comment_1_56070e29ea7f19d24d4ff0f56adf08a0._comment diff --git a/CHANGELOG b/CHANGELOG index f702009131..45ed553d90 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,6 +9,8 @@ git-annex (6.20180530) UNRELEASED; urgency=medium is configured. * External special remotes can now add info to `git annex info $remote`, by replying to the GETINFO message. + * adb: Android serial numbers are not all 16 characters long, so accept + other lengths. -- Joey Hess Wed, 30 May 2018 11:49:08 -0400 diff --git a/Remote/Adb.hs b/Remote/Adb.hs index 32bbe605f7..f1e87013de 100644 --- a/Remote/Adb.hs +++ b/Remote/Adb.hs @@ -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) diff --git a/doc/bugs/git-annex_doesn__39__t_find_adb_device.mdwn b/doc/bugs/git-annex_doesn__39__t_find_adb_device.mdwn index ff8600ce1a..5a37559cc9 100644 --- a/doc/bugs/git-annex_doesn__39__t_find_adb_device.mdwn +++ b/doc/bugs/git-annex_doesn__39__t_find_adb_device.mdwn @@ -20,3 +20,4 @@ git-annex claims that adb does not list any devices. `adb devices` however shows upgrade supported from repository versions: 0 1 2 3 4 5 operating system: linux x86_64 +> [[fixed|done]] --[[Joey]] diff --git a/doc/bugs/git-annex_doesn__39__t_find_adb_device/comment_1_56070e29ea7f19d24d4ff0f56adf08a0._comment b/doc/bugs/git-annex_doesn__39__t_find_adb_device/comment_1_56070e29ea7f19d24d4ff0f56adf08a0._comment new file mode 100644 index 0000000000..f030295f5a --- /dev/null +++ b/doc/bugs/git-annex_doesn__39__t_find_adb_device/comment_1_56070e29ea7f19d24d4ff0f56adf08a0._comment @@ -0,0 +1,10 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2018-06-12T17:39:51Z" + content=""" +It's expecting a serial number 16 digits long, +and your adb is using a 12 digit one. I suppose this means that the length +can vary. Hopefully because of a difference in the android device and not +the version of adb. I'll change it to accept shorter serials. +"""]]