PiotrMachowski / Xiaomi-cloud-tokens-extractor

This tool/script retrieves tokens for all devices connected to Xiaomi cloud and encryption keys for BLE devices.
MIT License
3.23k stars 333 forks source link

beaconkey extractor for ble devices #15

Closed rezmus closed 3 years ago

rezmus commented 3 years ago

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"])
PiotrMachowski commented 3 years ago

Thank you! It has been added to the script