diff --git a/CHANGELOG.md b/CHANGELOG.md index 070a91920..efd480df2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# Sapphire Changelog +# Geode Changelog ## v5.5.3 * Use legacy messages for detecting isDown (5d0e824) diff --git a/loader/include/Geode/loader/Mod.hpp b/loader/include/Geode/loader/Mod.hpp index 6b2d32a89..383902d71 100644 --- a/loader/include/Geode/loader/Mod.hpp +++ b/loader/include/Geode/loader/Mod.hpp @@ -94,6 +94,7 @@ namespace geode { ZStringView getID() const; ZStringView getName() const; + std::string getHash() const; std::vector getDevelopers() const; std::optional getDescription() const; std::optional getDetails() const; diff --git a/loader/include/Geode/loader/ModMetadata.hpp b/loader/include/Geode/loader/ModMetadata.hpp index 28d927112..7f2d07749 100644 --- a/loader/include/Geode/loader/ModMetadata.hpp +++ b/loader/include/Geode/loader/ModMetadata.hpp @@ -157,6 +157,11 @@ namespace geode { * character set. */ [[nodiscard]] ZStringView getName() const; + /* + * Hash of the mod. + * Gets SHA256 Hash from the mods .geode file + */ + [[nodiscard]] std::string getHash() const; /** * The developers of this mod */ diff --git a/loader/resources/about.md.in b/loader/resources/about.md.in index 41b823e5d..82a586acf 100644 --- a/loader/resources/about.md.in +++ b/loader/resources/about.md.in @@ -1,29 +1,16 @@ -# Sapphire SDK +# Geode SDK -## OFFICIAL ANNOUNCEMENT: THE FUTURE IS SAPPHIRE - -We are pleased to communicate a strategic evolution for our development ecosystem. Effective immediately, **Geode SDK** has been formally acquired by **Sapphire Enterprise Inc.** - a transition engineered to catalyze professional-grade stability and deliver high-fidelity, enterprise-level support to the Geometry Dash modding landscape. - -### Core Infrastructure Paradigm Shift -To ensure a sustainable, scalable future, we are transitioning to a robust, tiered service model: - -* **The Sapphire Pro Tier** - A premium subscription framework designed to unlock elite core features and high-performance modding capabilities. -* **Provisional Access Protocol** - To facilitate a seamless migration, current users have been provisioned with a high-priority, limited-time Free Trial—enabling immediate exploration of the enhanced Sapphire ecosystem. -* **Refined Visual Identity** - The legacy Geode aesthetics have been decommissioned in favor of a clean, corporate-inspired interface—optimizing workflow through a sophisticated "Sapphire" color palette and a modern, high-precision logo. - -*Empowering the next generation of modding through corporate synergy and innovative infrastructure - the Sapphire Era begins now.* - -This mod is the internal representation of **Sapphire SDK**. You can customize Sapphire's settings through this mod. +This mod is the internal representation of **Geode SDK**. You can customize Geode's settings through this mod. ## About -**Sapphire** is a [Geometry Dash](https://store.steampowered.com/app/322170/Geometry_Dash/) mod loader and modding SDK with a modern approach towards mod development. Unlike previous mod loaders, which merely inject the DLLs and let devs handle the rest, Sapphire aims to be a more comprehensive project, which manages loaded mods & hooks itself. Sapphire has been built to ensure compatibility, portability and ease of use while retaining performance. For devs, Sapphire means easy development and portability; for end users, Sapphire means an uniform and easy experience using mods. +**Geode** is a [Geometry Dash](https://store.steampowered.com/app/322170/Geometry_Dash/) mod loader and modding SDK with a modern approach towards mod development. Unlike previous mod loaders, which merely inject the DLLs and let devs handle the rest, Geode aims to be a more comprehensive project, which manages loaded mods & hooks itself. Geode has been built to ensure compatibility, portability and ease of use while retaining performance. For devs, Geode means easy development and portability; for end users, Geode means an uniform and easy experience using mods. ## Help, Contributing, Etc. -If you need help using Sapphire or would like to contribute, feel free to join our [Discord Server](https://discord.gg/9e43WMKzhp). +If you need help using Geode or would like to contribute, feel free to join our [Discord Server](https://discord.gg/9e43WMKzhp). -See [Documentation](https://geode-sdk.github.io/docs) for info about developing mods for Sapphire. +See [Documentation](https://geode-sdk.github.io/docs) for info about developing mods for Geode. ## Credits @@ -49,4 +36,4 @@ Using * [PEGTL](https://github.com/taocpp/PEGTL) * [md4c](https://github.com/mity/md4c) -Special thanks to [RobTop Games](https://twitter.com/RobTopGames/) for making this amazing game and providing us and so many others with hours of entertainment <3 +Special thanks to [RobTop Games](https://twitter.com/RobTopGames/) for making this amazing game and providing us and so many others with hours of entertainment <3 \ No newline at end of file diff --git a/loader/src/internal/crashlog.cpp b/loader/src/internal/crashlog.cpp index 0cbafa489..b15be8372 100644 --- a/loader/src/internal/crashlog.cpp +++ b/loader/src/internal/crashlog.cpp @@ -174,14 +174,14 @@ void crashlog::printMods(Buffer& stream) { }); using namespace std::string_view_literals; for (auto& mod : mods) { - stream.append("{} | [{}] {}\n", + stream.append("{} | [{}] {} ({})\n", mod->isCurrentlyLoading() ? "o"sv : mod->isLoaded() ? "x"sv : mod->targetsOutdatedVersion() ? "*"sv : // thank you very much for this bug report mod->failedToLoad() ? "!"sv : // thank you for this bug report mod->shouldLoad() ? "~"sv : " "sv, - mod->getVersion().toVString(), mod->getID() + mod->getVersion().toVString(), mod->getID(), (mod->getID() == "geode.loader") ? about::getLoaderCommitHash() : mod->getHash() ); } } diff --git a/loader/src/loader/Mod.cpp b/loader/src/loader/Mod.cpp index 46305b689..5a4f07990 100644 --- a/loader/src/loader/Mod.cpp +++ b/loader/src/loader/Mod.cpp @@ -21,6 +21,10 @@ ZStringView Mod::getName() const { return m_impl->getName(); } +std::string Mod::getHash() const { + return m_impl->getHash(); +} + std::vector Mod::getDevelopers() const { return m_impl->getDevelopers(); } diff --git a/loader/src/loader/ModImpl.cpp b/loader/src/loader/ModImpl.cpp index 31b9951a7..7fe3f18a9 100644 --- a/loader/src/loader/ModImpl.cpp +++ b/loader/src/loader/ModImpl.cpp @@ -109,6 +109,10 @@ ZStringView Mod::Impl::getName() const { return m_metadata.getName(); } +std::string Mod::Impl::getHash() const { + return m_metadata.getHash(); +} + bool Mod::Impl::isEphemeral() const { return ModMetadataImpl::getImpl(m_metadata).m_completelyUnparseable; } diff --git a/loader/src/loader/ModImpl.hpp b/loader/src/loader/ModImpl.hpp index 0c39b41be..0e6f49ad3 100644 --- a/loader/src/loader/ModImpl.hpp +++ b/loader/src/loader/ModImpl.hpp @@ -86,6 +86,7 @@ namespace geode { ZStringView getID() const; ZStringView getName() const; + std::string getHash() const; std::vector const& getDevelopers() const; std::optional const& getDescription() const; std::optional const& getDetails() const; diff --git a/loader/src/loader/ModMetadataImpl.cpp b/loader/src/loader/ModMetadataImpl.cpp index 6023315f2..ee0c345d7 100644 --- a/loader/src/loader/ModMetadataImpl.cpp +++ b/loader/src/loader/ModMetadataImpl.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include "ModMetadataImpl.hpp" #include "LoaderImpl.hpp" @@ -583,6 +584,14 @@ ZStringView ModMetadata::getName() const { return m_impl->m_name; } +std::string ModMetadata::getHash() const { + // naomi was here : ) + std::string fileStr = file::readString(m_impl->m_path).unwrapOr(""); + std::string hash = calculateHash(std::span(reinterpret_cast(fileStr.data()), fileStr.size())); + + return hash.substr(0, 8); +} + std::string ModMetadata::formatDeveloperDisplayString(std::vector const& developers) { if (!developers.empty()) { if (Mod::get()->getSavedValue("sapphire-style", false) && developers.front().find("Geode") != std::string::npos) { diff --git a/loader/src/platform/android/crashlog.cpp b/loader/src/platform/android/crashlog.cpp index 718637f67..205192464 100644 --- a/loader/src/platform/android/crashlog.cpp +++ b/loader/src/platform/android/crashlog.cpp @@ -338,7 +338,7 @@ void CrashContext::writeInfo(Buffer& stream) { auto image = this->imageFromAddress(crashAddr); stream.append("Faulty Lib: {}\n", image ? image->name() : ""); - stream.append("Faulty Mod: {}\n", faultyMod ? faultyMod->getID() : ""); + stream.append("Faulty Mod: {} ({})\n", faultyMod ? faultyMod->getID() : "", faultyMod ? faultyMod->getHash() : "N/A"); stream.append("Instruction Address: "); this->formatAddress(crashAddr, infoStream); diff --git a/loader/src/platform/ios/crashlog.mm b/loader/src/platform/ios/crashlog.mm index 692156bbf..413dc70d8 100644 --- a/loader/src/platform/ios/crashlog.mm +++ b/loader/src/platform/ios/crashlog.mm @@ -19,7 +19,7 @@ void CrashContext::writeInfo(Buffer& stream) { auto image = this->imageFromAddress(crashAddr); stream.append("Faulty Lib: {}\n", image ? image->name() : ""); - stream.append("Faulty Mod: {}\n", faultyMod ? faultyMod->getID() : ""); + stream.append("Faulty Mod: {} ({})\n", faultyMod ? faultyMod->getID() : "", faultyMod ? faultyMod->getHash() : "N/A"); stream.append("Instruction Address: "); this->formatAddress(crashAddr, infoStream); diff --git a/loader/src/platform/mac/crashlog.mm b/loader/src/platform/mac/crashlog.mm index a793f4506..cb14d79b3 100644 --- a/loader/src/platform/mac/crashlog.mm +++ b/loader/src/platform/mac/crashlog.mm @@ -20,7 +20,7 @@ void CrashContext::writeInfo(Buffer& stream) { auto image = this->imageFromAddress(crashAddr); stream.append("Faulty Lib: {}\n", image ? image->name() : ""); - stream.append("Faulty Mod: {}\n", faultyMod ? faultyMod->getID() : ""); + stream.append("Faulty Mod: {} ({})\n", faultyMod ? faultyMod->getID() : "", faultyMod ? faultyMod->getHash() : "N/A"); stream.append("Instruction Address: "); this->formatAddress(crashAddr, infoStream); diff --git a/loader/src/platform/windows/crashlog.cpp b/loader/src/platform/windows/crashlog.cpp index 30cfe0485..abde94857 100644 --- a/loader/src/platform/windows/crashlog.cpp +++ b/loader/src/platform/windows/crashlog.cpp @@ -490,7 +490,7 @@ void CrashContext::writeInfo(Buffer& stream) { auto makeFaultyModString = [](Mod* mod) -> std::string { if (!mod) return "Faulty Mod: "; - return fmt::format("Faulty Mod: {} {} ({})", mod->getName(), mod->getVersion().toVString(), mod->getID()); + return fmt::format("Faulty Mod: {} {} ({}, {})", mod->getName(), mod->getVersion().toVString(), mod->getID(), mod->getHash()); }; if (code == EXCEPTION_NUMBER) {