diff --git a/CHANGELOG.md b/CHANGELOG.md index b84e3949..5dbbdf88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Changed - improved suspend process ahndling [#3375](https://github.com/sandboxie-plus/Sandboxie/issues/3375) +- improved handling of issue reports ### Fixed - fixed issue with auto updater not offering version updates diff --git a/SandboxiePlus/SandMan/OnlineUpdater.cpp b/SandboxiePlus/SandMan/OnlineUpdater.cpp index 4d617dfa..354d207b 100644 --- a/SandboxiePlus/SandMan/OnlineUpdater.cpp +++ b/SandboxiePlus/SandMan/OnlineUpdater.cpp @@ -76,6 +76,17 @@ void COnlineUpdater::OnRequestFinished() pReply->deleteLater(); } +quint64 COnlineUpdater::GetRandID() +{ + quint64 RandID = 0; + theAPI->GetSecureParam("RandID", &RandID, sizeof(RandID)); + if (!RandID) { + RandID = QRandomGenerator64::global()->generate(); + theAPI->SetSecureParam("RandID", &RandID, sizeof(RandID)); + } + return RandID; +} + SB_PROGRESS COnlineUpdater::GetUpdates(QObject* receiver, const char* member, const QVariantMap& Params) { QUrlQuery Query; @@ -102,13 +113,7 @@ SB_PROGRESS COnlineUpdater::GetUpdates(QObject* receiver, const char* member, co if (!UpdateKey.isEmpty()) UpdateKey += "-"; - quint64 RandID = 0; - theAPI->GetSecureParam("RandID", &RandID, sizeof(RandID)); - if (!RandID) { - RandID = QRandomGenerator64::global()->generate(); - theAPI->SetSecureParam("RandID", &RandID, sizeof(RandID)); - } - + quint64 RandID = COnlineUpdater::GetRandID(); quint32 Hash = theAPI->GetUserSettings()->GetName().mid(13).toInt(NULL, 16); quint64 HashID = RandID ^ (quint64((Hash & 0xFFFF) ^ ((Hash >> 16) & 0xFFFF)) << 48); // fold the hash in half and xor it with the first 16 bit of RandID diff --git a/SandboxiePlus/SandMan/OnlineUpdater.h b/SandboxiePlus/SandMan/OnlineUpdater.h index 100c9b5a..770717e6 100644 --- a/SandboxiePlus/SandMan/OnlineUpdater.h +++ b/SandboxiePlus/SandMan/OnlineUpdater.h @@ -115,6 +115,8 @@ public: static quint32 CurrentVersion(); static quint32 VersionToInt(const QString& VersionStr); + static quint64 GetRandID(); + private slots: void OnRequestFinished(); diff --git a/SandboxiePlus/SandMan/Wizards/BoxAssistant.cpp b/SandboxiePlus/SandMan/Wizards/BoxAssistant.cpp index 4c3c7c19..a9735f16 100644 --- a/SandboxiePlus/SandMan/Wizards/BoxAssistant.cpp +++ b/SandboxiePlus/SandMan/Wizards/BoxAssistant.cpp @@ -22,6 +22,7 @@ #include "../AddonManager.h" #include "../MiscHelpers/Common/NetworkAccessManager.h" #include "../CustomStyles.h" +#include "../OnlineUpdater.h" CBoxAssistant::CBoxAssistant(QWidget *parent) : QWizard(parent) @@ -1017,6 +1018,12 @@ bool CSubmitPage::validatePage() pMultiPart->append(eMail); } + quint64 RandID = COnlineUpdater::GetRandID(); + QHttpPart randId; + randId.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"randId\"")); + randId.setBody(QString::number(RandID, 16).rightJustified(16, '0').toUpper().toUtf8()); + pMultiPart->append(randId); + QUrl Url("https://sandboxie-plus.com/issues/submit.php"); QNetworkRequest Request(Url); //Request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);