From ad4380b40da63fbe486f434fc87da718616d2a50 Mon Sep 17 00:00:00 2001 From: 1okko <15377594951@189.cn> Date: Sun, 14 Dec 2025 18:48:45 +0800 Subject: [PATCH] 88 --- system/athena/registration.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/system/athena/registration.py b/system/athena/registration.py index 1846d087..3eefd7bc 100755 --- a/system/athena/registration.py +++ b/system/athena/registration.py @@ -26,7 +26,7 @@ def register(show_spinner=False) -> str | None: with open(Paths.persist_root()+"/comma/dongle_id") as f: dongle_id = f.read().strip() - pubkey = Path(Paths.persist_root()+"/comma/id_rsa.pub") + #pubkey = Path(Paths.persist_root()+"/comma/id_rsa.pub") #if not pubkey.is_file(): #dongle_id = UNREGISTERED_DONGLE_ID #cloudlog.warning(f"missing public key: {pubkey}") @@ -37,9 +37,9 @@ def register(show_spinner=False) -> str | None: spinner.update("registering device") # Create registration token, in the future, this key will make JWTs directly - with open(Paths.persist_root()+"/comma/id_rsa.pub") as f1, open(Paths.persist_root()+"/comma/id_rsa") as f2: - public_key = f1.read() - private_key = f2.read() + #with open(Paths.persist_root()+"/comma/id_rsa.pub") as f1, open(Paths.persist_root()+"/comma/id_rsa") as f2: + #public_key = f1.read() + #private_key = f2.read() # Block until we get the imei serial = HARDWARE.get_serial() @@ -59,10 +59,10 @@ def register(show_spinner=False) -> str | None: start_time = time.monotonic() while True: try: - register_token = jwt.encode({'register': True, 'exp': datetime.now(UTC).replace(tzinfo=None) + timedelta(hours=1)}, private_key, algorithm='RS256') + #register_token = jwt.encode({'register': True, 'exp': datetime.now(UTC).replace(tzinfo=None) + timedelta(hours=1)}, private_key, algorithm='RS256') cloudlog.info("getting pilotauth") resp = api_get("v2/pilotauth/", method='POST', timeout=15, - imei=imei1, imei2=imei2, serial=serial, public_key=public_key, register_token=register_token) + imei=imei1, imei2=imei2, serial=serial) # ========== 【唯一修改处】========== if resp.status_code in (402, 403): @@ -98,4 +98,4 @@ def register(show_spinner=False) -> str | None: return dongle_id if __name__ == "__main__": - print(register()) \ No newline at end of file + print(register())