Skip to content

Commit

Permalink
Update to v1.1.14.
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkMatterCore committed Apr 21, 2021
1 parent ecae221 commit b1fa56d
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ include $(DEVKITPRO)/libnx/switch_rules

VERSION_MAJOR := 1
VERSION_MINOR := 1
VERSION_MICRO := 13
VERSION_MICRO := 14

APP_TITLE := nxdumptool
APP_AUTHOR := DarkMatterCore
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ Thanks to
Changelog
--------------

**v1.1.14:**

* Fixed support for HOS 12.0.x / AMS 0.19.x. If needed, TIPC serialization is now used to dispatch the `AtmosphereHasService` IPC request.

This is only a bugfix release. I don't expect to release any new versions until the rewrite is finished - the only exception being fixing some kind of feature-breaking bug. Please understand.

**v1.1.13:**

* Fixed compatibility with latest libnx release.
Expand Down
35 changes: 32 additions & 3 deletions source/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ char freeSpaceStr[32] = {'\0'};

browser_entry_size_info *hfs0ExeFsEntriesSizes = NULL;

static const u32 g_smAtmosphereHasService = 65100;
static const SplConfigItem SplConfigItem_ExosphereApiVersion = (SplConfigItem)65000;
static const u32 g_atmosphereTipcVersion = MAKEHOSVERSION(0, 19, 0);

void loadConfig()
{
// Set default configuration values
Expand Down Expand Up @@ -398,11 +402,36 @@ void unmountSysEmmcPartition()
}
}

static bool getExosphereApiVersion(u32 *out)
{
if (!out) return false;

Result rc = 0;
u64 version = 0;

rc = splGetConfig(SplConfigItem_ExosphereApiVersion, &version);
if (R_FAILED(rc)) return false;

*out = (u32)((version >> 40) & 0xFFFFFF);

return true;
}

static Result smAtmosphereHasService(bool *out, SmServiceName name)
{
u8 tmp = 0;
Result rc = serviceDispatchInOut(smGetServiceSession(), 65100, name, tmp);
Result rc = 0;
u32 version = 0;

if (hosversionAtLeast(12, 0, 0) || (getExosphereApiVersion(&version) && version >= g_atmosphereTipcVersion))
{
rc = tipcDispatchInOut(smGetServiceSessionTipc(), g_smAtmosphereHasService, name, tmp);
} else {
rc = serviceDispatchInOut(smGetServiceSession(), g_smAtmosphereHasService, name, tmp);
}

if (R_SUCCEEDED(rc) && out) *out = tmp;

return rc;
}

Expand All @@ -411,9 +440,9 @@ static bool isServiceRunning(const char *name)
if (!name || !*name) return false;

bool out = false;
SmServiceName service_name = smEncodeName(name);
SmServiceName srv_name = smEncodeName(name);

Result rc = smAtmosphereHasService(&out, service_name);
Result rc = smAtmosphereHasService(&out, srv_name);
return (R_SUCCEEDED(rc) && out);
}

Expand Down

0 comments on commit b1fa56d

Please sign in to comment.