Giter Club home page Giter Club logo

xiaomi-cloud-tokens-extractor's Introduction

GitHub Latest Release GitHub All Releases Ko-Fi buycoffee.to PayPal.Me Revolut.Me

Xiaomi Cloud Tokens Extractor

This tool/script retrieves tokens for all devices connected to Xiaomi cloud and encryption keys for BLE devices.

You will need to provide Xiaomi Home credentials (not ones from Roborock app):

  • username (e-mail or Xiaomi Cloud account ID)
  • password
  • Xiaomi's server region (cn - China, de - Germany etc.). Leave empty to check all available

In return all of your devices connected to account will be listed, together with their name and IP address.

Windows

Download and run token_extractor.exe.

Linux & Home Assistant (in SSH & Web Terminal)

Execute following command:

bash <(curl -L https://github.com/PiotrMachowski/Xiaomi-cloud-tokens-extractor/raw/master/run.sh)

If installation fails try Docker version

Docker & Home Assistant (in SSH & Web Terminal)

Execute following command:

bash <(curl -L https://github.com/PiotrMachowski/Xiaomi-cloud-tokens-extractor/raw/master/run_docker.sh)

To run this command in HA you have to disable protected mode in addon's settings and restart it

Manual run in python

Download and unpack archive:

wget https://github.com/PiotrMachowski/Xiaomi-cloud-tokens-extractor/releases/latest/download/token_extractor.zip
unzip token_extractor.zip
cd token_extractor

Install dependencies and run script:

pip3 install -r requirements.txt
python3 token_extractor.py

Troubleshooting

If you have problems with using this tool try following solutions:

  • Make yourself sure that you provide correct credentials (e.g. not ones from Roborock app!)
  • Remove Cloudflare DNS
  • Disable network ad blockers (AdGuard, PiHole, etc.) and restrictions (UniFi Country Restriction etc.)
  • Open 2FA link on the same device that runs Tokens Extractor

Home Assistant additional tools

Support

If you want to support my work with a donation you can use one of the following platforms:

Platform Payment methods Link Comment
Ko-fi
  • PayPal
  • Credit card
  • Buy Me a Coffee at ko-fi.com
  • No fees
  • Single or monthly payment
  • buycoffee.to
  • BLIK
  • Bank transfer
  • Postaw mi kawę na buycoffee.to
    PayPal
  • PayPal
  • PayPal Logo
  • No fees
  • Revolut
  • Revolut
  • Credit Card
  • Revolut
  • No fees
  • xiaomi-cloud-tokens-extractor's People

    Stargazers

     avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

    Watchers

     avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

    xiaomi-cloud-tokens-extractor's Issues

    SyntaxError: invalid syntax on return line 152

    Hello !

    I want to use this script on my Debian 9 and this is what happened when I run this
    `python token_extractor.py

    File "token_extractor.py", line 152
    return f"Android-7.1.1-1.0.0-ONEPLUS A3010-136-{agent_id} APP/xiaomi.smarthome APPV/62830"
    SyntaxError: invalid syntax`

    Can you help me ? Thank you

    error

    I get this error, what could be happening? before it worked fine for me

    [email protected]'s password: 
    
    | |  | |                          /\           (_)   | |            | |  
    | |__| | ___  _ __ ___   ___     /  \   ___ ___ _ ___| |_ __ _ _ __ | |_ 
    |  __  |/ _ \| '_ \ _ \ / _ \   / /\ \ / __/ __| / __| __/ _\ | '_ \| __|
    | |  | | (_) | | | | | |  __/  / ____ \\__ \__ \ \__ \ || (_| | | | | |_ 
    |_|  |_|\___/|_| |_| |_|\___| /_/    \_\___/___/_|___/\__\__,_|_| |_|\__|
    
    Welcome to the Home Assistant command line.
    
    System information
      IPv4 addresses for eno1:  192.168.1.161/24
      IPv6 addresses for eno1:  fe80::e2fb:ccdb:2a3:9284/64
      IPv4 addresses for wlp2s0: 
    
      OS Version:               Home Assistant OS 7.4
      Home Assistant Core:      2022.2.9
    
      Home Assistant URL:       http://homeassistant.local:8123
      Observer URL:             http://homeassistant.local:4357
    ➜  ~ wget https://github.com/PiotrMachowski/Xiaomi-cloud-tokens-extractor/releases/latest/download/token_extractor.zip
    --2022-03-05 19:25:10--  https://github.com/PiotrMachowski/Xiaomi-cloud-tokens-extractor/releases/latest/download/token_extractor.zip
    Resolving github.com (github.com)... 140.82.121.3
    Connecting to github.com (github.com)|140.82.121.3|:443... connected.
    HTTP request sent, awaiting response... 302 Found
    Location: https://github.com/PiotrMachowski/Xiaomi-cloud-tokens-extractor/releases/download/v1.1.2/token_extractor.zip [following]
    --2022-03-05 19:25:11--  https://github.com/PiotrMachowski/Xiaomi-cloud-tokens-extractor/releases/download/v1.1.2/token_extractor.zip
    Reusing existing connection to github.com:443.
    HTTP request sent, awaiting response... 302 Found
    Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/306357657/654f469e-1963-419d-b333-1377ce96cda4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220305%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220305T182511Z&X-Amz-Expires=300&X-Amz-Signature=913b9158f4e746877621de63c23e214f08c12668fde15178448b3351851a0e7f&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=306357657&response-content-disposition=attachment%3B%20filename%3Dtoken_extractor.zip&response-content-type=application%2Foctet-stream [following]
    --2022-03-05 19:25:11--  https://objects.githubusercontent.com/github-production-release-asset-2e65be/306357657/654f469e-1963-419d-b333-1377ce96cda4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220305%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220305T182511Z&X-Amz-Expires=300&X-Amz-Signature=913b9158f4e746877621de63c23e214f08c12668fde15178448b3351851a0e7f&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=306357657&response-content-disposition=attachment%3B%20filename%3Dtoken_extractor.zip&response-content-type=application%2Foctet-stream
    Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.110.133, 185.199.111.133, 185.199.108.133, ...
    Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.110.133|:443... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 3583 (3.5K) [application/octet-stream]
    Saving to: 'token_extractor.zip'
    
    token_extractor.zip 100%[===================>]   3.50K  --.-KB/s    in 0s      
    
    2022-03-05 19:25:11 (27.7 MB/s) - 'token_extractor.zip' saved [3583/3583]
    
    ➜  ~ unzip token_extractor.zip
    
    Archive:  token_extractor.zip
       creating: token_extractor/
      inflating: token_extractor/token_extractor.py  
     extracting: token_extractor/requirements.txt  
    ➜  ~ ls
    addons               media                token_extractor
    backup               share                token_extractor.zip
    config               ssl
    ➜  ~ cd token_extractor 
    ➜  token_extractor ls
    requirements.txt    token_extractor.py
    ➜  token_extractor pip3 install -r requirements.txt
    Requirement already satisfied: requests in /usr/lib/python3.9/site-packages (from -r requirements.txt (line 1)) (2.26.0)
    Collecting pycryptodome
      Using cached pycryptodome-3.14.1.tar.gz (3.4 MB)
    Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/lib/python3.9/site-packages (from requests->-r requirements.txt (line 1)) (1.26.7)
    Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3.9/site-packages (from requests->-r requirements.txt (line 1)) (2020.12.5)
    Requirement already satisfied: charset_normalizer~=2.0.0 in /usr/lib/python3.9/site-packages (from requests->-r requirements.txt (line 1)) (2.0.7)
    Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3.9/site-packages (from requests->-r requirements.txt (line 1)) (3.3)
    Using legacy 'setup.py install' for pycryptodome, since package 'wheel' is not installed.
    Installing collected packages: pycryptodome
        Running setup.py install for pycryptodome ... error
        ERROR: Command errored out with exit status 1:
         command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-k932ymfz/pycryptodome_bfe6feffa58f4983bc5596378d34efe5/setup.py'"'"'; __file__='"'"'/tmp/pip-install-k932ymfz/pycryptodome_bfe6feffa58f4983bc5596378d34efe5/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-0o9ecvkw/install-record.txt --single-version-externally-managed --compile --install-headers /usr/include/python3.9/pycryptodome
             cwd: /tmp/pip-install-k932ymfz/pycryptodome_bfe6feffa58f4983bc5596378d34efe5/
        Complete output (328 lines):
        Testing support for clang
        Target does not support clang
        Testing support for gcc
        Target does not support gcc
        Testing support for stdint.h header
        Target does not support stdint.h header
        Testing support for 128-bit integer
        Target does not support 128-bit integer
        Testing support for cpuid.h header
        Target does not support cpuid.h header
        Testing support for intrin.h header
        Target does not support intrin.h header
        Testing support for posix_memalign
        Target does not support posix_memalign
        Testing support for memalign
        Target does not support memalign
        Testing support for SSE2(intrin.h)
        Target does not support SSE2(intrin.h)
        Testing support for SSE2(x86intrin.h)
        Target does not support SSE2(x86intrin.h)
        Testing support for SSE2(emmintrin.h)
        Target does not support SSE2(emmintrin.h)
        Warning: compiler does not support AESNI instructions
        Warning: compiler does not support CLMUL instructions
        running install
        running build
        running build_py
        creating build/lib.linux-x86_64-3.9
        creating build/lib.linux-x86_64-3.9/Crypto
        copying lib/Crypto/__init__.py -> build/lib.linux-x86_64-3.9/Crypto
        creating build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/AES.py -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/ChaCha20.py -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/_mode_cbc.py -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/_mode_cfb.py -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/_EKSBlowfish.py -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/_mode_gcm.py -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/_mode_ecb.py -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/Salsa20.py -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/Blowfish.py -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/_mode_ocb.py -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/ARC2.py -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/_mode_ctr.py -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/CAST.py -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/DES.py -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/ARC4.py -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/_mode_openpgp.py -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/ChaCha20_Poly1305.py -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/PKCS1_OAEP.py -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/__init__.py -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/DES3.py -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/_mode_siv.py -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/_mode_ccm.py -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/_mode_eax.py -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/PKCS1_v1_5.py -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/_mode_ofb.py -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        creating build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/KangarooTwelve.py -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/RIPEMD160.py -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/SHA3_384.py -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/SHA.py -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/SHA384.py -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/MD4.py -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/keccak.py -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/SHA224.py -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/MD5.py -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/BLAKE2b.py -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/MD2.py -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/SHAKE256.py -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/TupleHash128.py -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/SHA256.py -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/__init__.py -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/SHA3_512.py -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/TupleHash256.py -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/KMAC128.py -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/SHA3_256.py -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/KMAC256.py -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/SHA1.py -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/CMAC.py -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/BLAKE2s.py -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/cSHAKE128.py -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/cSHAKE256.py -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/SHA3_224.py -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/SHA512.py -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/RIPEMD.py -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/HMAC.py -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/SHAKE128.py -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/Poly1305.py -> build/lib.linux-x86_64-3.9/Crypto/Hash
        creating build/lib.linux-x86_64-3.9/Crypto/IO
        copying lib/Crypto/IO/PKCS8.py -> build/lib.linux-x86_64-3.9/Crypto/IO
        copying lib/Crypto/IO/__init__.py -> build/lib.linux-x86_64-3.9/Crypto/IO
        copying lib/Crypto/IO/PEM.py -> build/lib.linux-x86_64-3.9/Crypto/IO
        copying lib/Crypto/IO/_PBES.py -> build/lib.linux-x86_64-3.9/Crypto/IO
        creating build/lib.linux-x86_64-3.9/Crypto/PublicKey
        copying lib/Crypto/PublicKey/_openssh.py -> build/lib.linux-x86_64-3.9/Crypto/PublicKey
        copying lib/Crypto/PublicKey/RSA.py -> build/lib.linux-x86_64-3.9/Crypto/PublicKey
        copying lib/Crypto/PublicKey/__init__.py -> build/lib.linux-x86_64-3.9/Crypto/PublicKey
        copying lib/Crypto/PublicKey/DSA.py -> build/lib.linux-x86_64-3.9/Crypto/PublicKey
        copying lib/Crypto/PublicKey/ECC.py -> build/lib.linux-x86_64-3.9/Crypto/PublicKey
        copying lib/Crypto/PublicKey/ElGamal.py -> build/lib.linux-x86_64-3.9/Crypto/PublicKey
        creating build/lib.linux-x86_64-3.9/Crypto/Protocol
        copying lib/Crypto/Protocol/KDF.py -> build/lib.linux-x86_64-3.9/Crypto/Protocol
        copying lib/Crypto/Protocol/__init__.py -> build/lib.linux-x86_64-3.9/Crypto/Protocol
        copying lib/Crypto/Protocol/SecretSharing.py -> build/lib.linux-x86_64-3.9/Crypto/Protocol
        creating build/lib.linux-x86_64-3.9/Crypto/Random
        copying lib/Crypto/Random/__init__.py -> build/lib.linux-x86_64-3.9/Crypto/Random
        copying lib/Crypto/Random/random.py -> build/lib.linux-x86_64-3.9/Crypto/Random
        creating build/lib.linux-x86_64-3.9/Crypto/Signature
        copying lib/Crypto/Signature/DSS.py -> build/lib.linux-x86_64-3.9/Crypto/Signature
        copying lib/Crypto/Signature/pkcs1_15.py -> build/lib.linux-x86_64-3.9/Crypto/Signature
        copying lib/Crypto/Signature/__init__.py -> build/lib.linux-x86_64-3.9/Crypto/Signature
        copying lib/Crypto/Signature/PKCS1_PSS.py -> build/lib.linux-x86_64-3.9/Crypto/Signature
        copying lib/Crypto/Signature/pss.py -> build/lib.linux-x86_64-3.9/Crypto/Signature
        copying lib/Crypto/Signature/PKCS1_v1_5.py -> build/lib.linux-x86_64-3.9/Crypto/Signature
        creating build/lib.linux-x86_64-3.9/Crypto/Util
        copying lib/Crypto/Util/py3compat.py -> build/lib.linux-x86_64-3.9/Crypto/Util
        copying lib/Crypto/Util/strxor.py -> build/lib.linux-x86_64-3.9/Crypto/Util
        copying lib/Crypto/Util/_file_system.py -> build/lib.linux-x86_64-3.9/Crypto/Util
        copying lib/Crypto/Util/RFC1751.py -> build/lib.linux-x86_64-3.9/Crypto/Util
        copying lib/Crypto/Util/asn1.py -> build/lib.linux-x86_64-3.9/Crypto/Util
        copying lib/Crypto/Util/Padding.py -> build/lib.linux-x86_64-3.9/Crypto/Util
        copying lib/Crypto/Util/__init__.py -> build/lib.linux-x86_64-3.9/Crypto/Util
        copying lib/Crypto/Util/number.py -> build/lib.linux-x86_64-3.9/Crypto/Util
        copying lib/Crypto/Util/_cpu_features.py -> build/lib.linux-x86_64-3.9/Crypto/Util
        copying lib/Crypto/Util/_raw_api.py -> build/lib.linux-x86_64-3.9/Crypto/Util
        copying lib/Crypto/Util/Counter.py -> build/lib.linux-x86_64-3.9/Crypto/Util
        creating build/lib.linux-x86_64-3.9/Crypto/Math
        copying lib/Crypto/Math/_IntegerBase.py -> build/lib.linux-x86_64-3.9/Crypto/Math
        copying lib/Crypto/Math/Numbers.py -> build/lib.linux-x86_64-3.9/Crypto/Math
        copying lib/Crypto/Math/__init__.py -> build/lib.linux-x86_64-3.9/Crypto/Math
        copying lib/Crypto/Math/_IntegerGMP.py -> build/lib.linux-x86_64-3.9/Crypto/Math
        copying lib/Crypto/Math/_IntegerNative.py -> build/lib.linux-x86_64-3.9/Crypto/Math
        copying lib/Crypto/Math/_IntegerCustom.py -> build/lib.linux-x86_64-3.9/Crypto/Math
        copying lib/Crypto/Math/Primality.py -> build/lib.linux-x86_64-3.9/Crypto/Math
        creating build/lib.linux-x86_64-3.9/Crypto/SelfTest
        copying lib/Crypto/SelfTest/st_common.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest
        copying lib/Crypto/SelfTest/__init__.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest
        copying lib/Crypto/SelfTest/__main__.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest
        copying lib/Crypto/SelfTest/loader.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest
        creating build/lib.linux-x86_64-3.9/Crypto/SelfTest/Cipher
        copying lib/Crypto/SelfTest/Cipher/test_CBC.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Cipher
        copying lib/Crypto/SelfTest/Cipher/test_EAX.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Cipher
        copying lib/Crypto/SelfTest/Cipher/test_Blowfish.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Cipher
        copying lib/Crypto/SelfTest/Cipher/test_CAST.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Cipher
        copying lib/Crypto/SelfTest/Cipher/test_CCM.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Cipher
        copying lib/Crypto/SelfTest/Cipher/test_pkcs1_oaep.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Cipher
        copying lib/Crypto/SelfTest/Cipher/test_OpenPGP.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Cipher
        copying lib/Crypto/SelfTest/Cipher/test_OCB.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Cipher
        copying lib/Crypto/SelfTest/Cipher/test_pkcs1_15.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Cipher
        copying lib/Crypto/SelfTest/Cipher/test_Salsa20.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Cipher
        copying lib/Crypto/SelfTest/Cipher/test_DES.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Cipher
        copying lib/Crypto/SelfTest/Cipher/__init__.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Cipher
        copying lib/Crypto/SelfTest/Cipher/test_CTR.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Cipher
        copying lib/Crypto/SelfTest/Cipher/test_ARC2.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Cipher
        copying lib/Crypto/SelfTest/Cipher/test_ChaCha20.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Cipher
        copying lib/Crypto/SelfTest/Cipher/test_DES3.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Cipher
        copying lib/Crypto/SelfTest/Cipher/test_ChaCha20_Poly1305.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Cipher
        copying lib/Crypto/SelfTest/Cipher/test_GCM.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Cipher
        copying lib/Crypto/SelfTest/Cipher/test_ARC4.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Cipher
        copying lib/Crypto/SelfTest/Cipher/test_OFB.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Cipher
        copying lib/Crypto/SelfTest/Cipher/test_SIV.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Cipher
        copying lib/Crypto/SelfTest/Cipher/test_AES.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Cipher
        copying lib/Crypto/SelfTest/Cipher/common.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Cipher
        copying lib/Crypto/SelfTest/Cipher/test_CFB.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Cipher
        creating build/lib.linux-x86_64-3.9/Crypto/SelfTest/Hash
        copying lib/Crypto/SelfTest/Hash/test_MD2.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Hash
        copying lib/Crypto/SelfTest/Hash/test_BLAKE2.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Hash
        copying lib/Crypto/SelfTest/Hash/test_TupleHash.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Hash
        copying lib/Crypto/SelfTest/Hash/test_HMAC.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Hash
        copying lib/Crypto/SelfTest/Hash/test_SHA3_224.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Hash
        copying lib/Crypto/SelfTest/Hash/test_Poly1305.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Hash
        copying lib/Crypto/SelfTest/Hash/test_SHA512.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Hash
        copying lib/Crypto/SelfTest/Hash/test_SHA3_384.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Hash
        copying lib/Crypto/SelfTest/Hash/test_KangarooTwelve.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Hash
        copying lib/Crypto/SelfTest/Hash/test_keccak.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Hash
        copying lib/Crypto/SelfTest/Hash/__init__.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Hash
        copying lib/Crypto/SelfTest/Hash/test_SHA3_256.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Hash
        copying lib/Crypto/SelfTest/Hash/test_SHA224.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Hash
        copying lib/Crypto/SelfTest/Hash/test_SHA256.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Hash
        copying lib/Crypto/SelfTest/Hash/test_SHAKE.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Hash
        copying lib/Crypto/SelfTest/Hash/test_RIPEMD160.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Hash
        copying lib/Crypto/SelfTest/Hash/test_SHA384.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Hash
        copying lib/Crypto/SelfTest/Hash/test_KMAC.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Hash
        copying lib/Crypto/SelfTest/Hash/test_MD5.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Hash
        copying lib/Crypto/SelfTest/Hash/test_CMAC.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Hash
        copying lib/Crypto/SelfTest/Hash/test_cSHAKE.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Hash
        copying lib/Crypto/SelfTest/Hash/test_MD4.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Hash
        copying lib/Crypto/SelfTest/Hash/common.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Hash
        copying lib/Crypto/SelfTest/Hash/test_SHA3_512.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Hash
        copying lib/Crypto/SelfTest/Hash/test_SHA1.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Hash
        creating build/lib.linux-x86_64-3.9/Crypto/SelfTest/IO
        copying lib/Crypto/SelfTest/IO/test_PBES.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/IO
        copying lib/Crypto/SelfTest/IO/__init__.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/IO
        copying lib/Crypto/SelfTest/IO/test_PKCS8.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/IO
        creating build/lib.linux-x86_64-3.9/Crypto/SelfTest/Protocol
        copying lib/Crypto/SelfTest/Protocol/test_KDF.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Protocol
        copying lib/Crypto/SelfTest/Protocol/test_rfc1751.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Protocol
        copying lib/Crypto/SelfTest/Protocol/test_SecretSharing.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Protocol
        copying lib/Crypto/SelfTest/Protocol/__init__.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Protocol
        creating build/lib.linux-x86_64-3.9/Crypto/SelfTest/PublicKey
        copying lib/Crypto/SelfTest/PublicKey/test_DSA.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/PublicKey
        copying lib/Crypto/SelfTest/PublicKey/test_RSA.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/PublicKey
        copying lib/Crypto/SelfTest/PublicKey/test_ElGamal.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/PublicKey
        copying lib/Crypto/SelfTest/PublicKey/__init__.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/PublicKey
        copying lib/Crypto/SelfTest/PublicKey/test_import_RSA.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/PublicKey
        copying lib/Crypto/SelfTest/PublicKey/test_ECC.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/PublicKey
        copying lib/Crypto/SelfTest/PublicKey/test_import_DSA.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/PublicKey
        copying lib/Crypto/SelfTest/PublicKey/test_import_ECC.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/PublicKey
        creating build/lib.linux-x86_64-3.9/Crypto/SelfTest/Random
        copying lib/Crypto/SelfTest/Random/__init__.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Random
        copying lib/Crypto/SelfTest/Random/test_random.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Random
        creating build/lib.linux-x86_64-3.9/Crypto/SelfTest/Signature
        copying lib/Crypto/SelfTest/Signature/test_pkcs1_15.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Signature
        copying lib/Crypto/SelfTest/Signature/__init__.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Signature
        copying lib/Crypto/SelfTest/Signature/test_pss.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Signature
        copying lib/Crypto/SelfTest/Signature/test_dss.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Signature
        creating build/lib.linux-x86_64-3.9/Crypto/SelfTest/Util
        copying lib/Crypto/SelfTest/Util/test_strxor.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Util
        copying lib/Crypto/SelfTest/Util/test_rfc1751.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Util
        copying lib/Crypto/SelfTest/Util/__init__.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Util
        copying lib/Crypto/SelfTest/Util/test_Counter.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Util
        copying lib/Crypto/SelfTest/Util/test_number.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Util
        copying lib/Crypto/SelfTest/Util/test_asn1.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Util
        copying lib/Crypto/SelfTest/Util/test_Padding.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Util
        creating build/lib.linux-x86_64-3.9/Crypto/SelfTest/Math
        copying lib/Crypto/SelfTest/Math/test_Primality.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Math
        copying lib/Crypto/SelfTest/Math/test_Numbers.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Math
        copying lib/Crypto/SelfTest/Math/__init__.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Math
        copying lib/Crypto/SelfTest/Math/test_modexp.py -> build/lib.linux-x86_64-3.9/Crypto/SelfTest/Math
        copying lib/Crypto/py.typed -> build/lib.linux-x86_64-3.9/Crypto
        copying lib/Crypto/__init__.pyi -> build/lib.linux-x86_64-3.9/Crypto
        copying lib/Crypto/Cipher/ChaCha20_Poly1305.pyi -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/_mode_eax.pyi -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/_mode_ofb.pyi -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/_mode_cbc.pyi -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/DES.pyi -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/_mode_ocb.pyi -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/ChaCha20.pyi -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/_mode_ecb.pyi -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/_EKSBlowfish.pyi -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/AES.pyi -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/_mode_ccm.pyi -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/ARC4.pyi -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/_mode_openpgp.pyi -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/PKCS1_v1_5.pyi -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/_mode_siv.pyi -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/PKCS1_OAEP.pyi -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/_mode_gcm.pyi -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/DES3.pyi -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/ARC2.pyi -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/Salsa20.pyi -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/Blowfish.pyi -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/__init__.pyi -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/_mode_cfb.pyi -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/_mode_ctr.pyi -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Cipher/CAST.pyi -> build/lib.linux-x86_64-3.9/Crypto/Cipher
        copying lib/Crypto/Hash/SHA1.pyi -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/SHA3_512.pyi -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/TupleHash256.pyi -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/KangarooTwelve.pyi -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/cSHAKE128.pyi -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/BLAKE2s.pyi -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/KMAC128.pyi -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/CMAC.pyi -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/MD2.pyi -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/MD5.pyi -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/TupleHash128.pyi -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/BLAKE2b.pyi -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/keccak.pyi -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/cSHAKE256.pyi -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/KMAC256.pyi -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/SHAKE128.pyi -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/SHA.pyi -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/SHAKE256.pyi -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/SHA3_256.pyi -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/RIPEMD.pyi -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/HMAC.pyi -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/SHA384.pyi -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/MD4.pyi -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/SHA224.pyi -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/SHA3_224.pyi -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/SHA3_384.pyi -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/SHA256.pyi -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/SHA512.pyi -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/Poly1305.pyi -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/__init__.pyi -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/Hash/RIPEMD160.pyi -> build/lib.linux-x86_64-3.9/Crypto/Hash
        copying lib/Crypto/IO/PEM.pyi -> build/lib.linux-x86_64-3.9/Crypto/IO
        copying lib/Crypto/IO/_PBES.pyi -> build/lib.linux-x86_64-3.9/Crypto/IO
        copying lib/Crypto/IO/PKCS8.pyi -> build/lib.linux-x86_64-3.9/Crypto/IO
        copying lib/Crypto/PublicKey/ECC.pyi -> build/lib.linux-x86_64-3.9/Crypto/PublicKey
        copying lib/Crypto/PublicKey/_openssh.pyi -> build/lib.linux-x86_64-3.9/Crypto/PublicKey
        copying lib/Crypto/PublicKey/ElGamal.pyi -> build/lib.linux-x86_64-3.9/Crypto/PublicKey
        copying lib/Crypto/PublicKey/DSA.pyi -> build/lib.linux-x86_64-3.9/Crypto/PublicKey
        copying lib/Crypto/PublicKey/RSA.pyi -> build/lib.linux-x86_64-3.9/Crypto/PublicKey
        copying lib/Crypto/PublicKey/__init__.pyi -> build/lib.linux-x86_64-3.9/Crypto/PublicKey
        copying lib/Crypto/Protocol/SecretSharing.pyi -> build/lib.linux-x86_64-3.9/Crypto/Protocol
        copying lib/Crypto/Protocol/__init__.pyi -> build/lib.linux-x86_64-3.9/Crypto/Protocol
        copying lib/Crypto/Protocol/KDF.pyi -> build/lib.linux-x86_64-3.9/Crypto/Protocol
        copying lib/Crypto/Random/random.pyi -> build/lib.linux-x86_64-3.9/Crypto/Random
        copying lib/Crypto/Random/__init__.pyi -> build/lib.linux-x86_64-3.9/Crypto/Random
        copying lib/Crypto/Signature/pkcs1_15.pyi -> build/lib.linux-x86_64-3.9/Crypto/Signature
        copying lib/Crypto/Signature/PKCS1_PSS.pyi -> build/lib.linux-x86_64-3.9/Crypto/Signature
        copying lib/Crypto/Signature/pss.pyi -> build/lib.linux-x86_64-3.9/Crypto/Signature
        copying lib/Crypto/Signature/DSS.pyi -> build/lib.linux-x86_64-3.9/Crypto/Signature
        copying lib/Crypto/Signature/PKCS1_v1_5.pyi -> build/lib.linux-x86_64-3.9/Crypto/Signature
        copying lib/Crypto/Util/Padding.pyi -> build/lib.linux-x86_64-3.9/Crypto/Util
        copying lib/Crypto/Util/RFC1751.pyi -> build/lib.linux-x86_64-3.9/Crypto/Util
        copying lib/Crypto/Util/asn1.pyi -> build/lib.linux-x86_64-3.9/Crypto/Util
        copying lib/Crypto/Util/_file_system.pyi -> build/lib.linux-x86_64-3.9/Crypto/Util
        copying lib/Crypto/Util/py3compat.pyi -> build/lib.linux-x86_64-3.9/Crypto/Util
        copying lib/Crypto/Util/_cpu_features.pyi -> build/lib.linux-x86_64-3.9/Crypto/Util
        copying lib/Crypto/Util/number.pyi -> build/lib.linux-x86_64-3.9/Crypto/Util
        copying lib/Crypto/Util/_raw_api.pyi -> build/lib.linux-x86_64-3.9/Crypto/Util
        copying lib/Crypto/Util/Counter.pyi -> build/lib.linux-x86_64-3.9/Crypto/Util
        copying lib/Crypto/Util/strxor.pyi -> build/lib.linux-x86_64-3.9/Crypto/Util
        copying lib/Crypto/Math/Numbers.pyi -> build/lib.linux-x86_64-3.9/Crypto/Math
        copying lib/Crypto/Math/Primality.pyi -> build/lib.linux-x86_64-3.9/Crypto/Math
        copying lib/Crypto/Math/_IntegerGMP.pyi -> build/lib.linux-x86_64-3.9/Crypto/Math
        copying lib/Crypto/Math/_IntegerNative.pyi -> build/lib.linux-x86_64-3.9/Crypto/Math
        copying lib/Crypto/Math/_IntegerCustom.pyi -> build/lib.linux-x86_64-3.9/Crypto/Math
        copying lib/Crypto/Math/_IntegerBase.pyi -> build/lib.linux-x86_64-3.9/Crypto/Math
        running build_ext
        building 'Crypto.Hash._MD2' extension
        creating build/temp.linux-x86_64-3.9
        creating build/temp.linux-x86_64-3.9/src
        gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fomit-frame-pointer -g -fno-semantic-interposition -fomit-frame-pointer -g -fno-semantic-interposition -fomit-frame-pointer -g -fno-semantic-interposition -DTHREAD_STACK_SIZE=0x100000 -fPIC -DPYCRYPTO_LITTLE_ENDIAN -DSYS_BITS=64 -DLTC_NO_ASM -Isrc/ -I/usr/include/python3.9 -c src/MD2.c -o build/temp.linux-x86_64-3.9/src/MD2.o
        error: command 'gcc' failed: No such file or directory
        ----------------------------------------
    ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-k932ymfz/pycryptodome_bfe6feffa58f4983bc5596378d34efe5/setup.py'"'"'; __file__='"'"'/tmp/pip-install-k932ymfz/pycryptodome_bfe6feffa58f4983bc5596378d34efe5/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-0o9ecvkw/install-record.txt --single-version-externally-managed --compile --install-headers /usr/include/python3.9/pycryptodome Check the logs for full command output.
    

    No support for second houses / shared houses

    In my xiaomi app I have two houses. The device I was searching for is in the second house. However, the script does not find it. I moved the device in the first house device group, and it worked. So maybe there is a way to check in all houses in this script.

    Use curl instead of wget

    Readme page specifies the use of curl to download docker run script but then the script itself makes use of wget.

    bash <(curl -L https://github.com/PiotrMachowski/Xiaomi-cloud-tokens-extractor/raw/master/run.sh)
    

    It makes no sense to demand that users have both tools installed. I, for one, don't have wget installed.

    Solution for Errors: Max retries exceeded with url, ConnectTimeoutError

    I thought it will be good to share it for others (also for Google Search index ;) )

    I have executed the script with my email and password, I left server empty and I got errors like below.

    Error log
    Traceback (most recent call last):
      File "C:\Python310\lib\site-packages\urllib3\connection.py", line 174, in _new_conn
        conn = connection.create_connection(
      File "C:\Python310\lib\site-packages\urllib3\util\connection.py", line 96, in create_connection
        raise err
      File "C:\Python310\lib\site-packages\urllib3\util\connection.py", line 86, in create_connection
        sock.connect(sa)
    TimeoutError: [WinError 10060]
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "C:\Python310\lib\site-packages\urllib3\connectionpool.py", line 699, in urlopen
        httplib_response = self._make_request(
      File "C:\Python310\lib\site-packages\urllib3\connectionpool.py", line 382, in _make_request
        self._validate_conn(conn)
      File "C:\Python310\lib\site-packages\urllib3\connectionpool.py", line 1010, in _validate_conn
        conn.connect()
      File "C:\Python310\lib\site-packages\urllib3\connection.py", line 358, in connect
        conn = self._new_conn()
      File "C:\Python310\lib\site-packages\urllib3\connection.py", line 179, in _new_conn
        raise ConnectTimeoutError(
    urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.HTTPSConnection object at 0x00000210D9A9DF60>, 'Connection to api.io.mi.com timed out. (connect timeout=None)')
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "C:\Python310\lib\site-packages\requests\adapters.py", line 439, in send
        resp = conn.urlopen(
      File "C:\Python310\lib\site-packages\urllib3\connectionpool.py", line 755, in urlopen
        retries = retries.increment(
      File "C:\Python310\lib\site-packages\urllib3\util\retry.py", line 574, in increment
        raise MaxRetryError(_pool, url, error or ResponseError(cause))
    urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.io.mi.com', port=443): Max retries exceeded with url: /app/home/device_list?signature=REDACTED (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x00000210D9A9DF60>, 'Connection to api.io.mi.com timed out. (connect timeout=None)'))
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "C:\Users\shaqmen\Downloads\token_extractor\token_extractor\token_extractor.py", line 222, in <module>
        devices = connector.get_devices(current_server)
      File "C:\Users\shaqmen\Downloads\token_extractor\token_extractor\token_extractor.py", line 114, in get_devices
        return self.execute_api_call(url, params)
      File "C:\Users\shaqmen\Downloads\token_extractor\token_extractor\token_extractor.py", line 149, in execute_api_call
        response = self._session.post(url, headers=headers, cookies=cookies, params=fields)
      File "C:\Python310\lib\site-packages\requests\sessions.py", line 590, in post
        return self.request('POST', url, data=data, json=json, **kwargs)
      File "C:\Python310\lib\site-packages\requests\sessions.py", line 542, in request
        resp = self.send(prep, **send_kwargs)
      File "C:\Python310\lib\site-packages\requests\sessions.py", line 655, in send
        r = adapter.send(request, **kwargs)
      File "C:\Python310\lib\site-packages\requests\adapters.py", line 504, in send
        raise ConnectTimeout(e, request=request)
    requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='api.io.mi.com', port=443): Max retries exceeded with url: /app/home/device_list?signature=REDACTED  (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x00000210D9A9DF60>, 'Connection to api.io.mi.com timed out. (connect timeout=None)'))
    

    In my case, the solution was to disable the firewall on my router (temporarily).

    Show MAC

    It it possible to show MAC address of devices especially for bluetooth?

    No devices found

    I was able to log in and check all the servers, but no devices are being found.
    I have Roborock S6 MaxV. I use the Roborock android app, which show a region in my user details, which is Denmark.

    QUESTION - Support for Roborock "cloud"

    Hi!
    I tried to avoid to use the xiaomi cloud - now I have to stick to the roborock "cloud"...
    Is it also possible to read out that token?
    THX in advance!

    account server

    Hello,

    Which server should you choose for a belgian account? Germany doesn't work.

    I used the EXE version for windows

    Tool to validate token is valid?

    I'm trying to debug an issue with my Robot vacuum, where it is showing as unavailable in HA. I've reset the Wifi on it and ran the token extractor to get the new key but it still is showing as unavailable. I can see the vacuum in the Xiaomi app (iOS) and the IP address is correct.

    Is there a command-line tool to send a command to the vacuum using the token that can give me more debugging options than just using HA?

    Can't log in

    Running the token extractor I get this error:

    Logging in...
    Invalid login or password.
    Unable to log in.

    I've verified my credentials are accurate. I've tried the extractor on multiple computers and I get the same result.

    Is this still working?

    12 bytes encryption key

    Can 12 bytes encryption key be extracted from CN servers by using Xiaomi-cloud-tokens-extractor application?

    Does it work with Xiaomi IR Remote?

    Thank you for writing that tool 🙏

    P.S. I spent hours with an ipad, windows+itunes on a virtual machine (linux) to get the token. Hence my hesitation on just trying it out.

    Logged in, but error afterward

    Here is the log :

    Logging in...
    Logged in.
    
    Traceback (most recent call last):
      File "/usr/lib/python3/dist-packages/urllib3/contrib/pyopenssl.py", line 485, in wrap_socket
        cnx.do_handshake()
      File "/usr/lib/python3/dist-packages/OpenSSL/SSL.py", line 1915, in do_handshake
        self._raise_ssl_error(self._ssl, result)
      File "/usr/lib/python3/dist-packages/OpenSSL/SSL.py", line 1639, in _raise_ssl_error
        raise SysCallError(errno, errorcode.get(errno))
    OpenSSL.SSL.SysCallError: (104, 'ECONNRESET')
    

    Any idea?

    Indian Server?

    Hi is there anyway to get this info from Indian server?

    Unable to get devices from server

    Hi,
    I followed these steps for login (#43 (comment)) but the answer is "Unable to get devices from server " for all servers it looks for. The region that appears on the xiaomi account is Germany. Does anyone know what it could be?
    Thanks

    BLE Key shows all FF but this doesn't appear to be the actual key

    Here is the output for the device I'm interested in:

       ---------
       NAME:     Door and window sensor
       ID:       blt.1.1a8g8higl4c00
       BLE KEY:  FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
       MAC:      E4:AA:EC:53:BC:55
       TOKEN:    dda6e4313a0cb6efdf4da9b0
       MODEL:    isa.magnet.dw2hl
       ---------
    

    In fact, all the devices on my account show all FF in the BLE key. When trying to decode the packets using all FF as the key it doesn't work, which suggests to me this device has a proper key. I wonder if Xiaomi have changed something recently that would break this script?

    Shared home

    Hi,

    I created an account "Home Assistant" in Xiaomi Home not to use my personal account and don't write my personal password in secrets.yaml of my Home Assistant. With my personal Xiaomi Home account, I share my home to "Home Assistant" account with admin access.

    With this "Xiaomi-cloud-tokens-extractor", I can get my vacuum informations when I use my personnal account, but not when I use the "Home Assistant" account. Certainly because it's not my home in "Home assistant" account, but it's a shared home ?

    In the "xiaomi_cloud_map_extractor" of the configuration.yaml, I tested to set token I recovered with my personnal account and the xiaomi username and password of my "Home assistant account", but vacuum informations don't go up.

    Have you a fix please ?

    Missing unzip terminates the script

    Would be good to have a check for missing unzip. Since bash <(curl -L https://github.com/PiotrMachowski/Xiaomi-cloud-tokens-extractor/raw/master/run.sh) option uses.

    image

    Token extractor generates list of error

    While my "Xiaomi Robot " did not show anymore in HA I assumed it related to lost token .
    When trying to run to token extractor I get the following errors

    Username (email or user ID):
    [email protected]
    Password:
    xxxxxxx
    Server (one of: cn, de, us, ru, tw, sg, in, i2) Leave empty to check all available:

    Logging in...
    Traceback (most recent call last):
    File "site-packages\urllib3\connectionpool.py", line 706, in urlopen
    File "site-packages\urllib3\connectionpool.py", line 382, in make_request
    File "site-packages\urllib3\connectionpool.py", line 1010, in validate_conn
    File "site-packages\urllib3\connection.py", line 426, in connect
    File "site-packages\urllib3\util\ssl
    .py", line 450, in ssl_wrap_socket
    File "site-packages\urllib3\util\ssl
    .py", line 493, in _ssl_wrap_socket_impl
    File "ssl.py", line 423, in wrap_socket
    File "ssl.py", line 870, in _create
    File "ssl.py", line 1139, in do_handshake
    ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1076)

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "site-packages\requests\adapters.py", line 449, in send
    File "site-packages\urllib3\connectionpool.py", line 756, in urlopen
    File "site-packages\urllib3\util\retry.py", line 574, in increment
    urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='account.xiaomi.com', port=443): Max retries exceeded with url: /pass/serviceLogin?sid=xiaomiio&_json=true (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1076)')))

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "token_extractor.py", line 248, in
    File "token_extractor.py", line 98, in login
    File "token_extractor.py", line 43, in login_step_1
    File "site-packages\requests\sessions.py", line 555, in get
    File "site-packages\requests\sessions.py", line 542, in request
    File "site-packages\requests\sessions.py", line 655, in send
    File "site-packages\requests\adapters.py", line 514, in send
    requests.exceptions.SSLError: HTTPSConnectionPool(host='account.xiaomi.com', port=443): Max retries exceeded with url: /pass/serviceLogin?sid=xiaomiio&_json=true (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1076)')))
    [30284] Failed to execute script token_extractor

    Script runs and closes instantly with errors

    Hello
    I'm running the script on windows as token_extractor.exe
    When prompted, I type in my username, password, server.
    when I click enter, the window prints something and closes within half a second.

    Am I doing something wrong?
    Thanks,

    Can't extract token

    Hi,
    Following entering a username and password, I receive a message which says:
    Logging in...
    Two factor authentication required, please use following url and restart extractor:
    And then comes the link.
    And then says:
    Invalid login or password.
    Unable to log in.

    Press ENTER to finish

    I enter the link, verification process ends up with an ok message in the browser.

    I run the extractor again, and can see the same loop, again asks to enter the url.
    I have tried again, browser says again ok, but still, same messages from the extractor.

    What I could be missing?

    Thanks.

    Cannot find or open token extractor

    Running your token extractor just now from Home Assistant terminal. This worked a few days ago on the same setup but running the provided curl provides an error now

    “Cannot find or open token_extractor.zip, token_extractor.zip.zip or token_extractor.zip.ZIP”

    I will attempt to hit an earlier commit to see if this is a regression or just my local instance changing.

    auth err

    i try to rewrite it by golang.
    login1, login2,login3 is ok.
    getdevices is wrong.
    api return {"code":4,"message":"auth err"}.

    plaease help me!

    Possibility to use Roborock App too?

    Hi,
    at the moment the tool works perfektly with the Xiaomi Home App. If the roborock is connected via the Roborock app would it also be possible to get the token somehow? Would be a great addon for this tool!

    BR

    stoped working today with viomi.vacuum.v8

    I have installed the Xiaomi Miot Auto to he Home Assistant and it worked with my robot until today. Now is the device unavailable. When I tried the python script for extracting cloud token, it says "unable to get devices". The vacuum is working normaly and I can see it or control it via the Mi Home app normaly.

    error on token_extractor.exe

    After I enter my mail, password and contry (correctly, verified on app), I get the following traceback error:

      File "urllib3\connectionpool.py", line 677, in urlopen
      File "urllib3\connectionpool.py", line 381, in _make_request
      File "urllib3\connectionpool.py", line 978, in _validate_conn
      File "urllib3\connection.py", line 371, in connect
      File "urllib3\util\ssl_.py", line 384, in ssl_wrap_socket
      File "ssl.py", line 423, in wrap_socket
      File "ssl.py", line 870, in _create
      File "ssl.py", line 1139, in do_handshake
    ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1076)
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "requests\adapters.py", line 449, in send
      File "urllib3\connectionpool.py", line 727, in urlopen
      File "urllib3\util\retry.py", line 439, in increment
    urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='account.xiaomi.com', port=443): Max retries exceeded with url: /pass/serviceLogin?sid=xiaomiio&_json=true (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1076)')))
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "token_extractor.py", line 217, in <module>
      File "token_extractor.py", line 97, in login
      File "token_extractor.py", line 42, in login_step_1
      File "requests\sessions.py", line 543, in get
      File "requests\sessions.py", line 530, in request
      File "requests\sessions.py", line 643, in send
      File "requests\adapters.py", line 514, in send
    requests.exceptions.SSLError: HTTPSConnectionPool(host='account.xiaomi.com', port=443): Max retries exceeded with url: /pass/serviceLogin?sid=xiaomiio&_json=true (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1076)')))
    [18268] Failed to execute script token_extractor```
    

    Question: will I lose map switching from Roborock to Xiaomi Home

    I am currently using the Roborock app. Have been wanting to get the vacuum robot integrated to Home Assistant, but have been putting that off as I am unsure whether the maps that have been mapped out will be gone when switching to the Xiaomi Home app to extract the tokens.

    Appreciate it if you could give me you kind advice. Thanks

    Aqara home

    My hub m1s is in Aqara home. How to extract token?

    xiaomi servers don't find my device

    I bought my roborock on amazon.
    I installed the iOS app on my phone and iPad and can configure rooms, maps. All is well.

    Now, I just installed a non hoobs box and set it up.
    I have installed this plugin into my hoobs box.
    When trying to use token_extractor it says:

    Server (one of: cn, de, us, ru, tw, sg, in, i2) Leave empty to check all available:
    
    
    Logging in...
    Logged in.
    
    No devices found for server "cn".
    No devices found for server "de".
    No devices found for server "us".
    No devices found for server "ru".
    No devices found for server "tw".
    No devices found for server "sg".
    No devices found for server "in".
    No devices found for server "i2".
    
    Press ENTER to finish
    

    I expect this is happening because I setup my vacuum using it's app, but I had not yet created a xiaomi user account. Now I have that account, but it's not finding my device.

    Clues as to how to fix this?

    Can not run Token extractor on my computer

    I ran Token extractor file in my computer (win10) but got error message said this APP cannot run on this computer with remark
    said I should contact with APP provider to get suitable version. Does it mean there is another version I should use?
    or I make any mistake?
    Please help me for fix this problem. Thanks!

    Connection refused

    trying to run the code and i get connection refused from both a windows and linux machine.

    Logging in...
    Logged in.

    Traceback (most recent call last):
    File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 169, in _new_conn
    conn = connection.create_connection(
    File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 96, in create_connection
    raise err
    File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 86, in create_connection
    sock.connect(sa)
    ConnectionRefusedError: [Errno 111] Connection refused

    During handling of the above exception, another exception occurred:

    beaconkey extractor for ble devices

    adds beacon/encryption key extraction for ble devices.

        def get_beaconkey(self, country, did):
            url = self.get_api_url(country) + "/v2/device/blt_get_beaconkey"
            params = {
                "data": '{"did":"' + did  + '","pdid":1}'
            }
            return self.execute_api_call(url, params)
    
                        if "blt" in device["did"]:
                            beaconkey = connector.get_beaconkey(current_server, device["did"])
                            print("   KEY:   " + beaconkey["result"]["beaconkey"])
    

    Invalid login or password - Windows exe

    Thanks for putting this together - looks like it will be very handy.

    However, I'm not able to use the Windows exe tool due to an issue with login.
    Double checked on Mi Home app that login info use was correct.

    image

    adding a device that has been added via the roborock app to the xiaomi account?

    I have setup my vacuum via the roborock app and this script seems only designed for the Mi home account. Is there a way to migrate the device from the roborock app to the Mi home account? Can you please help in getting this done, or is it a whole new setup from scratch?

    I do not have a Xiaomi gateway that controls all devices at home. So not sure how the account there should work. Is there a similar script for the roborock app?

    Question: API URLs discovery

    Hi! First of all - great work on this extractor!

    Could you tell me how you discovered API URLs for your requests?

    I'm working on my own script to access data from BLE temperature and humidity sensors for HA integration. Those sensors appear on the device list but without additional data (although some devices do). I'm expecting something similar to /v2/device/blt_get_beaconkey but for sensors that could return temperature and humidity.

    I've found this website that seems to go into the right direction but I have no clue how to make use of it.

    Any help will be greatly appreciated!

    Recommend Projects

    • React photo React

      A declarative, efficient, and flexible JavaScript library for building user interfaces.

    • Vue.js photo Vue.js

      🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

    • Typescript photo Typescript

      TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

    • TensorFlow photo TensorFlow

      An Open Source Machine Learning Framework for Everyone

    • Django photo Django

      The Web framework for perfectionists with deadlines.

    • D3 photo D3

      Bring data to life with SVG, Canvas and HTML. 📊📈🎉

    Recommend Topics

    • javascript

      JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

    • web

      Some thing interesting about web. New door for the world.

    • server

      A server is a program made to process requests and deliver data to clients.

    • Machine learning

      Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

    • Game

      Some thing interesting about game, make everyone happy.

    Recommend Org

    • Facebook photo Facebook

      We are working to build community through open source technology. NB: members must have two-factor auth.

    • Microsoft photo Microsoft

      Open source projects and samples from Microsoft.

    • Google photo Google

      Google ❤️ Open Source for everyone.

    • D3 photo D3

      Data-Driven Documents codes.