diff --git a/SandboxiePlus/SandMan/SandMan.cpp b/SandboxiePlus/SandMan/SandMan.cpp
index dde3e0ca..9564fcab 100644
--- a/SandboxiePlus/SandMan/SandMan.cpp
+++ b/SandboxiePlus/SandMan/SandMan.cpp
@@ -2337,7 +2337,7 @@ void CSandMan::CheckSupport()
return;
static bool ReminderShown = false;
- if (!ReminderShown && (g_CertInfo.expired || g_CertInfo.about_to_expire) && !theConf->GetBool("Options/NoSupportCheck", false))
+ if (!ReminderShown && (g_CertInfo.expired || (g_CertInfo.expirers_in_sec > 0 && g_CertInfo.expirers_in_sec < (60 * 60 * 24 * 30))) && !theConf->GetBool("Options/NoSupportCheck", false))
{
ReminderShown = true;
CSettingsWindow* pSettingsWindow = new CSettingsWindow(this);
@@ -2629,14 +2629,13 @@ void CSandMan::UpdateCertState()
}
else
{
- g_CertInfo.about_to_expire = g_CertInfo.expirers_in_sec > 0 && g_CertInfo.expirers_in_sec < (60 * 60 * 24 * 30);
if (g_CertInfo.outdated)
OnLogMessage(tr("The supporter certificate is not valid for this build, please get an updated certificate"));
// outdated always implicates it is no longer valid
else if (g_CertInfo.expired) // may be still valid for the current and older builds
OnLogMessage(tr("The supporter certificate has expired%1, please get an updated certificate")
.arg(!g_CertInfo.outdated ? tr(", but it remains valid for the current build") : ""));
- else if (g_CertInfo.about_to_expire)
+ else if (g_CertInfo.expirers_in_sec > 0 && g_CertInfo.expirers_in_sec < (60 * 60 * 24 * 30))
OnLogMessage(tr("The supporter certificate will expire in %1 days, please get an updated certificate").arg(g_CertInfo.expirers_in_sec / (60 * 60 * 24)));
}
diff --git a/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp b/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp
index 06c69587..2a8325bb 100644
--- a/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp
+++ b/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp
@@ -1045,16 +1045,16 @@ void CSettingsWindow::UpdateCert()
QString infoMsg = tr("This supporter certificate has expired, please get an updated certificate.");
if (g_CertInfo.valid) {
if (g_CertInfo.grace_period)
- infoMsg.append(tr("
Plus features will be disabled in %1 days.").arg(30 + g_CertInfo.expirers_in_sec / (60*60*24)));
+ infoMsg.append(tr("
Plus features will be disabled in %1 days.").arg((g_CertInfo.expirers_in_sec + 30*60*60*24) / (60*60*24)));
else if (!g_CertInfo.outdated) // must be an expiren medium or large cert on an old build
- infoMsg.append(tr("
For this build Plus features remain enabled."));
+ infoMsg.append(tr("
For the current build Plus features remain enabled, but you no longer have access to Sandboxie-Live services, including compatibility updates and the troubleshooting database."));
} else
infoMsg.append(tr("
Plus features are no longer enabled."));
ui.lblCertExp->setText(infoMsg);
ui.lblCertExp->setVisible(true);
}
else {
- if (g_CertInfo.about_to_expire) {
+ if (g_CertInfo.expirers_in_sec > 0 && g_CertInfo.expirers_in_sec < (60 * 60 * 24 * 30)) {
ui.lblCertExp->setText(tr("This supporter certificate will expire in %1 days, please get an updated certificate.").arg(g_CertInfo.expirers_in_sec / (60*60*24)));
ui.lblCertExp->setVisible(true);
}
@@ -1479,10 +1479,12 @@ bool CSettingsWindow::ApplyCertificate(const QByteArray &Certificate, QWidget* w
theGUI->UpdateCertState();
if (g_CertInfo.expired || g_CertInfo.outdated) {
- if(g_CertInfo.expired)
- QMessageBox::information(widget, "Sandboxie-Plus", tr("This certificate is unfortunately expired."));
+ if(g_CertInfo.outdated)
+ QMessageBox::information(widget, "Sandboxie-Plus", tr("This certificate is unfortunately not valid for the current build, you need to get a new certificate or downgrade to an earlier build."));
+ else if(g_CertInfo.valid && !g_CertInfo.grace_period)
+ QMessageBox::information(widget, "Sandboxie-Plus", tr("Although this certificate has expired, for the currently installed version plus features remain enabled. However, you will no longer have access to Sandboxie-Live services, including compatibility updates and the online troubleshooting database."));
else
- QMessageBox::information(widget, "Sandboxie-Plus", tr("This certificate is unfortunately outdated."));
+ QMessageBox::information(widget, "Sandboxie-Plus", tr("This certificate has unfortunately expired, you need to get a new certificate."));
}
else {
QMessageBox::information(widget, "Sandboxie-Plus", tr("Thank you for supporting the development of Sandboxie-Plus."));
@@ -2021,13 +2023,6 @@ void CSettingsWindow::CertChanged()
void CSettingsWindow::LoadCertificate(QString CertPath)
{
-#ifdef _DEBUG
- if (GetKeyState(VK_CONTROL) & 0x8000) {
- g_Certificate.clear();
- return;
- }
-#endif
-
if (theAPI && theAPI->IsConnected())
CertPath = theAPI->GetSbiePath() + "\\Certificate.dat";
diff --git a/SandboxiePlus/SandMan/Windows/SettingsWindow.h b/SandboxiePlus/SandMan/Windows/SettingsWindow.h
index 786b57a7..1902bf8f 100644
--- a/SandboxiePlus/SandMan/Windows/SettingsWindow.h
+++ b/SandboxiePlus/SandMan/Windows/SettingsWindow.h
@@ -207,10 +207,7 @@ union SCertInfo {
reservd_3 : 8,
reservd_4 : 7,
insider : 1;
- qint32
- expirers_in_sec : 30,
- unused_1 : 1, // skim a couple high bits to use as flags flag, 0x3fffffff -> is 34 years count down is enough
- about_to_expire : 1;
+ qint32 expirers_in_sec;
};
};
extern SCertInfo g_CertInfo;