diff --git a/libraries/libstratosphere/include/stratosphere/ncm/ncm_content_storage.hpp b/libraries/libstratosphere/include/stratosphere/ncm/ncm_content_storage.hpp index 5d4790152..d90868161 100644 --- a/libraries/libstratosphere/include/stratosphere/ncm/ncm_content_storage.hpp +++ b/libraries/libstratosphere/include/stratosphere/ncm/ncm_content_storage.hpp @@ -142,28 +142,30 @@ namespace ams::ncm { return this->interface->ReadContentIdFile(sf::OutBuffer(dst, size), content_id, offset); } - Result GetRightsId(ams::fs::RightsId *out_rights_id, PlaceHolderId placeholder_id) { - AMS_ASSERT(this->interface != nullptr); - AMS_ABORT_UNLESS(hos::GetVersion() < hos::Version_3_0_0); - return this->interface->GetRightsIdFromPlaceHolderIdDeprecated(out_rights_id, placeholder_id); - } - Result GetRightsId(ncm::RightsId *out_rights_id, PlaceHolderId placeholder_id) { AMS_ASSERT(this->interface != nullptr); - AMS_ABORT_UNLESS(hos::GetVersion() >= hos::Version_3_0_0); - return this->interface->GetRightsIdFromPlaceHolderId(out_rights_id, placeholder_id); - } - Result GetRightsId(ams::fs::RightsId *out_rights_id, ContentId content_id) { - AMS_ASSERT(this->interface != nullptr); - AMS_ABORT_UNLESS(hos::GetVersion() < hos::Version_3_0_0); - return this->interface->GetRightsIdFromContentIdDeprecated(out_rights_id, content_id); + auto vers = hos::GetVersion(); + if (vers >= hos::Version_3_0_0) { + return this->interface->GetRightsIdFromPlaceHolderId(out_rights_id, placeholder_id); + } else { + AMS_ABORT_UNLESS(vers >= hos::Version_2_0_0); + *out_rights_id = {}; + return this->interface->GetRightsIdFromPlaceHolderIdDeprecated(std::addressof(out_rights_id->id), placeholder_id); + } } Result GetRightsId(ncm::RightsId *out_rights_id, ContentId content_id) { AMS_ASSERT(this->interface != nullptr); - AMS_ABORT_UNLESS(hos::GetVersion() >= hos::Version_3_0_0); - return this->interface->GetRightsIdFromContentId(out_rights_id, content_id); + + auto vers = hos::GetVersion(); + if (vers >= hos::Version_3_0_0) { + return this->interface->GetRightsIdFromContentId(out_rights_id, content_id); + } else { + AMS_ABORT_UNLESS(vers >= hos::Version_2_0_0); + *out_rights_id = {}; + return this->interface->GetRightsIdFromContentIdDeprecated(std::addressof(out_rights_id->id), content_id); + } } Result WriteContentForDebug(ContentId content_id, s64 offset, const void *buf, size_t size) { diff --git a/libraries/libstratosphere/source/ncm/ncm_install_task_base.cpp b/libraries/libstratosphere/source/ncm/ncm_install_task_base.cpp index 23d98cea5..e7e24e4ec 100644 --- a/libraries/libstratosphere/source/ncm/ncm_install_task_base.cpp +++ b/libraries/libstratosphere/source/ncm/ncm_install_task_base.cpp @@ -593,7 +593,7 @@ namespace ams::ncm { R_UNLESS(std::memcmp(hash, content_info->digest.data, crypto::Sha256Generator::HashSize) == 0, ncm::ResultInvalidContentHash()); } - if (!(this->config & InstallConfig_IgnoreTicket)) { + if (hos::GetVersion() >= hos::Version_2_0_0 && !(this->config & InstallConfig_IgnoreTicket)) { ncm::RightsId rights_id; { /* Open the content storage and obtain the rights id. */