25

I want to read the fingerprint of the computer. That fingerprint is shown when you connect it for the first time with your computer.

I googled a lot but I found nothing related. Do you have an idea or a helpful resource?

6
  • 4
    It seems that the keys are stored in /data/misc/adb/adb_keys.
    – rekire
    Commented Sep 2, 2014 at 14:24
  • 1
    The "fingerprint" is just an MD5 hash of the computer's public key, which is stored in ~/.android/adbkey.pub in base64 encoding.
    – Alex P.
    Commented Sep 2, 2014 at 22:40
  • @AlexP. I already read that, but I cannot read that file from the Android device.
    – rekire
    Commented Sep 3, 2014 at 5:26
  • 1
    This is handled internally by the adbd daemon, so there is nothing you can do without modifying it. The PC acts as a host, so you can't really send commands from Android either. If you want to identify the host, the host has to send you some identifier proactively as part of some protocol. Why do you need to identify the host anyway? Commented Dec 10, 2014 at 6:08
  • That was an idea for a developer backdoor, since some devices have bugs when using abd shell run-as. That idea was also restricted to debug builds.
    – rekire
    Commented Dec 10, 2014 at 6:12

2 Answers 2

39

Enter this in your terminal:

awk '{print $1}' < ~/.android/adbkey.pub | openssl base64 -A -d -a | openssl md5 -c

Works just as it should for me. =)

From: https://android.stackexchange.com/questions/50922/how-can-i-see-the-fingerprint-of-my-adbkey?newreg=7d7d931b67d442019d3ba60ed114be04

which references the original source: http://nelenkov.blogspot.de/2013/02/secure-usb-debugging-in-android-422.html

6
  • Please correct me but this code is run on the computer right? I'm asking out of view of the app (on the mobile). By the way did you read the comments below the question?
    – rekire
    Commented Dec 9, 2014 at 8:23
  • oops, my bad. Yeah, I did read the comments, but totally missed that you were doing this from your Android device. You could try the command in a terminal emulator on Android?
    – pd12
    Commented Dec 9, 2014 at 8:48
  • That is not possible. I basically want to know if a mobile is connected to a specific computer.
    – rekire
    Commented Dec 9, 2014 at 8:51
  • @scorpiodawg no. By the way the question would be a better place for this comment.
    – rekire
    Commented Jun 1, 2016 at 4:00
  • on modern hardware/software hash-function md5 is replaced with other, e.g sha256, also could try awk '{print $1}' < ~/.android/adbkey.pub | openssl base64 -A -d -a | openssl sha256 -c
    – Marisha
    Commented Sep 23, 2019 at 16:25
-1

On Android 5 and up as far as I know hash-function md5 is replaced with sha256, try:

awk '{print $1}' < ~/.android/adbkey.pub | openssl base64 -A -d -a | openssl sha256 -c | awk '{print $2}'|tr '[:lower:]' '[:upper:]'

1
  • Please read the question! I was asking to identify the computer from the mobile!
    – rekire
    Commented Sep 23, 2019 at 18:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.