diff --git a/Dockerfile b/Dockerfile index 43e930d..b9a3196 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,6 @@ FROM ghcr.io/wiiu-env/devkitppc:20240423 COPY --from=ghcr.io/wiiu-env/libfunctionpatcher:20230621 /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/wiiumodulesystem:20240424 /artifacts $DEVKITPRO -COPY --from=ghcr.io/wiiu-env/libcontentredirection:20240424 /artifacts $DEVKITPRO +COPY --from=ghcr.io/wiiu-env/libcontentredirection:20240428 /artifacts $DEVKITPRO WORKDIR project diff --git a/src/export.cpp b/src/export.cpp index 5e60770..a2d6c24 100644 --- a/src/export.cpp +++ b/src/export.cpp @@ -3,11 +3,13 @@ #include "FileUtils.h" #include "IFSWrapper.h" #include "malloc.h" +#include "utils/StringTools.h" #include "utils/logger.h" #include "utils/utils.h" #include #include #include +#include #include struct AOCTitle { @@ -115,6 +117,15 @@ ContentRedirectionApiErrorType CRAddFSLayer(CRLayerHandle *handle, const char *l } else if (layerType == FS_LAYER_TYPE_SAVE_REPLACE) { DEBUG_FUNCTION_LINE_INFO("Redirecting \"/vol/save\" to \"%s\", mode: \"replace\"", replacementDir); ptr = make_unique_nothrow(layerName, "/vol/save", replacementDir, false, true); + } else if (layerType == FS_LAYER_TYPE_SAVE_REPLACE_FOR_CURRENT_USER) { + nn::act::Initialize(); + nn::act::PersistentId persistentId = nn::act::GetPersistentId(); + nn::act::Finalize(); + + std::string user = string_format("/vol/save/%08X", 0x80000000 | persistentId); + + DEBUG_FUNCTION_LINE_INFO("Redirecting \"%s\" to \"%s\", mode: \"replace\"", user.c_str(), replacementDir); + ptr = make_unique_nothrow(layerName, user, replacementDir, false, true); } else { DEBUG_FUNCTION_LINE_ERR("CONTENT_REDIRECTION_API_ERROR_UNKNOWN_LAYER_DIR_TYPE: %s %s %d", layerName, replacementDir, layerType); return CONTENT_REDIRECTION_API_ERROR_UNKNOWN_FS_LAYER_TYPE;