This commit is contained in:
DavidXanatos 2023-10-20 17:01:26 +02:00
parent 33599a0c99
commit ec1c069432
4 changed files with 22 additions and 7 deletions

View File

@ -17,6 +17,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Changed ### Changed
- improved suspend process ahndling [#3375](https://github.com/sandboxie-plus/Sandboxie/issues/3375) - improved suspend process ahndling [#3375](https://github.com/sandboxie-plus/Sandboxie/issues/3375)
- improved handling of issue reports
### Fixed ### Fixed
- fixed issue with auto updater not offering version updates - fixed issue with auto updater not offering version updates

View File

@ -76,6 +76,17 @@ void COnlineUpdater::OnRequestFinished()
pReply->deleteLater(); 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) SB_PROGRESS COnlineUpdater::GetUpdates(QObject* receiver, const char* member, const QVariantMap& Params)
{ {
QUrlQuery Query; QUrlQuery Query;
@ -102,13 +113,7 @@ SB_PROGRESS COnlineUpdater::GetUpdates(QObject* receiver, const char* member, co
if (!UpdateKey.isEmpty()) if (!UpdateKey.isEmpty())
UpdateKey += "-"; UpdateKey += "-";
quint64 RandID = 0; quint64 RandID = COnlineUpdater::GetRandID();
theAPI->GetSecureParam("RandID", &RandID, sizeof(RandID));
if (!RandID) {
RandID = QRandomGenerator64::global()->generate();
theAPI->SetSecureParam("RandID", &RandID, sizeof(RandID));
}
quint32 Hash = theAPI->GetUserSettings()->GetName().mid(13).toInt(NULL, 16); 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 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

View File

@ -115,6 +115,8 @@ public:
static quint32 CurrentVersion(); static quint32 CurrentVersion();
static quint32 VersionToInt(const QString& VersionStr); static quint32 VersionToInt(const QString& VersionStr);
static quint64 GetRandID();
private slots: private slots:
void OnRequestFinished(); void OnRequestFinished();

View File

@ -22,6 +22,7 @@
#include "../AddonManager.h" #include "../AddonManager.h"
#include "../MiscHelpers/Common/NetworkAccessManager.h" #include "../MiscHelpers/Common/NetworkAccessManager.h"
#include "../CustomStyles.h" #include "../CustomStyles.h"
#include "../OnlineUpdater.h"
CBoxAssistant::CBoxAssistant(QWidget *parent) CBoxAssistant::CBoxAssistant(QWidget *parent)
: QWizard(parent) : QWizard(parent)
@ -1017,6 +1018,12 @@ bool CSubmitPage::validatePage()
pMultiPart->append(eMail); 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"); QUrl Url("https://sandboxie-plus.com/issues/submit.php");
QNetworkRequest Request(Url); QNetworkRequest Request(Url);
//Request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true); //Request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);