mirror of
https://github.com/ong19th/Citron.git
synced 2025-12-12 22:37:00 +00:00
feat: Make firmware mandatory for title launching
This commit implements a requirement for firmware to be installed before titles can be launched, similar to how keys are required. Changes include: - Add IsFirmwareAvailable method to KeyManager to check for essential keys - Add CheckFirmwarePresence method to verify actual firmware files (NCAs) - Add firmware checks in game loading process for both desktop and Android - Add error messages when firmware is missing - Add strings for firmware-related error messages The implementation checks for both essential keys and the presence of system applets like Mii Edit and Home Menu to ensure proper firmware is installed. Games will not launch if firmware is missing, and users will be shown an appropriate error message.
This commit is contained in:
parent
a442078ee4
commit
84e5fbc089
8 changed files with 129 additions and 3 deletions
|
|
@ -1290,4 +1290,31 @@ bool KeyManager::AddTicket(const Ticket& ticket) {
|
|||
SetKey(S128KeyType::Titlekey, key.value(), rights_id[1], rights_id[0]);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool KeyManager::IsFirmwareAvailable() const {
|
||||
// Check for essential keys that would only be present with firmware
|
||||
if (!HasKey(S128KeyType::Master, 0)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check for at least one titlekek
|
||||
bool has_titlekek = false;
|
||||
for (size_t i = 0; i < CURRENT_CRYPTO_REVISION; ++i) {
|
||||
if (HasKey(S128KeyType::Titlekek, i)) {
|
||||
has_titlekek = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!has_titlekek) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check for header key
|
||||
if (!HasKey(S256KeyType::Header)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
} // namespace Core::Crypto
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue