Skip to content

Commit

Permalink
1.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidXanatos committed Oct 20, 2023
1 parent 33599a0 commit ec1c069
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 12 additions & 7 deletions SandboxiePlus/SandMan/OnlineUpdater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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

Expand Down
2 changes: 2 additions & 0 deletions SandboxiePlus/SandMan/OnlineUpdater.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ class COnlineUpdater : public QObject
static quint32 CurrentVersion();
static quint32 VersionToInt(const QString& VersionStr);

static quint64 GetRandID();

private slots:
void OnRequestFinished();

Expand Down
7 changes: 7 additions & 0 deletions SandboxiePlus/SandMan/Wizards/BoxAssistant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "../AddonManager.h"
#include "../MiscHelpers/Common/NetworkAccessManager.h"
#include "../CustomStyles.h"
#include "../OnlineUpdater.h"

CBoxAssistant::CBoxAssistant(QWidget *parent)
: QWizard(parent)
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit ec1c069

Please sign in to comment.