mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-12 23:48:10 -07:00
Remove MFC dupes and move script
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import pathlib
|
||||
import string
|
||||
|
||||
file = pathlib.Path(__file__) / "../../applications/main/nfc/resources/nfc/assets/mf_classic_dict.nfc"
|
||||
try:
|
||||
lines = file.read_text(encoding="ascii").splitlines()
|
||||
except UnicodeDecodeError:
|
||||
print("Fix non-ASCII characters: https://pteo.paranoiaworks.mobi/diacriticsremover/")
|
||||
exit()
|
||||
|
||||
for i, line in enumerate(lines):
|
||||
if line.startswith("#"):
|
||||
continue
|
||||
lines[i] = line = line.upper()
|
||||
if len(line) != 12 or any(char not in string.hexdigits for char in line):
|
||||
print(f"line {i} is not correct: {line}")
|
||||
for j in reversed(range(i + 1, len(lines))):
|
||||
if lines[j].upper() == line:
|
||||
del lines[j]
|
||||
|
||||
file.write_text("\n".join(lines))
|
||||
Reference in New Issue
Block a user