This commit is contained in:
german77
2024-01-28 00:32:50 -06:00
parent 09ababeaad
commit 905356ccfc
7 changed files with 132 additions and 5 deletions

View File

@@ -6,11 +6,49 @@
namespace Service::AM {
IApplicationAccessor::IApplicationAccessor(Core::System& system_, u64 application_id)
: ServiceFramework{system_, "IApplicationAccessor"} {
// clang-format off
static const FunctionInfo functions[] = {
{0, nullptr, "GetAppletStateChangedEvent"},
{1, nullptr, "IsCompleted"},
{10, nullptr, "Start"},
{20, nullptr, "RequestExit"},
{25, nullptr, "Terminate"},
{30, nullptr, "GetResult"},
{101, nullptr, "RequestForApplicationToGetForeground"},
{110, nullptr, "TerminateAllLibraryApplets"},
{111, nullptr, "AreAnyLibraryAppletsLeft"},
{112, nullptr, "GetCurrentLibraryApplet"},
{120, nullptr, "GetApplicationId"},
{121, nullptr, "PushLaunchParameter"},
{122, nullptr, "GetApplicationControlProperty"},
{123, nullptr, "GetApplicationLaunchProperty"},
{124, nullptr, "GetApplicationLaunchRequestInfo"},
{130, nullptr, "SetUsers"},
{131, nullptr, "CheckRightsEnvironmentAvailable"},
{132, nullptr, "GetNsRightsEnvironmentHandle"},
{140, nullptr, "GetDesirableUids"},
{150, nullptr, "ReportApplicationExitTimeout"},
{160, nullptr, "SetApplicationAttribute"},
{170, nullptr, "HasSaveDataAccessPermission"},
{180, nullptr, "PushToFriendInvitationStorageChannel"},
{190, nullptr, "PushToNotificationStorageChannel"},
{200, nullptr, "RequestApplicationSoftReset"},
{201, nullptr, "RestartApplicationTimer"},
};
// clang-format on
RegisterHandlers(functions);
}
IApplicationAccessor::~IApplicationAccessor() = default;
IApplicationCreator::IApplicationCreator(Core::System& system_)
: ServiceFramework{system_, "IApplicationCreator"} {
// clang-format off
static const FunctionInfo functions[] = {
{0, nullptr, "CreateApplication"},
{0, &IApplicationCreator::CreateApplication, "CreateApplication"},
{1, nullptr, "PopLaunchRequestedApplication"},
{10, nullptr, "CreateSystemApplication"},
{100, nullptr, "PopFloatingApplicationForDevelopment"},
@@ -22,4 +60,15 @@ IApplicationCreator::IApplicationCreator(Core::System& system_)
IApplicationCreator::~IApplicationCreator() = default;
void IApplicationCreator::CreateApplication(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
const auto application_id = rp.Pop<u64>();
LOG_ERROR(Service_NS, "called, application_id={:x}",application_id);
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
rb.PushIpcInterface<IApplicationAccessor>(system, application_id);
}
} // namespace Service::AM

View File

@@ -7,10 +7,21 @@
namespace Service::AM {
class IApplicationAccessor final : public ServiceFramework<IApplicationAccessor> {
public:
explicit IApplicationAccessor(Core::System& system_, u64 application_id);
~IApplicationAccessor() override;
private:
};
class IApplicationCreator final : public ServiceFramework<IApplicationCreator> {
public:
explicit IApplicationCreator(Core::System& system_);
~IApplicationCreator() override;
private:
void CreateApplication(HLERequestContext& ctx);
};
} // namespace Service::AM

View File

@@ -598,7 +598,7 @@ void IGeneralService::ConfirmSystemAvailability(HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 3};
rb.Push(ResultSuccess);
rb.Push(true);
rb.Push(false);
}
void IGeneralService::GetCurrentAccessPoint(HLERequestContext& ctx) {

View File

@@ -260,7 +260,7 @@ IApplicationManagerInterface::IApplicationManagerInterface(Core::System& system_
{2016, nullptr, "ListNotCommittedContentMeta"},
{2017, nullptr, "CreateDownloadTask"},
{2018, nullptr, "GetApplicationDeliveryInfoHash"},
{2050, nullptr, "GetApplicationRightsOnClient"},
{2050, &IApplicationManagerInterface::GetApplicationRightsOnClient, "GetApplicationRightsOnClient"},
{2051, nullptr, "InvalidateRightsIdCache"},
{2100, nullptr, "GetApplicationTerminateResult"},
{2101, nullptr, "GetRawApplicationTerminateResult"},
@@ -524,6 +524,36 @@ void IApplicationManagerInterface::GetApplicationViewWithPromotionInfo(HLEReques
rb.Push(ResultSuccess);
}
void IApplicationManagerInterface::GetApplicationRightsOnClient(HLERequestContext& ctx) {
struct ApplicationRightsOnClient {
u64 application_id;
Common::UUID uid;
u8 flags;
u8 flags2;
INSERT_PADDING_BYTES(0x6);
};
IPC::RequestParser rp{ctx};
const auto flags = rp.Pop<u32>();
const auto application_id = rp.Pop<u64>();
const auto uid = rp.PopRaw<Common::UUID>();
LOG_ERROR(Service_NS, "(STUBBED) called, flags={}, application_id={:x}, uid={}",flags,application_id,uid.FormattedString());
ApplicationRightsOnClient rights{
.application_id = application_id,
.uid = uid,
.flags = 0,
.flags2 = 0,
};
ctx.WriteBuffer(rights);
IPC::ResponseBuilder rb{ctx, 3};
rb.Push(ResultSuccess);
rb.Push(1);
}
void IApplicationManagerInterface::CheckSdCardMountStatus(HLERequestContext& ctx) {
LOG_ERROR(Service_NS, "(STUBBED) called");

View File

@@ -93,6 +93,7 @@ private:
void IsAnyApplicationEntityInstalled(HLERequestContext& ctx);
void GetApplicationView(HLERequestContext& ctx);
void GetApplicationViewWithPromotionInfo(HLERequestContext& ctx);
void GetApplicationRightsOnClient(HLERequestContext& ctx);
void CheckSdCardMountStatus(HLERequestContext& ctx);
void GetSdCardMountStatusChangedEvent(HLERequestContext& ctx);
void GetFreeSpaceSize(HLERequestContext& ctx);

View File

@@ -143,6 +143,34 @@ private:
}
};
class IDaemonController final : public ServiceFramework<IDaemonController> {
public:
explicit IDaemonController(Core::System& system_)
: ServiceFramework{system_, "IDaemonController"} {
// clang-format off
static const FunctionInfo functions[] = {
{0, nullptr, "Unknown0"},
{1, nullptr, "Unknown1"},
{2, nullptr, "Unknown2"},
{3, nullptr, "Unknown3"},
{4, nullptr, "Unknown4"},
{5, nullptr, "Unknown5"},
{6, nullptr, "Unknown6"},
{7, nullptr, "Unknown7"},
{8, nullptr, "Unknown8"},
{9, nullptr, "Unknown9"},
{10, nullptr, "Unknown10"},
{11, nullptr, "Unknown11"},
{12, nullptr, "Unknown12"},
};
// clang-format on
RegisterHandlers(functions);
}
private:
};
class IOlscServiceForSystemService final : public ServiceFramework<IOlscServiceForSystemService> {
public:
explicit IOlscServiceForSystemService(Core::System& system_)
@@ -151,7 +179,7 @@ public:
static const FunctionInfo functions[] = {
{0, &IOlscServiceForSystemService::OpenTransferTaskListController, "OpenTransferTaskListController"},
{1, nullptr, "OpenRemoteStorageController"},
{2, nullptr, "OpenDaemonController"},
{2, &IOlscServiceForSystemService::OpenDaemonController, "OpenDaemonController"},
{10, nullptr, "Unknown10"},
{11, nullptr, "Unknown11"},
{12, nullptr, "Unknown12"},
@@ -222,6 +250,14 @@ private:
rb.PushIpcInterface<ITransferTaskListController>(system);
}
void OpenDaemonController(HLERequestContext& ctx) {
LOG_INFO(Service_OLSC, "called");
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
rb.PushIpcInterface<IDaemonController>(system);
}
void Unknown10000(HLERequestContext& ctx) {
LOG_INFO(Service_OLSC, "called");

View File

@@ -57,7 +57,7 @@ bool GestureHandler::NeedsUpdate() {
for (size_t id = 0; id < MaxPoints; id++) {
if (gesture.points[id] != last_gesture.points[id]) {
return true;
}
}
}
// Update on press and hold event after 0.5 seconds