From 908de31a0e890cf30bbd7370bcd5d6461dfd9268 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Fri, 19 Apr 2019 03:01:54 -0700 Subject: [PATCH] pm: on 7.0.0+, npns is launched in maintenance boot (closes #511) --- stratosphere/ams_mitm/source/fs_mitm/fsmitm_service.hpp | 2 +- stratosphere/pm/source/pm_boot2.cpp | 5 +++++ stratosphere/pm/source/pm_main.cpp | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/stratosphere/ams_mitm/source/fs_mitm/fsmitm_service.hpp b/stratosphere/ams_mitm/source/fs_mitm/fsmitm_service.hpp index e1bb3c48f..1e818aba2 100644 --- a/stratosphere/ams_mitm/source/fs_mitm/fsmitm_service.hpp +++ b/stratosphere/ams_mitm/source/fs_mitm/fsmitm_service.hpp @@ -61,7 +61,7 @@ class FsMitmService : public IMitmServiceObject { /* TODO: intercepting everything seems to cause issues with sleep mode, for some reason. */ /* Figure out why, and address it. */ - if (tid == TitleId_AppletQlaunch) { + if (tid == TitleId_AppletQlaunch || tid == TitleId_AppletMaintenanceMenu) { has_launched_qlaunch = true; } diff --git a/stratosphere/pm/source/pm_boot2.cpp b/stratosphere/pm/source/pm_boot2.cpp index e04eb1c54..410eab8fc 100644 --- a/stratosphere/pm/source/pm_boot2.cpp +++ b/stratosphere/pm/source/pm_boot2.cpp @@ -247,6 +247,11 @@ void EmbeddedBoot2::Main() { if (!maintenance || std::get(launch_program)) { LaunchTitle(std::get(launch_program), FsStorageId_NandSystem, 0, NULL); } + + /* In 7.0.0, Npns was added to the list of titles to launch during maintenance. */ + if (maintenance && std::get(launch_program) == TitleId_Npns && GetRuntimeFirmwareVersion() >= FirmwareVersion_700) { + LaunchTitle(TitleId_Npns, FsStorageId_NandSystem, 0, NULL); + } } /* Allow for user-customizable programs. */ diff --git a/stratosphere/pm/source/pm_main.cpp b/stratosphere/pm/source/pm_main.cpp index 3aac9a359..5c53aa250 100644 --- a/stratosphere/pm/source/pm_main.cpp +++ b/stratosphere/pm/source/pm_main.cpp @@ -179,7 +179,7 @@ int main(int argc, char **argv) /* TODO: Create services. */ server_manager->AddWaitable(new ServiceServer("pm:shell", 3)); server_manager->AddWaitable(new ServiceServer("pm:dmnt", 2)); - server_manager->AddWaitable(new ServiceServer("pm:bm", 5)); + server_manager->AddWaitable(new ServiceServer("pm:bm", 6)); server_manager->AddWaitable(new ServiceServer("pm:info", 1)); /* Loop forever, servicing our services. */