Generate a fake "DongleID" for unofficial devices

This commit is contained in:
James
2025-12-01 12:00:00 -07:00
parent 823bc19e36
commit 564633d0f6
Executable → Regular
+3 -1
View File
@@ -2,6 +2,8 @@
import time
import json
import jwt
import random
import string
from typing import cast
from pathlib import Path
@@ -78,7 +80,7 @@ def register(show_spinner=False) -> str | None:
if resp.status_code in (402, 403):
cloudlog.info(f"Unable to register device, got {resp.status_code}")
dongle_id = UNREGISTERED_DONGLE_ID
dongle_id = ''.join(random.choices(string.ascii_lowercase + string.digits, k=16))
else:
dongleauth = json.loads(resp.text)
dongle_id = dongleauth["dongle_id"]