Update Sandman

This commit is contained in:
love-code-yeyixiao 2024-03-17 11:14:03 +08:00
parent fb2a9b4dbd
commit c6d4836737
3 changed files with 211 additions and 196 deletions

View File

@ -55,7 +55,7 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QTabWidget" name="tabsGeneral"> <widget class="QTabWidget" name="tabsGeneral">
<property name="currentIndex"> <property name="currentIndex">
<number>3</number> <number>1</number>
</property> </property>
<widget class="QWidget" name="tabOptions"> <widget class="QWidget" name="tabOptions">
<attribute name="title"> <attribute name="title">
@ -284,200 +284,203 @@
<attribute name="title"> <attribute name="title">
<string>File Options</string> <string>File Options</string>
</attribute> </attribute>
<layout class="QGridLayout" name="gridLayout_30"> <layout class="QGridLayout" name="gridLayout_28">
<item row="0" column="0"> <item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_28"> <widget class="QLabel" name="lblStructure">
<item row="11" column="0" colspan="2"> <property name="font">
<widget class="QLabel" name="lblRawDisk"> <font>
<property name="font"> <weight>75</weight>
<font> <bold>true</bold>
<weight>75</weight> <kerning>true</kerning>
<bold>true</bold> </font>
<kerning>true</kerning> </property>
</font> <property name="text">
</property> <string>Box Structure</string>
<property name="text"> </property>
<string>Disk/File access</string> </widget>
</property> </item>
</widget> <item row="0" column="2" colspan="4">
</item> <widget class="QLabel" name="lblWhenEmpty">
<item row="3" column="1" colspan="5"> <property name="text">
<widget class="QCheckBox" name="chkUseVolumeSerialNumbers"> <string>The box structure can only be changed when the sandbox is empty</string>
<property name="text"> </property>
<string>Use volume serial numbers for drives, like: \drive\C~1234-ABCD</string> </widget>
</property> </item>
</widget> <item row="1" column="1" colspan="3">
</item> <widget class="QLabel" name="lblScheme">
<item row="13" column="1"> <property name="text">
<widget class="QLabel" name="label_37"> <string>Virtualization scheme</string>
<property name="maximumSize"> </property>
<size> </widget>
<width>20</width> </item>
<height>16777215</height> <item row="1" column="4">
</size> <widget class="QComboBox" name="cmbVersion"/>
</property> </item>
<property name="text"> <item row="2" column="1" colspan="4">
<string/> <widget class="QCheckBox" name="chkSeparateUserFolders">
</property> <property name="text">
</widget> <string>Separate user folders</string>
</item> </property>
<item row="14" column="2" colspan="5"> <property name="tristate">
<spacer name="horizontalSpacer_4"> <bool>false</bool>
<property name="orientation"> </property>
<enum>Qt::Horizontal</enum> </widget>
</property> </item>
<property name="sizeHint" stdset="0"> <item row="3" column="1" colspan="5">
<size> <widget class="QCheckBox" name="chkUseVolumeSerialNumbers">
<width>40</width> <property name="text">
<height>0</height> <string>Use volume serial numbers for drives, like: \drive\C~1234-ABCD</string>
</size> </property>
</property> </widget>
</spacer> </item>
</item> <item row="4" column="1" colspan="4">
<item row="5" column="1" colspan="4"> <widget class="QCheckBox" name="chkRamBox">
<widget class="QCheckBox" name="chkEncrypt"> <property name="text">
<property name="text"> <string>Store the sandbox content in a Ram Disk</string>
<string>Encrypt sandbox content</string> </property>
</property> </widget>
</widget> </item>
</item> <item row="5" column="1" colspan="4">
<item row="9" column="1" colspan="6"> <widget class="QCheckBox" name="chkEncrypt">
<widget class="QCheckBox" name="chkAutoEmpty"> <property name="text">
<property name="text"> <string>Encrypt sandbox content</string>
<string>Auto delete content when last sandboxed process terminates</string> </property>
</property> </widget>
</widget> </item>
</item> <item row="5" column="5">
<item row="6" column="2" colspan="4"> <widget class="QToolButton" name="btnPassword">
<widget class="QLabel" name="lblCrypto"> <property name="text">
<property name="text"> <string>Set Password</string>
<string>When &lt;a href=&quot;sbie://docs/boxencryption&quot;&gt;Box Encryption&lt;/a&gt; is enabled the boxs root folder, including its registry hive, is stored in an encrypted disk image, using &lt;a href=&quot;https://diskcryptor.org&quot;&gt;Disk Cryptor's&lt;/a&gt; AES-XTS implementation.</string> </property>
</property> </widget>
<property name="wordWrap"> </item>
<bool>true</bool> <item row="6" column="2" colspan="4">
</property> <widget class="QLabel" name="lblCrypto">
<property name="openExternalLinks"> <property name="text">
<bool>true</bool> <string>When &lt;a href=&quot;sbie://docs/boxencryption&quot;&gt;Box Encryption&lt;/a&gt; is enabled the boxs root folder, including its registry hive, is stored in an encrypted disk image, using &lt;a href=&quot;https://diskcryptor.org&quot;&gt;Disk Cryptor's&lt;/a&gt; AES-XTS implementation.</string>
</property> </property>
</widget> <property name="wordWrap">
</item> <bool>true</bool>
<item row="8" column="0" colspan="3"> </property>
<widget class="QLabel" name="lblDelete"> <property name="openExternalLinks">
<property name="font"> <bool>true</bool>
<font> </property>
<weight>75</weight> </widget>
<bold>true</bold> </item>
<kerning>true</kerning> <item row="7" column="2" colspan="4">
</font> <widget class="QLabel" name="lblImDisk">
</property> <property name="text">
<property name="text"> <string>&lt;a href=&quot;addon://ImDisk&quot;&gt;Install ImDisk&lt;/a&gt; driver to enable Ram Disk and Disk Image support.</string>
<string>Box Delete options</string> </property>
</property> </widget>
</widget> </item>
</item> <item row="8" column="0" colspan="3">
<item row="14" column="1"> <widget class="QLabel" name="lblDelete">
<spacer name="verticalSpacer_2"> <property name="font">
<property name="orientation"> <font>
<enum>Qt::Vertical</enum> <weight>75</weight>
</property> <bold>true</bold>
<property name="sizeHint" stdset="0"> <kerning>true</kerning>
<size> </font>
<width>20</width> </property>
<height>0</height> <property name="text">
</size> <string>Box Delete options</string>
</property> </property>
</spacer> </widget>
</item> </item>
<item row="12" column="1" colspan="6"> <item row="9" column="1" colspan="5">
<widget class="QCheckBox" name="chkRawDiskRead"> <widget class="QCheckBox" name="chkAutoEmpty">
<property name="text"> <property name="text">
<string>Allow elevated sandboxed applications to read the harddrive</string> <string>Auto delete content when last sandboxed process terminates</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="10" column="1" colspan="6"> <item row="10" column="1" colspan="4">
<widget class="QCheckBox" name="chkProtectBox"> <widget class="QCheckBox" name="chkProtectBox">
<property name="toolTip"> <property name="toolTip">
<string>Partially checked means prevent box removal but not content deletion.</string> <string>Partially checked means prevent box removal but not content deletion.</string>
</property> </property>
<property name="text"> <property name="text">
<string>Protect this sandbox from deletion or emptying</string> <string>Protect this sandbox from deletion or emptying</string>
</property> </property>
<property name="tristate"> <property name="tristate">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="2" colspan="4"> <item row="11" column="1" colspan="5">
<widget class="QLabel" name="lblImDisk"> <widget class="QCheckBox" name="chkLockWhenClose">
<property name="text"> <property name="text">
<string>&lt;a href=&quot;addon://ImDisk&quot;&gt;Install ImDisk&lt;/a&gt; driver to enable Ram Disk and Disk Image support.</string> <string>Lock the encrypted sandbox when all processes in the sandbox terminate.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1" colspan="5"> <item row="12" column="0" colspan="2">
<widget class="QCheckBox" name="chkSeparateUserFolders"> <widget class="QLabel" name="lblRawDisk">
<property name="text"> <property name="font">
<string>Separate user folders</string> <font>
</property> <weight>75</weight>
<property name="tristate"> <bold>true</bold>
<bool>false</bool> <kerning>true</kerning>
</property> </font>
</widget> </property>
</item> <property name="text">
<item row="0" column="0"> <string>Disk/File access</string>
<widget class="QLabel" name="lblStructure"> </property>
<property name="font"> </widget>
<font> </item>
<weight>75</weight> <item row="13" column="1" colspan="5">
<bold>true</bold> <widget class="QCheckBox" name="chkRawDiskRead">
<kerning>true</kerning> <property name="text">
</font> <string>Allow elevated sandboxed applications to read the harddrive</string>
</property> </property>
<property name="text"> </widget>
<string>Box Structure</string> </item>
</property> <item row="14" column="1">
</widget> <widget class="QLabel" name="label_37">
</item> <property name="maximumSize">
<item row="4" column="1" colspan="4"> <size>
<widget class="QCheckBox" name="chkRamBox"> <width>20</width>
<property name="text"> <height>16777215</height>
<string>Store the sandbox content in a Ram Disk</string> </size>
</property> </property>
</widget> <property name="text">
</item> <string/>
<item row="13" column="2" colspan="5"> </property>
<widget class="QCheckBox" name="chkRawDiskNotify"> </widget>
<property name="text"> </item>
<string>Warn when an application opens a harddrive handle</string> <item row="14" column="2" colspan="4">
</property> <widget class="QCheckBox" name="chkRawDiskNotify">
</widget> <property name="text">
</item> <string>Warn when an application opens a harddrive handle</string>
<item row="1" column="3"> </property>
<widget class="QComboBox" name="cmbVersion"/> </widget>
</item> </item>
<item row="5" column="5"> <item row="15" column="1">
<widget class="QToolButton" name="btnPassword"> <spacer name="verticalSpacer_2">
<property name="text"> <property name="orientation">
<string>Set Password</string> <enum>Qt::Vertical</enum>
</property> </property>
</widget> <property name="sizeHint" stdset="0">
</item> <size>
<item row="1" column="1" colspan="2"> <width>20</width>
<widget class="QLabel" name="lblScheme"> <height>52</height>
<property name="text"> </size>
<string>Virtualization scheme</string> </property>
</property> </spacer>
</widget> </item>
</item> <item row="15" column="3">
<item row="0" column="2" colspan="4"> <spacer name="horizontalSpacer_4">
<widget class="QLabel" name="lblWhenEmpty"> <property name="orientation">
<property name="text"> <enum>Qt::Horizontal</enum>
<string>The box structure can only be changed when the sandbox is empty</string> </property>
</property> <property name="sizeHint" stdset="0">
</widget> <size>
</item> <width>410</width>
</layout> <height>13</height>
</size>
</property>
</spacer>
</item> </item>
</layout> </layout>
</widget> </widget>

View File

@ -2283,7 +2283,12 @@ void CSandMan::OnBoxClosed(const CSandBoxPtr& pBox)
AddAsyncOp(pProgress, true, tr("Executing OnBoxTerminate: %1").arg(Value2)); 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("NeverDelete", false))
{ {
if (pBox->GetBool("AutoDelete", false)) if (pBox->GetBool("AutoDelete", false))

View File

@ -106,6 +106,7 @@ void COptionsWindow::CreateAdvanced()
connect(ui.chkLessConfidential, SIGNAL(clicked(bool)), this, SLOT(OnLessConfidentialChanged())); connect(ui.chkLessConfidential, SIGNAL(clicked(bool)), this, SLOT(OnLessConfidentialChanged()));
connect(ui.chkProtectWindow, SIGNAL(clicked(bool)), this, SLOT(OnProtectChanged())); connect(ui.chkProtectWindow, SIGNAL(clicked(bool)), this, SLOT(OnProtectChanged()));
connect(ui.chkBlockCapture, SIGNAL(clicked(bool)), this, SLOT(OnCaptureChanged())); 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.chkNotifyProtect, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged()));
connect(ui.treeInjectDll, SIGNAL(itemChanged(QTreeWidgetItem *, int)), this, SLOT(OnToggleInjectDll(QTreeWidgetItem *, int))); 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.chkNotifyProtect->setChecked(m_pBox->GetBool("NotifyBoxProtected", false));
ui.chkProtectWindow->setChecked(m_pBox->GetBool("IsProtectScreen")); 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(","); QStringList Users = m_pBox->GetText("Enabled").split(",");
ui.lstUsers->clear(); ui.lstUsers->clear();
@ -471,6 +477,7 @@ void COptionsWindow::SaveAdvanced()
WriteAdvancedCheck(ui.chkProtectWindow, "IsProtectScreen", "y", "n"); WriteAdvancedCheck(ui.chkProtectWindow, "IsProtectScreen", "y", "n");
WriteAdvancedCheck(ui.chkBlockCapture, "IsBlockCapture", "y", "n"); WriteAdvancedCheck(ui.chkBlockCapture, "IsBlockCapture", "y", "n");
WriteAdvancedCheck(ui.chkLockWhenClose, "LockWhenClose", "y", "n");
QStringList Users; QStringList Users;
for (int i = 0; i < ui.lstUsers->count(); i++) for (int i = 0; i < ui.lstUsers->count(); i++)