Skip to content

Settings: prod.keys chosen once for every game (#996) - #1009

Closed
Haseenesss wants to merge 1 commit into
LNPANDY:mainfrom
Haseenesss:feat/996-saved-keys
Closed

Haseenesss wants to merge 1 commit into
LNPANDY:mainfrom
Haseenesss:feat/996-saved-keys

Conversation

@Haseenesss

@Haseenesss Haseenesss commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Fix or feature

  • Fix
  • Feature

Feature from outside: #996 has no milestone yet. It needs a maintainer's yes before this can merge.

What and why

Closes #996.

Every Switch build needs prod.keys, but the Builds page filled the keys row one game at a time. A player with one keys file had to pick it again for every new game. A game whose library entry named a keys file that was later moved could not build until the player picked it again.

  • Settings, Keys (KeysCard, under Library): the saved prod.keys, with Choose (Change) and Remove. The row says when the saved file is no longer there.
  • The build store keeps it (BuildStore.savedKeys, defaults key savedKeysPath, BuildStore+SavedKeys.swift). keysPath is the row's file if it exists. Otherwise it is the saved keys, if they exist. Otherwise it is whatever the row names, so the build reports the missing file as before. inputsReady and canBuild use the same rule.
  • The Builds page shows the saved keys on an empty keys row, or on a row whose file is gone, marked "Saved in Settings". The key check runs against them.
  • Switch 2 game folders need no keys and never take the saved ones: no -k, and the row keeps "No keys needed".
  • Saved only on an explicit choice: Choose in Settings, a file picked for the keys row, a keys file dropped on its own, or the keys confirmed in the guided setup. A folder scan, a library scan or a dropped folder never saves keys.
  • Skip in the guided setup forgets the saved keys. A forced (ephemeral) setup run holds the change back until it ends, like its other writes. When the setup resumes past the keys step, saved keys count as keys.
  • New strings in all seven languages. English and Chinese were written for this PR. German, French, Italian, Japanese and Swedish are my own translations and are waiting for a native review.

Not changed: the Qt (Windows) launcher and console mode. Neither has a keys setting.

Checked

  • Tests: swift build, then swift test --filter on BuildStoreTests, GameFolderStoreTests, LiveOnboardingDriverTests and SourceSizeTests, all pass. The pre-push hook ran the full swift test.
  • New tests:
    • BuildStoreTests: an empty row takes the saved keys and a new store reads them back. A row whose file is gone takes the saved keys, and a row with an existing file keeps its own. Remove empties the setting and keeps the row. Choose in Settings saves the picked file, and a cancel changes nothing. A folder scan or a dropped folder never saves keys, and a dropped keys file does.
    • GameFolderStoreTests: a game folder never takes the saved keys (no -k). A package build of an empty row passes -k <saved keys>.
    • LiveOnboardingDriverTests: keys chosen in the setup are saved, and Skip forgets them. A resumed setup accepts the saved keys.
  • Visual QA: NX_LAUNCHER_CAPTURE_DIR=<dir> swift test --filter testRenderSavedKeysForVisualQA (new SavedKeysCaptureTests). The before shots come from the same capture run on main (9821bf2).
  • Run on a device or Mac: not run with a real game or real keys.

Screenshots

Captured with SavedKeysCaptureTests (English). gh --attach cannot upload images to this repository from my fork, so the images are added by hand below:

  • Before, Settings (no Keys card):
keys-0-settings-unset-en
  • Before, Builds with an empty keys row:
keys-3-builds-without-saved-keys-en
  • After, Settings with no keys saved, with keys saved, with saved keys that are gone:
keys-0-settings-unset-en keys-1-settings-saved-en keys-2-settings-missing-en
  • After, Builds with an empty keys row, without and with saved keys:
keys-3-builds-without-saved-keys-en keys-4-builds-saved-keys-en

Scope

  • No engine file (dm/, scripts/, docs/, ref/) is added to the repository
  • A fix to the engine or a game profile also goes to seedds/nxnative: not applicable, launcher only
  • A change to a launcher view has before and after screenshots above
  • No keys, game files or data extracted from a game in the change or the attachments. The captures use empty stand-in files and a zero-filled header_key line.

🤖 Generated with Claude Code

Every Switch build needs prod.keys, and the keys row of the Builds page was
filled per game. A player with one keys file picked it again for each new
game, and a game whose library entry names a keys file that was moved could
not build until it was picked again.

Settings gets a Keys card with the saved prod.keys, Choose and Remove. The
build store keeps the file in the defaults (savedKeysPath). A build whose
keys row is empty, or names a file that is gone, takes the saved keys, and
the row shows them as "Saved in Settings". A Switch 2 game folder needs no
keys and never takes them.

Keys are saved only on an explicit choice: Choose in Settings, a file picked
for the keys row, a keys file dropped itself, or the keys confirmed in the
guided setup. A folder scan or a dropped folder never saves them. Skipping
the keys in the guided setup forgets the saved ones, and an ephemeral setup
run holds the change back until it ends, as its other writes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@v0lumehi

v0lumehi commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Thank you @Haseenesss. Your change is part of #1097, the launcher UI overhaul, with you as co-author. Closing this one in favor of it. Please have a look there if something of yours is missing or changed.

@v0lumehi v0lumehi closed this Nov 10, 2026
@Haseenesss
Haseenesss deleted the feat/996-saved-keys branch November 13, 2026 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

launcher The NX2Apple launcher app windows Windows (the Qt front end)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

prod.keys chosen once in Settings

2 participants