Search code examples
androidadb

Android adb show "Allow USB debugging?" window


I am using Mobogenie software to backup data on my smartphone. When I do it, program invokes "Allow USB debugging?" window on my device, obviously via ADB. The question is - how? In the screenshot below (it is in Russian language)

enter image description here

button which is in red ellipse says: "Show this popup window again" and when I press it, my device shows "Allow USB debugging?" window. But i couldn't find any useful information about how to do the same thing - with ADB (which command should I use) or any other way. Maybe sombody got an idea? Or is there any way to kind of trace commands or find out how this progrom does it?


Solution

  • ADB Secure device authorizations are stored in a whitelist located here: /data/misc/adb/adb_keys

    There's no way to remove RSA keys from the whitelist without having root access.

    Having said that... If you do not "Allow USB Debugging" when that window pops up (by pressing cancel) or if you do not check the box that says "Always allow from this computer", then the RSA key is not stored in the whitelist. By running adb kill-server and then adb start-server, it forces a new check of the connected computer's RSA key.

    My guess is that the button that is circled is there basically just kills and restarts the ADB server to have the popup come back, in case the user did not "Always allow" or if they Cancelled the request.

    EDIT: I see that Mobogenie also includes a "one click root" feature... As sketchy as that sounds, if your device is rooted, then Mobogenie could be deleting your computer's stored key from your whitelist. As for this theory, there are multiple methods - one being simply doing a pure delete:

    adb start-server
    adb shell
    cd /data/misc/adb
    rm abd_keys
    exit
    adb kill-server
    adb start-server