google / python-adb

Python ADB + Fastboot implementation
Apache License 2.0
1.79k stars 357 forks source link

.android/adbkey missing #95

Open Vxer-Lee opened 6 years ago

Vxer-Lee commented 6 years ago

"pkg_resources.DistributionNotFound: The 'python-rsa' distribution was not found and is required by adb"

op.expanduser('~/.android/adbkey'))

File "/home/vxerlee/python-adb/adb/sign_m2crypto.py", line 24, in init with open(rsa_key_path + '.pub') as rsa_pub_file: IOError: [Errno 2] No such file or directory: '/home/vxerlee/.android/adbkey.pub'

fahhem commented 6 years ago

Hmm, python-rsa isn't depended on anywhere (just in the docs, will fix in master). You need rsa installed or M2Crypto or pycryptodome. It looks like you have M2Crypto installed, but no adbkey available. Typically, the adbkey is created by android's adb because it's not documented how else to create it.

Theoretically, it's a standard RSA private/public key pair, so if you find how to create it using the three libraries we support, then we can create the file when it doesn't exist rather than error out like we're doing now.

zgoda-mobica commented 6 years ago

I have similar problem - application is distributed in Docker container and runs almost completely isolated from host filesystem, we don't have even adb installed in host system so we're not able to run adb keygen <filename> to generate key pair. Now we either have to distribute pregenerated keys along with application data (I consider this viable only for dev/debug/test), or generate keys with android's adb in subprocess. It would be great if we had a command for this.

bibz commented 5 years ago

Isn't this a duplicate of #131 now?