From c6d4836737feff5a386a21117378b3f3b7d549d2 Mon Sep 17 00:00:00 2001 From: love-code-yeyixiao <188240888@qq.com> Date: Sun, 17 Mar 2024 11:14:03 +0800 Subject: [PATCH 01/10] Update Sandman --- SandboxiePlus/SandMan/Forms/OptionsWindow.ui | 391 +++++++++--------- SandboxiePlus/SandMan/SandMan.cpp | 7 +- .../SandMan/Windows/OptionsAdvanced.cpp | 9 +- 3 files changed, 211 insertions(+), 196 deletions(-) diff --git a/SandboxiePlus/SandMan/Forms/OptionsWindow.ui b/SandboxiePlus/SandMan/Forms/OptionsWindow.ui index 8d450811..63360739 100644 --- a/SandboxiePlus/SandMan/Forms/OptionsWindow.ui +++ b/SandboxiePlus/SandMan/Forms/OptionsWindow.ui @@ -55,7 +55,7 @@ - 3 + 1 @@ -284,200 +284,203 @@ File Options - + - - - - - - 75 - true - true - - - - Disk/File access - - - - - - - Use volume serial numbers for drives, like: \drive\C~1234-ABCD - - - - - - - - 20 - 16777215 - - - - - - - - - - - Qt::Horizontal - - - - 40 - 0 - - - - - - - - Encrypt sandbox content - - - - - - - Auto delete content when last sandboxed process terminates - - - - - - - When <a href="sbie://docs/boxencryption">Box Encryption</a> is enabled the box’s root folder, including its registry hive, is stored in an encrypted disk image, using <a href="https://diskcryptor.org">Disk Cryptor's</a> AES-XTS implementation. - - - true - - - true - - - - - - - - 75 - true - true - - - - Box Delete options - - - - - - - Qt::Vertical - - - - 20 - 0 - - - - - - - - Allow elevated sandboxed applications to read the harddrive - - - - - - - Partially checked means prevent box removal but not content deletion. - - - Protect this sandbox from deletion or emptying - - - true - - - - - - - <a href="addon://ImDisk">Install ImDisk</a> driver to enable Ram Disk and Disk Image support. - - - - - - - Separate user folders - - - false - - - - - - - - 75 - true - true - - - - Box Structure - - - - - - - Store the sandbox content in a Ram Disk - - - - - - - Warn when an application opens a harddrive handle - - - - - - - - - - Set Password - - - - - - - Virtualization scheme - - - - - - - The box structure can only be changed when the sandbox is empty - - - - + + + + 75 + true + true + + + + Box Structure + + + + + + + The box structure can only be changed when the sandbox is empty + + + + + + + Virtualization scheme + + + + + + + + + + Separate user folders + + + false + + + + + + + Use volume serial numbers for drives, like: \drive\C~1234-ABCD + + + + + + + Store the sandbox content in a Ram Disk + + + + + + + Encrypt sandbox content + + + + + + + Set Password + + + + + + + When <a href="sbie://docs/boxencryption">Box Encryption</a> is enabled the box’s root folder, including its registry hive, is stored in an encrypted disk image, using <a href="https://diskcryptor.org">Disk Cryptor's</a> AES-XTS implementation. + + + true + + + true + + + + + + + <a href="addon://ImDisk">Install ImDisk</a> driver to enable Ram Disk and Disk Image support. + + + + + + + + 75 + true + true + + + + Box Delete options + + + + + + + Auto delete content when last sandboxed process terminates + + + + + + + Partially checked means prevent box removal but not content deletion. + + + Protect this sandbox from deletion or emptying + + + true + + + + + + + Lock the encrypted sandbox when all processes in the sandbox terminate. + + + + + + + + 75 + true + true + + + + Disk/File access + + + + + + + Allow elevated sandboxed applications to read the harddrive + + + + + + + + 20 + 16777215 + + + + + + + + + + + Warn when an application opens a harddrive handle + + + + + + + Qt::Vertical + + + + 20 + 52 + + + + + + + + Qt::Horizontal + + + + 410 + 13 + + + diff --git a/SandboxiePlus/SandMan/SandMan.cpp b/SandboxiePlus/SandMan/SandMan.cpp index 68e59801..c1c0e0f4 100644 --- a/SandboxiePlus/SandMan/SandMan.cpp +++ b/SandboxiePlus/SandMan/SandMan.cpp @@ -2283,7 +2283,12 @@ void CSandMan::OnBoxClosed(const CSandBoxPtr& pBox) AddAsyncOp(pProgress, true, tr("Executing OnBoxTerminate: %1").arg(Value2)); } } - + if (pBox->GetBool("LockWhenClose", false)) { + if (!pBox->GetMountRoot().isEmpty()) { + pBox->TerminateAll(); + pBox->ImBoxUnmount(); + } + } if (!pBox->GetBool("NeverDelete", false)) { if (pBox->GetBool("AutoDelete", false)) diff --git a/SandboxiePlus/SandMan/Windows/OptionsAdvanced.cpp b/SandboxiePlus/SandMan/Windows/OptionsAdvanced.cpp index 072c716e..7700a740 100644 --- a/SandboxiePlus/SandMan/Windows/OptionsAdvanced.cpp +++ b/SandboxiePlus/SandMan/Windows/OptionsAdvanced.cpp @@ -106,6 +106,7 @@ void COptionsWindow::CreateAdvanced() connect(ui.chkLessConfidential, SIGNAL(clicked(bool)), this, SLOT(OnLessConfidentialChanged())); connect(ui.chkProtectWindow, SIGNAL(clicked(bool)), this, SLOT(OnProtectChanged())); connect(ui.chkBlockCapture, SIGNAL(clicked(bool)), this, SLOT(OnCaptureChanged())); + connect(ui.chkLockWhenClose, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged())); connect(ui.chkNotifyProtect, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged())); connect(ui.treeInjectDll, SIGNAL(itemChanged(QTreeWidgetItem *, int)), this, SLOT(OnToggleInjectDll(QTreeWidgetItem *, int))); @@ -265,7 +266,12 @@ void COptionsWindow::LoadAdvanced() ui.chkNotifyProtect->setChecked(m_pBox->GetBool("NotifyBoxProtected", false)); ui.chkProtectWindow->setChecked(m_pBox->GetBool("IsProtectScreen")); - ui.chkBlockCapture->setChecked(m_pBox->GetBool("IsBlockCapture")); + QString str = m_pBox->GetText("OpenWindowClass", ""); + ui.chkBlockCapture->setChecked(m_pBox->GetBool("IsBlockCapture")&& QString::compare(str, "*") != 0); + ui.chkBlockCapture->setCheckable(QString::compare(str, "*") != 0); + + ui.chkLockWhenClose->setChecked(m_pBox->GetBool("LockWhenClose", false)); + ui.chkLockWhenClose->setCheckable(m_pBox->GetBool("UseFileImage", false)); QStringList Users = m_pBox->GetText("Enabled").split(","); ui.lstUsers->clear(); @@ -471,6 +477,7 @@ void COptionsWindow::SaveAdvanced() WriteAdvancedCheck(ui.chkProtectWindow, "IsProtectScreen", "y", "n"); WriteAdvancedCheck(ui.chkBlockCapture, "IsBlockCapture", "y", "n"); + WriteAdvancedCheck(ui.chkLockWhenClose, "LockWhenClose", "y", "n"); QStringList Users; for (int i = 0; i < ui.lstUsers->count(); i++) From d49a0f579c8a4e251231954fbdca9078c7466244 Mon Sep 17 00:00:00 2001 From: love-code-yeyixiao <188240888@qq.com> Date: Sun, 17 Mar 2024 11:40:03 +0800 Subject: [PATCH 02/10] Only touch CI. --- SandboxiePlus/SandMan/SandMan.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SandboxiePlus/SandMan/SandMan.cpp b/SandboxiePlus/SandMan/SandMan.cpp index c1c0e0f4..07188c8f 100644 --- a/SandboxiePlus/SandMan/SandMan.cpp +++ b/SandboxiePlus/SandMan/SandMan.cpp @@ -2284,7 +2284,7 @@ void CSandMan::OnBoxClosed(const CSandBoxPtr& pBox) } } if (pBox->GetBool("LockWhenClose", false)) { - if (!pBox->GetMountRoot().isEmpty()) { + if (!pBox->GetMountRoot().isEmpty()){ pBox->TerminateAll(); pBox->ImBoxUnmount(); } From 673fc1552fd7949950733a0ef78a2b70b18f6b70 Mon Sep 17 00:00:00 2001 From: love-code-yeyixiao <188240888@qq.com> Date: Sun, 17 Mar 2024 14:30:06 +0800 Subject: [PATCH 03/10] Fix. --- SandboxiePlus/SandMan/Windows/OptionsAdvanced.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/SandboxiePlus/SandMan/Windows/OptionsAdvanced.cpp b/SandboxiePlus/SandMan/Windows/OptionsAdvanced.cpp index 7700a740..79381510 100644 --- a/SandboxiePlus/SandMan/Windows/OptionsAdvanced.cpp +++ b/SandboxiePlus/SandMan/Windows/OptionsAdvanced.cpp @@ -272,6 +272,7 @@ void COptionsWindow::LoadAdvanced() ui.chkLockWhenClose->setChecked(m_pBox->GetBool("LockWhenClose", false)); ui.chkLockWhenClose->setCheckable(m_pBox->GetBool("UseFileImage", false)); + ui.chkLockWhenClose->setEnabled(m_pBox->GetBool("UseFileImage", false)); QStringList Users = m_pBox->GetText("Enabled").split(","); ui.lstUsers->clear(); @@ -1252,8 +1253,12 @@ void COptionsWindow::OnCaptureChanged() if (ui.chkBlockCapture->checkState()) { ui.chkProtectWindow->setChecked(FALSE); ui.chkProtectWindow->setCheckable(FALSE); - } else + ui.chkProtectWindow->setEnabled(FALSE); + } + else { ui.chkProtectWindow->setCheckable(TRUE); + ui.chkProtectWindow->setEnabled(TRUE); + } OnAdvancedChanged(); } @@ -1262,7 +1267,11 @@ void COptionsWindow::OnProtectChanged() if (ui.chkProtectWindow->checkState()) { ui.chkBlockCapture->setChecked(FALSE); ui.chkBlockCapture->setCheckable(FALSE); - } else + ui.chkBlockCapture->setEnabled(FALSE); + } + else { ui.chkBlockCapture->setCheckable(TRUE); + ui.chkBlockCapture->setEnabled(TRUE); + } OnAdvancedChanged(); } From 958704755440bdbec31957aa59f3a6a79abdecd1 Mon Sep 17 00:00:00 2001 From: love-code-yeyixiao <188240888@qq.com> Date: Sun, 17 Mar 2024 17:06:16 +0800 Subject: [PATCH 04/10] Update SandManTray.cpp --- SandboxiePlus/SandMan/SandManTray.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/SandboxiePlus/SandMan/SandManTray.cpp b/SandboxiePlus/SandMan/SandManTray.cpp index 98e4bcc8..5825ad6f 100644 --- a/SandboxiePlus/SandMan/SandManTray.cpp +++ b/SandboxiePlus/SandMan/SandManTray.cpp @@ -537,12 +537,21 @@ void CSandMan::OnSysTray(QSystemTrayIcon::ActivationReason Reason) } } -void CSandMan::OnBoxMenu(const QPoint & point) +void CSandMan::OnBoxMenu(const QPoint& point) { QTreeWidgetItem* pItem = m_pTrayBoxes->currentItem(); if (!pItem) return; + if (theAPI->IsConnected()) { + if (theConf->GetBool("LockTrayMenu", false) && theAPI->IsConfigLocked()) { + bool bRetry = false; + OnNotAuthorized(true, bRetry); + if (bRetry) + return; + + } + } CTrayBoxesItemDelegate::m_Hold = true; m_pBoxView->PopUpMenu(pItem->data(0, Qt::UserRole).toString()); CTrayBoxesItemDelegate::m_Hold = false; -} \ No newline at end of file +} From 16aba205b13782d4b921d5e7e4865262ac601244 Mon Sep 17 00:00:00 2001 From: love-code-yeyixiao <188240888@qq.com> Date: Sun, 17 Mar 2024 17:32:43 +0800 Subject: [PATCH 05/10] Add UI. --- SandboxiePlus/SandMan/Forms/OptionsWindow.ui | 6 +- SandboxiePlus/SandMan/Forms/SettingsWindow.ui | 169 ++++++++++-------- .../SandMan/Windows/SettingsWindow.cpp | 4 + 3 files changed, 100 insertions(+), 79 deletions(-) diff --git a/SandboxiePlus/SandMan/Forms/OptionsWindow.ui b/SandboxiePlus/SandMan/Forms/OptionsWindow.ui index 63360739..63d0a3d5 100644 --- a/SandboxiePlus/SandMan/Forms/OptionsWindow.ui +++ b/SandboxiePlus/SandMan/Forms/OptionsWindow.ui @@ -411,7 +411,7 @@ - Lock the encrypted sandbox when all processes in the sandbox terminate. + Force lock the encrypted sandbox when all processes in the sandbox terminate. @@ -4525,8 +4525,8 @@ instead of "*". 0 0 - 75 - 16 + 98 + 28 diff --git a/SandboxiePlus/SandMan/Forms/SettingsWindow.ui b/SandboxiePlus/SandMan/Forms/SettingsWindow.ui index 00d4c17c..7460ecc5 100644 --- a/SandboxiePlus/SandMan/Forms/SettingsWindow.ui +++ b/SandboxiePlus/SandMan/Forms/SettingsWindow.ui @@ -48,7 +48,7 @@ QTabWidget::North - 0 + 5 @@ -449,7 +449,7 @@ - 0 + 1 @@ -1689,6 +1689,7 @@ + 75 true true @@ -1940,7 +1941,7 @@ Unlike the preview channel, it does not include untested, potentially breaking, - 0 + 1 @@ -2159,79 +2160,95 @@ Unlike the preview channel, it does not include untested, potentially breaking, Sandboxie.ini Presets - - - - - - - Change Password - - - - - - - Password must be entered in order to make changes - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - 75 - true - true - - - - Config protection - - - - - - - Only Administrator user accounts can make changes - - - - - - - Watch Sandboxie.ini for changes - - - - - - - Only Administrator user accounts can use Pause Forcing Programs command - - - - - - - Clear password when main window becomes hidden - - - - + + + + + Watch Sandboxie.ini for changes + + + + + + + + 75 + true + true + + + + Config protection + + + + + + + Only Administrator user accounts can make changes + + + + + + + Password must be entered in order to make changes + + + + + + + Change Password + + + + + + + Qt::Horizontal + + + + 140 + 20 + + + + + + + + Only Administrator user accounts can use Pause Forcing Programs command + + + + + + + Clear password when main window becomes hidden + + + + + + + Protect The Sandman tray menu. + + + + + + + Qt::Vertical + + + + 20 + 211 + + + diff --git a/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp b/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp index de81c9d6..e71f10d4 100644 --- a/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp +++ b/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp @@ -429,6 +429,7 @@ CSettingsWindow::CSettingsWindow(QWidget* parent) connect(ui.btnSetPassword, SIGNAL(clicked(bool)), this, SLOT(OnSetPassword())); connect(ui.chkAdminOnlyFP, SIGNAL(stateChanged(int)), this, SLOT(OnProtectionChange())); connect(ui.chkClearPass, SIGNAL(stateChanged(int)), this, SLOT(OnProtectionChange())); + connect(ui.chkLockTrayMenu, SIGNAL(stateChanged(int)), this, SLOT(OnProtectionChange())); m_ProtectionChanged = false; // @@ -1000,6 +1001,7 @@ void CSettingsWindow::LoadSettings() ui.chkPassRequired->setChecked(!theAPI->GetGlobalSettings()->GetText("EditPassword", "").isEmpty()); ui.chkAdminOnlyFP->setChecked(theAPI->GetGlobalSettings()->GetBool("ForceDisableAdminOnly", false)); ui.chkClearPass->setChecked(theAPI->GetGlobalSettings()->GetBool("ForgetPassword", false)); + ui.chkLockTrayMenu->setChecked(theAPI->GetGlobalSettings()->GetBool("LockTrayMenu", false)); m_HoldChange = true; OnProtectionChange(); m_HoldChange = false; @@ -1054,6 +1056,7 @@ void CSettingsWindow::LoadSettings() ui.chkPassRequired->setEnabled(false); ui.chkAdminOnlyFP->setEnabled(false); ui.chkClearPass->setEnabled(false); + ui.chkLockTrayMenu->setEnabled(false); ui.btnSetPassword->setEnabled(false); ui.treeWarnProgs->setEnabled(false); ui.btnAddWarnProg->setEnabled(false); @@ -1663,6 +1666,7 @@ void CSettingsWindow::SaveSettings() WriteAdvancedCheck(ui.chkAdminOnlyFP, "ForceDisableAdminOnly", "y", ""); WriteAdvancedCheck(ui.chkClearPass, "ForgetPassword", "y", ""); + WriteAdvancedCheck(ui.chkLockTrayMenu, "LockTrayMenu", "y", ""); } if (m_WarnProgsChanged) From d75b21c1545104166e572aa5b3be37d132352c55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=88=B1=E7=BC=96=E7=A8=8B=E7=9A=84=E5=8F=B6=E4=B8=80?= =?UTF-8?q?=E7=AC=91?= <92030377+love-code-yeyixiao@users.noreply.github.com> Date: Sun, 17 Mar 2024 17:35:10 +0800 Subject: [PATCH 06/10] Update SandboxiePlus/SandMan/Windows/OptionsAdvanced.cpp Co-authored-by: offhub <6871698+offhub@users.noreply.github.com> --- SandboxiePlus/SandMan/Windows/OptionsAdvanced.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SandboxiePlus/SandMan/Windows/OptionsAdvanced.cpp b/SandboxiePlus/SandMan/Windows/OptionsAdvanced.cpp index 79381510..21f05a66 100644 --- a/SandboxiePlus/SandMan/Windows/OptionsAdvanced.cpp +++ b/SandboxiePlus/SandMan/Windows/OptionsAdvanced.cpp @@ -266,7 +266,7 @@ void COptionsWindow::LoadAdvanced() ui.chkNotifyProtect->setChecked(m_pBox->GetBool("NotifyBoxProtected", false)); ui.chkProtectWindow->setChecked(m_pBox->GetBool("IsProtectScreen")); - QString str = m_pBox->GetText("OpenWindowClass", ""); + QString str = m_pBox->GetText("OpenWinClass", ""); ui.chkBlockCapture->setChecked(m_pBox->GetBool("IsBlockCapture")&& QString::compare(str, "*") != 0); ui.chkBlockCapture->setCheckable(QString::compare(str, "*") != 0); From 6bee9876719166df9fa8ac20a3f129aab9b24ab9 Mon Sep 17 00:00:00 2001 From: love-code-yeyixiao <188240888@qq.com> Date: Sun, 17 Mar 2024 18:39:32 +0800 Subject: [PATCH 07/10] Update SandmanTray.cpp --- SandboxiePlus/SandMan/SandManTray.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/SandboxiePlus/SandMan/SandManTray.cpp b/SandboxiePlus/SandMan/SandManTray.cpp index 5825ad6f..d0c3ad5d 100644 --- a/SandboxiePlus/SandMan/SandManTray.cpp +++ b/SandboxiePlus/SandMan/SandManTray.cpp @@ -544,10 +544,17 @@ void CSandMan::OnBoxMenu(const QPoint& point) return; if (theAPI->IsConnected()) { if (theConf->GetBool("LockTrayMenu", false) && theAPI->IsConfigLocked()) { - bool bRetry = false; - OnNotAuthorized(true, bRetry); - if (bRetry) + QString Value = QInputDialog::getText(this, "Sandboxie-Plus", tr("Please enter the configuration password."), QLineEdit::Password); + if (Value.isEmpty()) { + QMessageBox::warning(this, "Sandboxie-Plus", tr("Login Failed")); return; + } + SB_STATUS Status = theAPI->UnlockConfig(Value); + if (!Status.IsError()) { + QMessageBox::warning(this, "Sandboxie-Plus", tr("Login Failed: %1").arg(FormatError(Status))); + return; + } + } } From 4f5477628d32471df428af927b864633a42bdd39 Mon Sep 17 00:00:00 2001 From: love-code-yeyixiao <188240888@qq.com> Date: Sun, 17 Mar 2024 19:10:29 +0800 Subject: [PATCH 08/10] rollback --- SandboxiePlus/SandMan/Forms/SettingsWindow.ui | 93 +++++++++---------- SandboxiePlus/SandMan/SandManTray.cpp | 16 ---- .../SandMan/Windows/SettingsWindow.cpp | 6 +- 3 files changed, 45 insertions(+), 70 deletions(-) diff --git a/SandboxiePlus/SandMan/Forms/SettingsWindow.ui b/SandboxiePlus/SandMan/Forms/SettingsWindow.ui index 7460ecc5..558c368c 100644 --- a/SandboxiePlus/SandMan/Forms/SettingsWindow.ui +++ b/SandboxiePlus/SandMan/Forms/SettingsWindow.ui @@ -2161,6 +2161,33 @@ Unlike the preview channel, it does not include untested, potentially breaking, Sandboxie.ini Presets + + + + Qt::Vertical + + + + 20 + 211 + + + + + + + + Clear password when main window becomes hidden + + + + + + + Only Administrator user accounts can use Pause Forcing Programs command + + + @@ -2168,34 +2195,6 @@ Unlike the preview channel, it does not include untested, potentially breaking, - - - - - 75 - true - true - - - - Config protection - - - - - - - Only Administrator user accounts can make changes - - - - - - - Password must be entered in order to make changes - - - @@ -2216,40 +2215,34 @@ Unlike the preview channel, it does not include untested, potentially breaking, - - + + - Only Administrator user accounts can use Pause Forcing Programs command + Only Administrator user accounts can make changes - - + + + + + 75 + true + true + + - Clear password when main window becomes hidden + Config protection - - + + - Protect The Sandman tray menu. + Password must be entered in order to make changes - - - - Qt::Vertical - - - - 20 - 211 - - - - diff --git a/SandboxiePlus/SandMan/SandManTray.cpp b/SandboxiePlus/SandMan/SandManTray.cpp index d0c3ad5d..dd546d5b 100644 --- a/SandboxiePlus/SandMan/SandManTray.cpp +++ b/SandboxiePlus/SandMan/SandManTray.cpp @@ -542,22 +542,6 @@ void CSandMan::OnBoxMenu(const QPoint& point) QTreeWidgetItem* pItem = m_pTrayBoxes->currentItem(); if (!pItem) return; - if (theAPI->IsConnected()) { - if (theConf->GetBool("LockTrayMenu", false) && theAPI->IsConfigLocked()) { - QString Value = QInputDialog::getText(this, "Sandboxie-Plus", tr("Please enter the configuration password."), QLineEdit::Password); - if (Value.isEmpty()) { - QMessageBox::warning(this, "Sandboxie-Plus", tr("Login Failed")); - return; - } - SB_STATUS Status = theAPI->UnlockConfig(Value); - if (!Status.IsError()) { - QMessageBox::warning(this, "Sandboxie-Plus", tr("Login Failed: %1").arg(FormatError(Status))); - return; - } - - - } - } CTrayBoxesItemDelegate::m_Hold = true; m_pBoxView->PopUpMenu(pItem->data(0, Qt::UserRole).toString()); CTrayBoxesItemDelegate::m_Hold = false; diff --git a/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp b/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp index e71f10d4..cf759a01 100644 --- a/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp +++ b/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp @@ -429,7 +429,7 @@ CSettingsWindow::CSettingsWindow(QWidget* parent) connect(ui.btnSetPassword, SIGNAL(clicked(bool)), this, SLOT(OnSetPassword())); connect(ui.chkAdminOnlyFP, SIGNAL(stateChanged(int)), this, SLOT(OnProtectionChange())); connect(ui.chkClearPass, SIGNAL(stateChanged(int)), this, SLOT(OnProtectionChange())); - connect(ui.chkLockTrayMenu, SIGNAL(stateChanged(int)), this, SLOT(OnProtectionChange())); + m_ProtectionChanged = false; // @@ -1001,7 +1001,6 @@ void CSettingsWindow::LoadSettings() ui.chkPassRequired->setChecked(!theAPI->GetGlobalSettings()->GetText("EditPassword", "").isEmpty()); ui.chkAdminOnlyFP->setChecked(theAPI->GetGlobalSettings()->GetBool("ForceDisableAdminOnly", false)); ui.chkClearPass->setChecked(theAPI->GetGlobalSettings()->GetBool("ForgetPassword", false)); - ui.chkLockTrayMenu->setChecked(theAPI->GetGlobalSettings()->GetBool("LockTrayMenu", false)); m_HoldChange = true; OnProtectionChange(); m_HoldChange = false; @@ -1056,7 +1055,6 @@ void CSettingsWindow::LoadSettings() ui.chkPassRequired->setEnabled(false); ui.chkAdminOnlyFP->setEnabled(false); ui.chkClearPass->setEnabled(false); - ui.chkLockTrayMenu->setEnabled(false); ui.btnSetPassword->setEnabled(false); ui.treeWarnProgs->setEnabled(false); ui.btnAddWarnProg->setEnabled(false); @@ -1666,7 +1664,7 @@ void CSettingsWindow::SaveSettings() WriteAdvancedCheck(ui.chkAdminOnlyFP, "ForceDisableAdminOnly", "y", ""); WriteAdvancedCheck(ui.chkClearPass, "ForgetPassword", "y", ""); - WriteAdvancedCheck(ui.chkLockTrayMenu, "LockTrayMenu", "y", ""); + } if (m_WarnProgsChanged) From 87c35d68534b5d3fa5fae13e52d3a744a46eaacb Mon Sep 17 00:00:00 2001 From: love-code-yeyixiao <188240888@qq.com> Date: Sun, 17 Mar 2024 19:49:22 +0800 Subject: [PATCH 09/10] rollback --- SandboxiePlus/SandMan/Forms/OptionsWindow.ui | 283 +++++++++--------- .../SandMan/Windows/OptionsAdvanced.cpp | 8 +- 2 files changed, 142 insertions(+), 149 deletions(-) diff --git a/SandboxiePlus/SandMan/Forms/OptionsWindow.ui b/SandboxiePlus/SandMan/Forms/OptionsWindow.ui index 63d0a3d5..a04e7292 100644 --- a/SandboxiePlus/SandMan/Forms/OptionsWindow.ui +++ b/SandboxiePlus/SandMan/Forms/OptionsWindow.ui @@ -285,58 +285,16 @@ File Options - - - - - 75 - true - true - + + + + + 20 + 16777215 + - Box Structure - - - - - - - The box structure can only be changed when the sandbox is empty - - - - - - - Virtualization scheme - - - - - - - - - - Separate user folders - - - false - - - - - - - Use volume serial numbers for drives, like: \drive\C~1234-ABCD - - - - - - - Store the sandbox content in a Ram Disk + @@ -347,12 +305,18 @@ - - - - Set Password + + + + Qt::Horizontal - + + + 410 + 13 + + + @@ -367,6 +331,91 @@ + + + + Warn when an application opens a harddrive handle + + + + + + + Set Password + + + + + + + Virtualization scheme + + + + + + + + + + Qt::Vertical + + + + 20 + 52 + + + + + + + + + 75 + true + true + + + + Disk/File access + + + + + + + Allow elevated sandboxed applications to read the harddrive + + + + + + + The box structure can only be changed when the sandbox is empty + + + + + + + Partially checked means prevent box removal but not content deletion. + + + Protect this sandbox from deletion or emptying + + + true + + + + + + + Auto delete content when last sandboxed process terminates + + + @@ -374,6 +423,37 @@ + + + + + 75 + true + true + + + + Box Structure + + + + + + + Separate user folders + + + false + + + + + + + Store the sandbox content in a Ram Disk + + + @@ -388,100 +468,13 @@ - - + + - Auto delete content when last sandboxed process terminates + Use volume serial numbers for drives, like: \drive\C~1234-ABCD - - - - Partially checked means prevent box removal but not content deletion. - - - Protect this sandbox from deletion or emptying - - - true - - - - - - - Force lock the encrypted sandbox when all processes in the sandbox terminate. - - - - - - - - 75 - true - true - - - - Disk/File access - - - - - - - Allow elevated sandboxed applications to read the harddrive - - - - - - - - 20 - 16777215 - - - - - - - - - - - Warn when an application opens a harddrive handle - - - - - - - Qt::Vertical - - - - 20 - 52 - - - - - - - - Qt::Horizontal - - - - 410 - 13 - - - - diff --git a/SandboxiePlus/SandMan/Windows/OptionsAdvanced.cpp b/SandboxiePlus/SandMan/Windows/OptionsAdvanced.cpp index 21f05a66..58c4ac4e 100644 --- a/SandboxiePlus/SandMan/Windows/OptionsAdvanced.cpp +++ b/SandboxiePlus/SandMan/Windows/OptionsAdvanced.cpp @@ -106,7 +106,7 @@ void COptionsWindow::CreateAdvanced() connect(ui.chkLessConfidential, SIGNAL(clicked(bool)), this, SLOT(OnLessConfidentialChanged())); connect(ui.chkProtectWindow, SIGNAL(clicked(bool)), this, SLOT(OnProtectChanged())); connect(ui.chkBlockCapture, SIGNAL(clicked(bool)), this, SLOT(OnCaptureChanged())); - connect(ui.chkLockWhenClose, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged())); + //connect(ui.chkLockWhenClose, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged())); connect(ui.chkNotifyProtect, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged())); connect(ui.treeInjectDll, SIGNAL(itemChanged(QTreeWidgetItem *, int)), this, SLOT(OnToggleInjectDll(QTreeWidgetItem *, int))); @@ -270,10 +270,10 @@ void COptionsWindow::LoadAdvanced() ui.chkBlockCapture->setChecked(m_pBox->GetBool("IsBlockCapture")&& QString::compare(str, "*") != 0); ui.chkBlockCapture->setCheckable(QString::compare(str, "*") != 0); - ui.chkLockWhenClose->setChecked(m_pBox->GetBool("LockWhenClose", false)); + /*ui.chkLockWhenClose->setChecked(m_pBox->GetBool("LockWhenClose", false)); ui.chkLockWhenClose->setCheckable(m_pBox->GetBool("UseFileImage", false)); ui.chkLockWhenClose->setEnabled(m_pBox->GetBool("UseFileImage", false)); - + */ QStringList Users = m_pBox->GetText("Enabled").split(","); ui.lstUsers->clear(); if (Users.count() > 1) @@ -478,7 +478,7 @@ void COptionsWindow::SaveAdvanced() WriteAdvancedCheck(ui.chkProtectWindow, "IsProtectScreen", "y", "n"); WriteAdvancedCheck(ui.chkBlockCapture, "IsBlockCapture", "y", "n"); - WriteAdvancedCheck(ui.chkLockWhenClose, "LockWhenClose", "y", "n"); + //WriteAdvancedCheck(ui.chkLockWhenClose, "LockWhenClose", "y", "n"); QStringList Users; for (int i = 0; i < ui.lstUsers->count(); i++) From b5fdcf5fea289cba14702ac61e58194c60b52141 Mon Sep 17 00:00:00 2001 From: love-code-yeyixiao <188240888@qq.com> Date: Sun, 17 Mar 2024 20:17:04 +0800 Subject: [PATCH 10/10] roll back. --- SandboxiePlus/SandMan/SandMan.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/SandboxiePlus/SandMan/SandMan.cpp b/SandboxiePlus/SandMan/SandMan.cpp index 07188c8f..75638726 100644 --- a/SandboxiePlus/SandMan/SandMan.cpp +++ b/SandboxiePlus/SandMan/SandMan.cpp @@ -2283,12 +2283,6 @@ void CSandMan::OnBoxClosed(const CSandBoxPtr& pBox) AddAsyncOp(pProgress, true, tr("Executing OnBoxTerminate: %1").arg(Value2)); } } - if (pBox->GetBool("LockWhenClose", false)) { - if (!pBox->GetMountRoot().isEmpty()){ - pBox->TerminateAll(); - pBox->ImBoxUnmount(); - } - } if (!pBox->GetBool("NeverDelete", false)) { if (pBox->GetBool("AutoDelete", false))