Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.
This repository was archived by the owner on Jan 10, 2023. It is now read-only.

RSA public keyfile - TypeError: can only concatenate str (not "bytes") to str #141

Open
@joeleong

Description

@joeleong
$ pyadb shell ls
Traceback (most recent call last):
  File "/usr/local/bin/pyadb", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/site-packages/adb/adb_debug.py", line 207, in main
    rsa_keys=[rsa_signer(path) for path in args.rsa_key_path])
  File "/usr/local/lib/python3.7/site-packages/adb/common_cli.py", line 151, in StartCli
    **device_kwargs)
  File "/usr/local/lib/python3.7/site-packages/adb/adb_commands.py", line 137, in ConnectDevice
    self._Connect(**kwargs)
  File "/usr/local/lib/python3.7/site-packages/adb/adb_commands.py", line 168, in _Connect
    conn_str = self.protocol_handler.Connect(self._handle, banner=banner, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/adb/adb_protocol.py", line 331, in Connect
    data=rsa_keys[0].GetPublicKey() + b'\0')
TypeError: can only concatenate str (not "bytes") to str

I assume this has to do with python3 compatibility as it seems to work fine on python2.
To repro you can seemingly connect to any device that doesn't already have your public key approved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions