diff --git a/app/src/main/cpp/skyline/common.h b/app/src/main/cpp/skyline/common.h index c2414c41..68ff61f3 100644 --- a/app/src/main/cpp/skyline/common.h +++ b/app/src/main/cpp/skyline/common.h @@ -41,6 +41,7 @@ namespace skyline { constexpr u32 NoMessages = 0x680; //!< "No message available" constexpr u32 ServiceInvName = 0xC15; //!< "Invalid name" constexpr u32 ServiceNotReg = 0xE15; //!< "Service not registered" + constexpr u32 InvUser = 0xC87C; //!< Invalid user constexpr u32 InvSize = 0xCA01; //!< "Invalid size" constexpr u32 InvAddress = 0xCC01; //!< "Invalid address" constexpr u32 InvState = 0xD401; //!< "Invalid MemoryState" diff --git a/app/src/main/cpp/skyline/services/account/IAccountServiceForApplication.cpp b/app/src/main/cpp/skyline/services/account/IAccountServiceForApplication.cpp index f09d0843..7d2712fd 100644 --- a/app/src/main/cpp/skyline/services/account/IAccountServiceForApplication.cpp +++ b/app/src/main/cpp/skyline/services/account/IAccountServiceForApplication.cpp @@ -29,7 +29,7 @@ namespace skyline::service::account { void IAccountServiceForApplication::GetProfile(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { auto id = request.Pop(); if (id != constant::DefaultUserId) { - response.errorCode = constant::InvUser; + response.errorCode = constant::status::InvUser; return; } diff --git a/app/src/main/cpp/skyline/services/account/IAccountServiceForApplication.h b/app/src/main/cpp/skyline/services/account/IAccountServiceForApplication.h index b7bf0bfd..c535894b 100644 --- a/app/src/main/cpp/skyline/services/account/IAccountServiceForApplication.h +++ b/app/src/main/cpp/skyline/services/account/IAccountServiceForApplication.h @@ -59,7 +59,5 @@ namespace skyline { namespace constant { constexpr service::account::UserId DefaultUserId = {0x0000000000000001, 0x0000000000000000}; //!< The default user ID - - constexpr u32 InvUser = 0xC87C; //!< Invalid user } } \ No newline at end of file diff --git a/app/src/main/cpp/skyline/services/account/IProfile.cpp b/app/src/main/cpp/skyline/services/account/IProfile.cpp index 7078e862..ffd268a8 100644 --- a/app/src/main/cpp/skyline/services/account/IProfile.cpp +++ b/app/src/main/cpp/skyline/services/account/IProfile.cpp @@ -11,25 +11,28 @@ namespace skyline::service::account { void IProfile::Get(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { struct AccountUserData { - u32 _unk0_; //!< Unknown. - u32 iconID; //!< Icon ID (0 = Mii, the rest are character icon IDs). + u32 _unk0_; + u32 iconID; //!< Icon ID (0 = Mii, the rest are character icon IDs) u8 iconBackgroundColorID; //!< Profile icon background color ID - std::array _unk1_; //!< Unknown. - std::array miiID; //!< Some ID related to the Mii? All zeros when a character icon is used. - std::array _unk2_; //!< Unknown. + u8 _unk1_[0x7]; + std::array miiID; //!< Some ID related to the Mii? All zeros when a character icon is used + u8 _unk2_[0x60]; }; struct { UserId uid; //!< The UID of the corresponding account - u64 lastEditTimestamp; //!< A POSIX UTC timestamp denoting the last account edit. - std::array nickname; //!< UTF-8 Nickname. - } accountProfileBase = {.uid = userId}; + u64 lastEditTimestamp; //!< A POSIX UTC timestamp denoting the last account edit + std::array nickname; //!< UTF-8 Nickname + } accountProfileBase = { + .uid = userId + }; - std::string username = state.settings->GetString("username_value"); + auto username = state.settings->GetString("username_value"); size_t usernameSize = std::min(accountProfileBase.nickname.size(), username.size()); std::memcpy(accountProfileBase.nickname.data(), username.c_str(), usernameSize); + accountProfileBase.nickname[accountProfileBase.nickname.size() - 1] = '\0'; - AccountUserData *userData = state.process->GetPointer(request.outputBuf.at(0).address); + auto userData = state.process->GetPointer(request.outputBuf.at(0).address); userData->iconBackgroundColorID = 0x1; // Color indexing starts at 0x1 response.Push(accountProfileBase); diff --git a/app/src/main/cpp/skyline/services/account/IProfile.h b/app/src/main/cpp/skyline/services/account/IProfile.h index 73d95abf..a091ef69 100644 --- a/app/src/main/cpp/skyline/services/account/IProfile.h +++ b/app/src/main/cpp/skyline/services/account/IProfile.h @@ -16,7 +16,6 @@ namespace skyline::service::account { IProfile(const DeviceState &state, ServiceManager &manager, const UserId &userId); private: - UserId userId; /** diff --git a/app/src/main/java/emu/skyline/preference/CustomEditTextPreference.kt b/app/src/main/java/emu/skyline/preference/CustomEditTextPreference.kt index 0db6c548..c063a2b7 100644 --- a/app/src/main/java/emu/skyline/preference/CustomEditTextPreference.kt +++ b/app/src/main/java/emu/skyline/preference/CustomEditTextPreference.kt @@ -16,7 +16,6 @@ import emu.skyline.R * This class adapts [EditTextPreference] so that it supports setting the value as the summary automatically. Also added useful attributes. */ class CustomEditTextPreference : EditTextPreference { - constructor(context : Context, attrs : AttributeSet?, defStyleAttr : Int, defStyleRes : Int) : super(context, attrs, defStyleAttr, defStyleRes) { attrs?.let { val a = context.obtainStyledAttributes(it, R.styleable.CustomEditTextPreference, defStyleAttr, 0) diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index 22fdf007..162c3b62 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -65,7 +65,7 @@