Xbox Cloud Gaming app for PS5 Homebrew
C
Log: no sign-in code, gamertag or PS5 user names
Rafael Abud Ferreiraba3ff1475de6
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.ymlindex eda260b..509a2d8 100644--- a/.github/ISSUE_TEMPLATE/bug_report.yml+++ b/.github/ISSUE_TEMPLATE/bug_report.yml@@ -7,6 +7,8 @@ body:value: |Thanks for testing! The log is the most useful thing you can send:it is at `/data/homebrew/PPSA99810/xcloud.log` on the PS5 (copy it over FTP).+ Recent versions keep nothing that identifies you in it (no sign-in+ code, gamertag or PS5 user names); still, have a look before posting it.**Never attach `account.json`**: it gives access to your Microsoft account.For security problems, use the private report link in SECURITY.md instead.diff --git a/ps5/release/README.txt b/ps5/release/README.txtindex e1cf0e8..a083e57 100644--- a/ps5/release/README.txt+++ b/ps5/release/README.txt@@ -106,8 +106,9 @@ on xbox.com / in the Xbox app) and it appears in Your games.Problems---------The app writes a log to /data/homebrew/@TITLE_ID@/xcloud.log (no-passwords or tokens in it). Attach it when you report a problem:+The app writes a log to /data/homebrew/@TITLE_ID@/xcloud.log. It holds+nothing of your account: no password, token, sign-in code, gamertag or+PS5 user name. Attach it when you report a problem:https://github.com/RafaelNGP/xbox-cloud-gaming-ps5/issuesdiff --git a/src/app/ps5_main.cpp b/src/app/ps5_main.cppindex 3c4455f..0cfa6a4 100644--- a/src/app/ps5_main.cpp+++ b/src/app/ps5_main.cpp@@ -561,7 +561,7 @@ void signInAndLoad(auth::AuthManager& am, xcloud::GssvClient& gssv) {std::lock_guard<std::mutex> lock(g_argMutex);g_xblAuth = am.profile().xblAuthorization;}- platform::notify(ui::trf(ui::Str::SignedInAs, am.profile().gamertag));+ platform::notify(ui::trf(ui::Str::SignedInAs, am.profile().gamertag), "signed in (notification)");static bool updateChecked = false;if (!updateChecked && g_autoplayTitle.empty()) {updateChecked = true;@@ -1040,7 +1040,10 @@ int main(int argc, char** argv) {std::string who = std::to_string(i + 1);std::string name = input::padUserName(i);if (!name.empty()) who += " (" + name + ")";- platform::notify(ui::trf(on ? ui::Str::PadConnected : ui::Str::PadDisconnected, who));+ // The PS5 user's name on the TV, not in the log.+ platform::notify(ui::trf(on ? ui::Str::PadConnected : ui::Str::PadDisconnected, who),+ std::string("controller ") + std::to_string(i + 1) ++ (on ? " connected" : " disconnected"));}if (on) g_player->sendInput(other, i);}diff --git a/src/auth/auth_manager.cpp b/src/auth/auth_manager.cppindex 47a0488..193cbb1 100644--- a/src/auth/auth_manager.cpp+++ b/src/auth/auth_manager.cpp@@ -63,8 +63,8 @@ bool AuthManager::deviceCodeSignIn(const DeviceCodeCallback& onCode, std::stringconst std::atomic<bool>* cancel) {DeviceCode dc;if (!msa_.startDeviceCode(dc, err)) return false;- XC_LOGI("device code %s at %s (expires in %ds)", dc.userCode.c_str(), dc.verificationUri.c_str(),- dc.expiresInSec);+ // The code itself stays on the screen: nothing of the sign-in goes to the log.+ XC_LOGI("sign-in code shown (%s, expires in %ds)", dc.verificationUri.c_str(), dc.expiresInSec);if (onCode) onCode(dc);int interval = dc.intervalSec > 0 ? dc.intervalSec : 5;@@ -164,7 +164,7 @@ bool AuthManager::signIn(xcloud::GssvClient& gssv, const DeviceCodeCallback& onCreturn false;}save();- XC_LOGI("signed in as %s", profile_.gamertag.empty() ? "(unknown gamertag)" : profile_.gamertag.c_str());+ XC_LOGI("signed in%s", profile_.gamertag.empty() ? " (no gamertag)" : ""); // the gamertag isn't loggedreturn true;}diff --git a/src/input/controller.cpp b/src/input/controller.cppindex 7909751..52bbd61 100644--- a/src/input/controller.cpp+++ b/src/input/controller.cpp@@ -179,7 +179,7 @@ bool openPad(Pad& pad, int32_t userId, int slot) {pad.handle = h;if (sceUserServiceGetUserName(userId, pad.name, sizeof pad.name) != 0) pad.name[0] = 0;pad.motors.applied = pad.triggers.applied = 0;- XC_LOGI("pad %d opened (handle %d, user %d, rumble mode 0x%08x)", slot, h, userId, static_cast<unsigned>(mode));+ XC_LOGI("pad %d opened (handle %d, rumble mode 0x%08x)", slot, h, static_cast<unsigned>(mode));return true;}diff --git a/src/platform/host/platform_host.cpp b/src/platform/host/platform_host.cppindex f30c16b..8fcbc60 100644--- a/src/platform/host/platform_host.cpp+++ b/src/platform/host/platform_host.cpp@@ -86,6 +86,7 @@ bool resolveIPv4(const std::string& host, uint32_t& addr, std::string& err) {void probeNetworking() {}void notify(const std::string& text) { std::printf("\n>>> %s\n\n", text.c_str()); }+void notify(const std::string& text, const std::string&) { notify(text); }bool systemKeyboardAvailable() { return false; }bool openSystemKeyboard(const std::string&, const std::string&, size_t, KeyboardKind) { return false; }diff --git a/src/platform/platform.h b/src/platform/platform.hindex 6e47c68..4639877 100644--- a/src/platform/platform.h+++ b/src/platform/platform.h@@ -47,6 +47,9 @@ bool startThread(Thread& t, std::function<void()> fn, size_t stackBytes = 8u <<// Short on-screen message (PS5 system notification / host stdout).void notify(const std::string& text);+// The same, with `forLog` written to the log instead of `text` (which may+// name the user: the log gets attached to public bug reports).+void notify(const std::string& text, const std::string& forLog);// The console's own on-screen keyboard (sceImeDialog), one at a time.// openSystemKeyboard() is false where there is none (the host, or a consolediff --git a/src/platform/ps5/platform_ps5.cpp b/src/platform/ps5/platform_ps5.cppindex a9e396a..5889b5d 100644--- a/src/platform/ps5/platform_ps5.cpp+++ b/src/platform/ps5/platform_ps5.cpp@@ -109,8 +109,10 @@ extern "C" int xc_resolve_ipv4(const char* host, uint32_t* addr) {namespace xc::platform {-void notify(const std::string& text) {- XC_LOGI("NOTIFY: %s", text.c_str());+void notify(const std::string& text) { notify(text, text); }++void notify(const std::string& text, const std::string& forLog) {+ XC_LOGI("NOTIFY: %s", forLog.c_str());// Same request layout as PS5_Vulkan's demo renderer.struct NotificationRequest {uint8_t reserved[45];