22

You should know that Android 4.2.2 (or just before) introduced RSA key checking for adb access. – The device asks now if you want to allow access.

To avoid asking every time, the computer presents an RSA key, which can be permanently accepted.

The dialog on the phone shows the RSA key fingerprint. – On Linux, the public/secret key pair is here: ~/.android/adbkey(.pub).

How can I show the fingerprint of that key file? (I’m looking for a command line to do that on the Linux system.)

3
  • This is also needed when trying to verify the RSA key fingerprint presented when enabling USB debugging. Sep 25, 2020 at 16:42
  • adb is usb debugging @JonathanCross Sep 25, 2020 at 22:39
  • Now the keywords "usb debugging" are inside this answer :-) Sep 29, 2020 at 16:17

3 Answers 3

27

This line will do it (found here):

awk '{print $1}' < ~/.android/adbkey.pub | openssl base64 -A -d -a | openssl md5 -c
2
  • 3
    awk '{print $1}' < ~/.android/adbkey.pub | base64 --decode | md5sum works as well Feb 23, 2019 at 8:02
  • how do I run this in windows Jun 12, 2021 at 5:36
0

Run:

echo {public key} | base64 --decode | md5sum 
0
0

On Android 5 and above, the hash function used was changed to sha256. If your hardware is such, your could try:

awk '{print $1}' < ~/.android/adbkey.pub | openssl base64 -A -d -a | openssl sha256 -c | awk '{print $2}'|tr '[:lower:]' '[:upper:]'
1
  • 5
    On Android 10 I am still getting MD5. Sep 25, 2020 at 16:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .