From 1db020b5fc754da7d829338c4dc7425357c04a3d Mon Sep 17 00:00:00 2001 From: ppc Date: Mon, 9 Sep 2024 16:53:14 +0000 Subject: [PATCH] fix generated keychip validation failures --- core/adb_handlers/base.py | 2 +- core/data/schema/arcade.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/adb_handlers/base.py b/core/adb_handlers/base.py index 06b5267..b5520ce 100644 --- a/core/adb_handlers/base.py +++ b/core/adb_handlers/base.py @@ -120,7 +120,7 @@ class ADBHeader: if self.store_id == 0: raise ADBHeaderException(f"Store ID cannot be 0!") - if re.fullmatch(r"^A[0-9]{2}[E|X][0-9]{2}[A-HJ-NP-Z][0-9]{4}$", self.keychip_id) is None: + if re.fullmatch(r"^A[0-9]{2}[A-Z][0-9]{2}[A-HJ-NP-Z][0-9]{4}$", self.keychip_id) is None: raise ADBHeaderException(f"Keychip ID {self.keychip_id} is invalid!") return True diff --git a/core/data/schema/arcade.py b/core/data/schema/arcade.py index 3e83bc5..5b570a1 100644 --- a/core/data/schema/arcade.py +++ b/core/data/schema/arcade.py @@ -232,7 +232,7 @@ class ArcadeData(BaseData): return f"{platform_code}{'-' if dash else ''}{platform_rev:02d}{serial_letter}{serial_num:04d}{append:04d}" def validate_keychip_format(self, serial: str) -> bool: - # For the 2nd letter, E and X are the only "real" values that have been observed + # For the 2nd letter, E and X are the only "real" values that have been observed (A is used for generated keychips) if re.fullmatch(r"^A[0-9]{2}[A-Z][-]?[0-9]{2}[A-HJ-NP-Z][0-9]{4}([0-9]{4})?$", serial) is None: return False -- 2.39.2