Validate save imports by main-data checksum, not raw file size

The SAVE FILES card only accepted saves of exactly 32768 bytes and
refused anything else. importToSlot now classifies a non-32768 file by
the integrity of its main-data checksum instead:

- Oversize + valid checksum -> an emulator RTC footer, so the launcher
  asks for confirmation, then truncates to 32768 on force.
- Oversize + invalid checksum -> rejected.
- Undersize + valid checksum -> imports zero-padded; otherwise refused.

Adds the "Oversized save file" confirm modal, a new vendor-oracle test
built by gen1lib (PKHeX-derived) run as its own Lua 5.4 tier, oversize/
truncated policy tests, and the LUA54 wiring in test.sh.

# Conflicts:
#	src/import/LauncherView.lua
This commit is contained in:
kikimanjaro
2026-08-04 22:34:43 +02:00
parent 0fe7a96781
commit 272305f3a4
8 changed files with 352 additions and 10 deletions
+2
View File
@@ -1505,6 +1505,8 @@ local function buildConfirmModal(imp, m)
imp:_confirmModUpdate(c.id, c.release)
elseif c.kind == "enableAll" then
imp:_setAllMods(true, true)
elseif c.kind == "importOversize" then
imp:_importSave(c.version, c.source, true)
else
imp:_toggleMod(c.id, true)
end