diff --git a/source/dumper.h b/source/dumper.h index 69912b3..63ff088 100644 --- a/source/dumper.h +++ b/source/dumper.h @@ -100,7 +100,7 @@ void copy(const char* from, const char* to, bool exfat = false) mkdirs(folder, 0744); } if(!exfat) { - rc = fsdevCreateFile(to, 0, FS_CREATE_BIG_FILE); + rc = fsdevCreateFile(to, 0, FsCreateOption_BigFile); if (R_FAILED(rc)) { printf("\nfsdevCreateFile() failed: 0x%x", rc); fclose(source); diff --git a/source/ftp_main.h b/source/ftp_main.h index d2e14c3..67c5f89 100644 --- a/source/ftp_main.h +++ b/source/ftp_main.h @@ -95,7 +95,7 @@ ftp_main() sdmcWriteSafe(false); /* initialize needed Switch services */ #elif defined(__SWITCH__) - nifmInitialize(); + nifmInitialize(NifmServiceType_User); #endif /* initialize console subsystem */ diff --git a/source/main.cpp b/source/main.cpp index 0a6c03a..063b469 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -29,7 +29,7 @@ void mainMenuLoop(int kDown) { } else if (kDown & KEY_Y) { - nifmInitialize(); + nifmInitialize(NifmServiceType_User); NifmInternetConnectionStatus connectionStatus; if(R_SUCCEEDED(nifmGetInternetConnectionStatus(nullptr, nullptr, &connectionStatus))) { if(connectionStatus == NifmInternetConnectionStatus_Connected) @@ -47,7 +47,7 @@ int main(int argc, char **argv) mkdirs(mods_root, 0777); mkdir(backups_root, 0777); if(std::filesystem::is_directory(std::filesystem::status(arc_path)) && !std::filesystem::is_empty(arc_path)) - fsdevSetArchiveBit(arc_path.c_str()); + fsdevSetConcatenationFileAttribute(arc_path.c_str()); if(!std::filesystem::exists(outPath) || std::filesystem::is_empty(arc_path)) { menu = ARC_DUMPER_MENU; diff --git a/source/utils.h b/source/utils.h index b3bfc68..e53da98 100644 --- a/source/utils.h +++ b/source/utils.h @@ -1,6 +1,7 @@ #pragma once #include #include +#include #include #include "menu.h" #include "switch.h" @@ -103,9 +104,9 @@ int getRegion() { void getVersion(u64 tid, char version[0x10]) { nsInitialize(); NsApplicationControlData contolData; - nsGetApplicationControlData(1, tid, &contolData, sizeof(NsApplicationControlData), NULL); + nsGetApplicationControlData(NsApplicationControlSource_Storage, tid, &contolData, sizeof(NsApplicationControlData), NULL); nsExit(); - strcpy(version, contolData.nacp.version); + strcpy(version, contolData.nacp.display_version); } int getSmashVersion() { @@ -172,14 +173,15 @@ void log(const char* format, ...) { va_end(args); } -bool isServiceRunning(const char *serviceName) { +bool isServiceRunning(const char* serviceName) { Handle handle; - bool running = R_FAILED(smRegisterService(&handle, serviceName, false, 1)); + SmServiceName encodedName = smEncodeName(serviceName); + bool running = R_FAILED(smRegisterService(&handle, encodedName, false, 1)); svcCloseHandle(handle); if (!running) - smUnregisterService(serviceName); + smUnregisterService(encodedName); return running; } @@ -223,8 +225,8 @@ u64 runningTID() u64 tid = 0; pmdmntInitialize(); pminfoInitialize(); - pmdmntGetApplicationPid(&pid); - pminfoGetTitleId(&tid, pid); + pmdmntGetApplicationProcessId(&pid); + pminfoGetProgramId(&tid, pid); pminfoExit(); pmdmntExit(); return tid;