Skip to content

Commit 410ba42

Browse files
Increase agent randomization
1 parent 43b20eb commit 410ba42

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

custom_components/xiaomi_cloud_map_extractor/common/xiaomi_cloud_connector.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,13 @@ def generate_nonce(millis: int):
290290

291291
@staticmethod
292292
def generate_agent() -> str:
293-
agent_id = "".join((chr(random.randint(65, 69)) for _ in range(13)))
294-
return f"Android-7.1.1-1.0.0-ONEPLUS A3010-136-{agent_id} APP/xiaomi.smarthome APPV/62830"
293+
agent_id = "".join(
294+
map(lambda i: chr(i), [random.randint(65, 69) for _ in range(13)])
295+
)
296+
a = random.randint(0, 9)
297+
b = random.randint(0, 9)
298+
c = random.randint(0, 9)
299+
return f"Android-7.1.1-{a}.{b}.{c}-ONEPLUS A3011-136-{agent_id} APP/xiaomi.smarthome APPV/62830"
295300

296301
@staticmethod
297302
def generate_device_id() -> str:

0 commit comments

Comments
 (0)