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
- 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

View File

@ -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

View File

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

View File

@ -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);