[aime] fix ADB header parsing error when using generated keychips #173

Merged
Hay1tsme merged 1 commits from ppc/artemis:aime-regex-fix into develop 2024-09-13 18:11:39 +00:00
2 changed files with 2 additions and 2 deletions
Showing only changes of commit 1db020b5fc - Show all commits

View File

@ -120,7 +120,7 @@ class ADBHeader:
if self.store_id == 0: if self.store_id == 0:
raise ADBHeaderException(f"Store ID cannot be 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!") raise ADBHeaderException(f"Keychip ID {self.keychip_id} is invalid!")
return True return True

View File

@ -232,7 +232,7 @@ class ArcadeData(BaseData):
return f"{platform_code}{'-' if dash else ''}{platform_rev:02d}{serial_letter}{serial_num:04d}{append:04d}" 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: 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: 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 return False