Prevent use with Artic Base and print otp path

This commit is contained in:
PabloMK7 2025-03-15 22:24:51 +01:00
parent 808b47644e
commit 8be59138f4
4 changed files with 12 additions and 3 deletions

View File

@ -1,6 +1,6 @@
VERSION_MAJOR := 1 VERSION_MAJOR := 1
VERSION_MINOR := 0 VERSION_MINOR := 0
VERSION_REVISION := 0 VERSION_REVISION := 1
all: all:
mkdir -p plugin/build mkdir -p plugin/build

View File

@ -26,7 +26,7 @@ LIBRARIES := ctru
VERSION_MAJOR := 1 VERSION_MAJOR := 1
VERSION_MINOR := 0 VERSION_MINOR := 0
VERSION_MICRO := 0 VERSION_MICRO := 1
BUILD_FLAGS := -march=armv6k -mtune=mpcore -mfloat-abi=hard BUILD_FLAGS := -march=armv6k -mtune=mpcore -mfloat-abi=hard
BUILD_FLAGS_CC := -g -Wall -Wno-strict-aliasing -O3 -mword-relocations \ BUILD_FLAGS_CC := -g -Wall -Wno-strict-aliasing -O3 -mword-relocations \

View File

@ -16,7 +16,7 @@ SOURCES := ArticProtocol/sources sources sources/CTRPluginFramework
VERSION_MAJOR := 1 VERSION_MAJOR := 1
VERSION_MINOR := 0 VERSION_MINOR := 0
VERSION_REVISION := 0 VERSION_REVISION := 1
SERVER_PORT := 5543 SERVER_PORT := 5543
IP := 19 IP := 19

View File

@ -29,6 +29,7 @@ namespace ArticFunctions {
std::map<u64, HandleType> openHandles; std::map<u64, HandleType> openHandles;
CTRPluginFramework::Mutex amMutex; CTRPluginFramework::Mutex amMutex;
CTRPluginFramework::Mutex cfgMutex; CTRPluginFramework::Mutex cfgMutex;
bool isAzaharCalled = false;
void Process_GetTitleID(ArticProtocolServer::MethodInterface& mi) { void Process_GetTitleID(ArticProtocolServer::MethodInterface& mi) {
bool good = true; bool good = true;
@ -98,6 +99,12 @@ namespace ArticFunctions {
if (good) good = mi.FinishInputParameters(); if (good) good = mi.FinishInputParameters();
if (!good) return; if (!good) return;
if (!isAzaharCalled) {
logger.Error("This tool cannot be used with the\n \"Connect to Artic Base\" option.\n Use \"Set Up System Files\" option.");
mi.FinishGood(-1);
return;
}
s64 out; s64 out;
if (R_FAILED(svcGetProcessInfo(&out, CUR_PROCESS_HANDLE, 0x10005))) { if (R_FAILED(svcGetProcessInfo(&out, CUR_PROCESS_HANDLE, 0x10005))) {
mi.FinishInternalError(); mi.FinishInternalError();
@ -525,6 +532,7 @@ namespace ArticFunctions {
return; return;
} }
reinterpret_cast<u32*>(ret_buf->data)[0] = INITIAL_SETUP_APP_VERSION; reinterpret_cast<u32*>(ret_buf->data)[0] = INITIAL_SETUP_APP_VERSION;
isAzaharCalled = true;
mi.FinishGood(0); mi.FinishGood(0);
} }
@ -628,6 +636,7 @@ namespace ArticFunctions {
res = FSUSER_OpenFileDirectly(&file, ARCHIVE_SDMC, fsMakePath(PATH_EMPTY, ""), fsMakePath(PATH_ASCII, filePath), FS_OPEN_READ, 0); res = FSUSER_OpenFileDirectly(&file, ARCHIVE_SDMC, fsMakePath(PATH_EMPTY, ""), fsMakePath(PATH_ASCII, filePath), FS_OPEN_READ, 0);
if (R_FAILED(res)) { if (R_FAILED(res)) {
logger.Error("Missing OTP backup on SD card, please update your luma version and/or remove the console battery."); logger.Error("Missing OTP backup on SD card, please update your luma version and/or remove the console battery.");
logger.Error(filePath);
mi.FinishGood(res); mi.FinishGood(res);
return; return;
} }