Skip to content

Play your own Switch games on iPhone/iPad — one-click macOS app, no terminal. | 把 Switch 游戏装进 iPhone:图形界面一键构建,不用命令行。Bring your own game.

Builds page: a failure row for keys older than the game

v0lumehi2fead4b20248
diff --git a/frontend-qt/nspb_qt/build_failure.py b/frontend-qt/nspb_qt/build_failure.py
index becae1e5..48d7e024 100644
--- a/frontend-qt/nspb_qt/build_failure.py
+++ b/frontend-qt/nspb_qt/build_failure.py
@@ -26,6 +26,7 @@ KEYS = 'keys'
SEVERAL_GAMES = 'severalGames'
NO_TITLE_ID = 'noTitleID'
NO_PROFILE = 'noProfile'
+KEYS_OLD = 'keysOld'
DISK_FULL = 'diskFull'
CLOUD_FOLDER = 'cloudFolder'
UNKNOWN = 'unknown'
@@ -43,6 +44,7 @@ TABLE: list[tuple[str, str, str]] = [
('nsp.damaged', DAMAGED_NSP, r"files fail the NCA's hash check"),
('arm32.program', A32_PROGRAM, r'is a 32-bit ARM program'),
('keys.missing', KEYS, r'(?m)^\[RED\] no such file: '),
+ ('keys.old', KEYS_OLD, r'the keys are older than the game'),
('games.several', SEVERAL_GAMES, r'more than one game in the folder'),
('games.noTitleID', NO_TITLE_ID, r'no NSP with a readable title ID in '),
('games.noProfile', NO_PROFILE, r'packs only a game with a profile'),
@@ -59,7 +61,7 @@ OVERRIDE_FLAGS = {
}
KINDS = [ROSETTA, TRANSLATOR, ZBIC, IOS_SDK, CLT_SELECTED, OTHER_METAL, SHADER_REGRESSION, DAMAGED_NSP, A32_PROGRAM,
- KEYS, SEVERAL_GAMES, NO_TITLE_ID, NO_PROFILE, DISK_FULL, CLOUD_FOLDER]
+ KEYS, SEVERAL_GAMES, NO_TITLE_ID, NO_PROFILE, KEYS_OLD, DISK_FULL, CLOUD_FOLDER]
# The Swift app has four more rows that no log line sets (a drive that is gone, a signing team, a device transfer):
# they belong to the Mac launcher's install on a device and to /Volumes, which this front end does not have.
# cloudFolder is a row of the table, so it is here, but the check that stops a build before it starts is the Mac launcher's.
diff --git a/frontend-qt/nspb_qt/ui.py b/frontend-qt/nspb_qt/ui.py
index a6823d68..4b867397 100644
--- a/frontend-qt/nspb_qt/ui.py
+++ b/frontend-qt/nspb_qt/ui.py
@@ -381,7 +381,7 @@ class MainWindow(QMainWindow):
outer.addWidget(self.failure_box)
_FIX_BUTTONS = {'translator': 'fail.translator.button', 'zbic': 'fail.zbic.button', 'iosSDK': 'fail.iosSDK.button',
- 'keys': 'fail.keys.button', 'severalGames': 'fail.showFolder', 'noTitleID': 'fail.showFolder',
+ 'keys': 'fail.keys.button', 'keysOld': 'fail.keys.button', 'severalGames': 'fail.showFolder', 'noTitleID': 'fail.showFolder',
'diskFull': 'fail.showFolder'}
def _show_failure(self) -> None:
@@ -403,7 +403,7 @@ class MainWindow(QMainWindow):
f = self.m.failure
if f is None:
return
- if f.kind == 'keys':
+ if f.kind in ('keys', 'keysOld'):
self._choose_input('keys') # the same picker as the keys row
elif f.kind in ('severalGames', 'noTitleID', 'diskFull'):
folder = self.m.failure_folder(f)
diff --git a/frontend/Sources/NXCore/BuildFailureClassifier.swift b/frontend/Sources/NXCore/BuildFailureClassifier.swift
index fe295653..1f2161c2 100644
--- a/frontend/Sources/NXCore/BuildFailureClassifier.swift
+++ b/frontend/Sources/NXCore/BuildFailureClassifier.swift
@@ -18,6 +18,7 @@ package enum BuildFailureClassifier {
("nsp.damaged", .damagedNSP, "files fail the NCA's hash check"),
("arm32.program", .a32Program, "is a 32-bit ARM program"),
("keys.missing", .keys, "(?m)^\\[RED\\] no such file: "),
+ ("keys.old", .keysOld, "the keys are older than the game"),
("games.several", .severalGames, "more than one game in the folder"),
("games.noTitleID", .noTitleID, "no NSP with a readable title ID in "),
("games.noProfile", .noProfile, "packs only a game with a profile"),
diff --git a/frontend/Sources/NXCore/BuildFailureKind.swift b/frontend/Sources/NXCore/BuildFailureKind.swift
index 9d7c9a2d..a44cda61 100644
--- a/frontend/Sources/NXCore/BuildFailureKind.swift
+++ b/frontend/Sources/NXCore/BuildFailureKind.swift
@@ -10,6 +10,8 @@ package enum BuildFailureKind: String, CaseIterable {
case keys, severalGames, noTitleID, driveMissing
/// A game folder or NUP (a Switch 2 game, GameFolder.swift) of a game the engine has no profile for: the script packs one only with a profile.
case noProfile
+ /// prod.keys lacks the master key the game needs: the keys are older than the game (nx_extract's exit code 6, seedds/nxnative 3104c0a).
+ case keysOld
/// The build's and the install's own steps.
case diskFull, teamTaken, noSigningAccount, deviceTransfer
/// The build folder is in iCloud Drive or another cloud folder (CloudFolder.swift): the launcher stops before the build, and the
diff --git a/frontend/Sources/NXLauncher/BuildFailureCard.swift b/frontend/Sources/NXLauncher/BuildFailureCard.swift
index ba2c1d30..64af2f8f 100644
--- a/frontend/Sources/NXLauncher/BuildFailureCard.swift
+++ b/frontend/Sources/NXLauncher/BuildFailureCard.swift
@@ -57,7 +57,7 @@ package struct BuildFailureCard: View {
fix(kind, "fail.iosSDK.button")
case .cltSelected:
if Toolchain.installedXcode() != nil { fix(kind, "fail.cltSelected.button") }
- case .keys:
+ case .keys, .keysOld:
fix(kind, "fail.keys.button")
case .severalGames, .noTitleID, .diskFull:
fix(kind, "fail.showFolder")
diff --git a/frontend/Sources/NXModel/BuildStore+Failure.swift b/frontend/Sources/NXModel/BuildStore+Failure.swift
index 7072fdde..434c6752 100644
--- a/frontend/Sources/NXModel/BuildStore+Failure.swift
+++ b/frontend/Sources/NXModel/BuildStore+Failure.swift
@@ -79,7 +79,7 @@ extension BuildStore {
}
case .zbic:
installRow("python") // the venv install, which now names zbic
- case .keys:
+ case .keys, .keysOld:
if let chooseKeys { chooseKeys() } else { pickFiles(kind: .keys) } // the same picker as the keys row
case .severalGames, .noTitleID, .diskFull:
showFailureFolder()
diff --git a/frontend/Tests/Fixtures/build_failures.json b/frontend/Tests/Fixtures/build_failures.json
index d00e2f9d..cb198b24 100644
--- a/frontend/Tests/Fixtures/build_failures.json
+++ b/frontend/Tests/Fixtures/build_failures.json
@@ -92,6 +92,13 @@
"text": "[RED] no NSP with a readable title ID in /Users/x/Games/Zelda",
"folder": "/Users/x/Games/Zelda"
},
+ {
+ "id": "keys.old",
+ "kind": "keysOld",
+ "source": "dm/tools/nx_extract/Program.cs",
+ "fragment": "the keys are older than the game",
+ "text": "[RED] Game [0100000000010000][v0].nsp: prod.keys has no master_key_13 (master key 13, which came with firmware 19.0.0): the keys are older than the game; dump prod.keys again from a console on firmware 19.0.0 or later"
+ },
{
"id": "games.noProfile",
"kind": "noProfile",
diff --git a/frontend/Tests/NX2AppleTests/BuildFailureTests.swift b/frontend/Tests/NX2AppleTests/BuildFailureTests.swift
index 6b36ff6d..bbb8561e 100644
--- a/frontend/Tests/NX2AppleTests/BuildFailureTests.swift
+++ b/frontend/Tests/NX2AppleTests/BuildFailureTests.swift
@@ -282,7 +282,7 @@ import NXModel
}
for (name, kind, lang) in [("hint-other-metal", BuildFailureKind.otherMetal, Lang.en), ("hint-ios-sdk", .iosSDK, .en), ("hint-damaged-nsp", .damagedNSP, .en),
("hint-other-metal-zh", .otherMetal, .zh)]
- + [BuildFailureKind.keys, .severalGames, .noTitleID, .driveMissing, .diskFull, .teamTaken, .noSigningAccount, .deviceTransfer].flatMap { k in
+ + [BuildFailureKind.keys, .keysOld, .severalGames, .noTitleID, .noProfile, .driveMissing, .diskFull, .teamTaken, .noSigningAccount, .deviceTransfer].flatMap { k in
[("row-\(k.rawValue)", k, Lang.en), ("row-\(k.rawValue)-zh", k, Lang.zh)] } {
let mStores = LauncherStores(defaults: testDefaults); let m = mStores.build
m.lang = CaptureLanguage.current(lang)
diff --git a/frontend/l10n/de.json b/frontend/l10n/de.json
index 2b66b223..3e061134 100644
--- a/frontend/l10n/de.json
+++ b/frontend/l10n/de.json
@@ -539,6 +539,8 @@
"fail.keys.button": "Schlüsseldatei wählen",
"fail.keys.next": "Wähle deine prod.keys erneut. Liegt sie auf einem externen Laufwerk, verbinde zuerst das Laufwerk. Baue dann erneut.",
"fail.keys.what": "Die Schlüsseldatei wurde nicht gefunden oder lässt sich nicht lesen.",
+ "fail.keysOld.next": "Das Spiel braucht einen Schlüssel, der mit einer neueren Switch-Systemversion kam. Aktualisiere deine eigene Switch, hole prod.keys erneut von ihr, wähle die neue Datei und baue dann erneut. Das Protokoll nennt den Schlüssel und die Systemversion.",
+ "fail.keysOld.what": "Deine prod.keys-Datei ist älter als das Spiel.",
"fail.noProfile.next": "Switch 2-Spiele lassen sich nur bauen, wenn die Engine sie kennt. Aktualisiere die Engine oder warte, bis sie ein Profil für dieses Spiel hat.",
"fail.noProfile.what": "Die Engine hat kein Profil für dieses Spiel, und ein Spielordner baut nur ein Spiel mit Profil.",
"fail.noSigningAccount.next": "Öffne in Xcode „Settings → Accounts“, melde dich mit deiner Apple-ID an und stelle sicher, dass das Team aufgeführt ist. Baue dann erneut. Eine kostenlose Apple-ID genügt, und Xcode erstellt das Zertifikat selbst.",
diff --git a/frontend/l10n/en.json b/frontend/l10n/en.json
index 34e1d2f8..f9c7fbd3 100644
--- a/frontend/l10n/en.json
+++ b/frontend/l10n/en.json
@@ -537,6 +537,8 @@
"fail.keys.button": "Choose keys file",
"fail.keys.next": "Choose your prod.keys again. If it is on an external drive, connect the drive first. Then build again.",
"fail.keys.what": "The keys file was not found or can't be read.",
+ "fail.keysOld.next": "The game needs a key that came with a newer Switch system version. Update your own Switch, take prod.keys from it again, choose the new file and build again. The log names the key and the system version.",
+ "fail.keysOld.what": "Your prod.keys file is older than the game.",
"fail.noProfile.next": "Switch 2 games build only when the engine knows them. Update the engine, or wait until the engine has a profile for this game.",
"fail.noProfile.what": "The engine has no profile for this game, and a game folder builds only a game with one.",
"fail.noSigningAccount.next": "Open Xcode > Settings > Accounts, sign in with your Apple ID and make sure the team is listed, then build again. A free Apple ID is enough and Xcode creates the certificate itself.",
diff --git a/frontend/l10n/fr.json b/frontend/l10n/fr.json
index 41100d84..d035cd47 100644
--- a/frontend/l10n/fr.json
+++ b/frontend/l10n/fr.json
@@ -538,6 +538,8 @@
"fail.keys.button": "Choisir le fichier de clés",
"fail.keys.next": "Choisissez à nouveau votre prod.keys. S’il se trouve sur un disque externe, connectez d’abord le disque. Puis compilez à nouveau.",
"fail.keys.what": "Le fichier de clés est introuvable ou illisible.",
+ "fail.keysOld.next": "Le jeu a besoin d'une clé arrivée avec une version plus récente du système de la Switch. Mettez à jour votre propre Switch, récupérez à nouveau prod.keys, choisissez le nouveau fichier puis compilez à nouveau. Le journal indique la clé et la version du système.",
+ "fail.keysOld.what": "Votre fichier prod.keys est plus ancien que le jeu.",
"fail.noProfile.next": "Les jeux Switch 2 ne se compilent que si le moteur les connaît. Mettez le moteur à jour, ou attendez qu'il ait un profil pour ce jeu.",
"fail.noProfile.what": "Le moteur n'a pas de profil pour ce jeu, et un dossier de jeu ne se compile que pour un jeu qui en a un.",
"fail.noSigningAccount.next": "Ouvrez Xcode > Settings > Accounts, connectez-vous avec votre identifiant Apple et vérifiez que l’équipe figure dans la liste, puis compilez à nouveau. Un identifiant Apple gratuit suffit et Xcode crée lui-même le certificat.",
diff --git a/frontend/l10n/it.json b/frontend/l10n/it.json
index 084e177f..d23020ed 100644
--- a/frontend/l10n/it.json
+++ b/frontend/l10n/it.json
@@ -538,6 +538,8 @@
"fail.keys.button": "Scegli il file delle chiavi",
"fail.keys.next": "Scegli di nuovo il tuo prod.keys. Se si trova su un disco esterno, prima collega il disco. Poi compila di nuovo.",
"fail.keys.what": "Il file delle chiavi non è stato trovato o non si può leggere.",
+ "fail.keysOld.next": "Il gioco ha bisogno di una chiave arrivata con una versione più recente del sistema della Switch. Aggiorna la tua Switch, prendi di nuovo prod.keys da lei, scegli il nuovo file e compila di nuovo. Il log indica la chiave e la versione del sistema.",
+ "fail.keysOld.what": "Il tuo file prod.keys è più vecchio del gioco.",
"fail.noProfile.next": "I giochi Switch 2 si compilano solo se il motore li conosce. Aggiorna il motore, o aspetta che abbia un profilo per questo gioco.",
"fail.noProfile.what": "Il motore non ha un profilo per questo gioco, e una cartella del gioco si compila solo per un gioco che ne ha uno.",
"fail.noSigningAccount.next": "Apri Xcode > Settings > Accounts, accedi con il tuo Apple ID e verifica che il team compaia nell’elenco, poi compila di nuovo. Basta un Apple ID gratuito e Xcode crea il certificato da solo.",
diff --git a/frontend/l10n/sv.json b/frontend/l10n/sv.json
index af6ddbe4..7e74757d 100644
--- a/frontend/l10n/sv.json
+++ b/frontend/l10n/sv.json
@@ -393,6 +393,8 @@
"fail.keys.button": "Välj nyckelfil",
"fail.keys.next": "Välj din prod.keys igen. Ligger den på en extern disk ansluter du disken först. Bygg sedan igen.",
"fail.keys.what": "Nyckelfilen hittades inte eller går inte att läsa.",
+ "fail.keysOld.next": "Spelet behöver en nyckel som kom med en nyare systemversion för Switch. Uppdatera din egen Switch, hämta prod.keys från den igen, välj den nya filen och bygg sedan igen. Loggen anger nyckeln och systemversionen.",
+ "fail.keysOld.what": "Din prod.keys-fil är äldre än spelet.",
"fail.noProfile.next": "Switch 2-spel går bara att bygga när motorn känner till dem. Uppdatera motorn eller vänta tills den har en profil för det här spelet.",
"fail.noProfile.what": "Motorn har ingen profil för det här spelet, och en spelmapp bygger bara ett spel med profil.",
"fail.noSigningAccount.next": "Öppna Xcode > Inställningar > Konton, logga in med ditt Apple-ID och kontrollera att teamet finns i listan. Bygg sedan igen. Ett gratis Apple-ID räcker och Xcode skapar certifikatet själv.",
diff --git a/frontend/l10n/zh.json b/frontend/l10n/zh.json
index dec2b504..0bb99510 100644
--- a/frontend/l10n/zh.json
+++ b/frontend/l10n/zh.json
@@ -538,6 +538,8 @@
"fail.keys.button": "选择密钥文件",
"fail.keys.next": "请重新选择你的 prod.keys。如果它在外接硬盘上,请先连接硬盘,然后再构建。",
"fail.keys.what": "找不到密钥文件,或者无法读取它。",
+ "fail.keysOld.next": "这个游戏需要更新版本的 Switch 系统才带有的密钥。请更新你自己的 Switch,重新从它导出 prod.keys,选择新的文件后再构建。日志里写明了缺少的密钥和对应的系统版本。",
+ "fail.keysOld.what": "你的 prod.keys 文件比这个游戏旧。",
"fail.noProfile.next": "Switch 2 游戏只有在引擎认识它时才能构建。请更新引擎,或等待引擎加入这个游戏的配置。",
"fail.noProfile.what": "引擎没有这个游戏的配置,而游戏文件夹只能构建有配置的游戏。",
"fail.noSigningAccount.next": "请打开 Xcode > 设置 > 账户,登录你的 Apple ID,确认团队已列出,然后再构建。免费的 Apple ID 就够用,证书由 Xcode 自己创建。",