mirror of
https://github.com/Quill-OS/quill.git
synced 2024-10-31 21:33:22 -07:00
Alert message if downgrade is attempted
This commit is contained in:
parent
3a806fa17c
commit
af4f9b57c5
2 changed files with 23 additions and 5 deletions
26
alert.cpp
26
alert.cpp
|
@ -29,12 +29,19 @@ alert::alert(QWidget *parent) :
|
|||
this->setStyleSheet(stylesheetFile.readAll());
|
||||
stylesheetFile.close();
|
||||
|
||||
// Checking if the update's signature is untrusted
|
||||
// Checking if the update's signature is untrusted. The signature error will always take precedence over the downgrade one (c.f. update.sh script)
|
||||
if(checkconfig("/external_root/boot/flags/ALERT_SIGN") == true) {
|
||||
signatureError = true;
|
||||
ui->securityLabel->setText("Failed to update InkBox.");
|
||||
ui->messageLabel->setText("The digital signature of the update is untrusted.\nFor security reasons, it cannot be installed.");
|
||||
ui->stackedWidget->setCurrentIndex(1);
|
||||
}
|
||||
if(checkconfig("/external_root/boot/flags/ALERT_DOWNGRADE") == true) {
|
||||
downgradeError = true;
|
||||
ui->securityLabel->setText("Failed to update InkBox.");
|
||||
ui->messageLabel->setText("An error occured during the update process.\nThe update provided is lower than the actual installed version.");
|
||||
ui->stackedWidget->setCurrentIndex(1);
|
||||
}
|
||||
|
||||
ui->warningLabel->setStyleSheet("QLabel { background-color : black; color : white; font-size: 16pt}");
|
||||
ui->messageLabel->setStyleSheet("QLabel { background-color : black; color : white; font-size: 9pt}");
|
||||
|
@ -79,8 +86,17 @@ void alert::on_continue2Btn_clicked()
|
|||
{
|
||||
// We continue anyway and re-set the ALERT flag
|
||||
string_writeconfig("/external_root/boot/flags/ALERT", "false");
|
||||
string_writeconfig("/external_root/boot/flags/ALERT_SIGN", "false");
|
||||
QProcess process;
|
||||
process.startDetached("inkbox", QStringList());
|
||||
qApp->quit();
|
||||
|
||||
if(signatureError == true) {
|
||||
string_writeconfig("/external_root/boot/flags/ALERT_SIGN", "false");
|
||||
QProcess process;
|
||||
process.startDetached("inkbox", QStringList());
|
||||
qApp->quit();
|
||||
}
|
||||
if(downgradeError == true) {
|
||||
string_writeconfig("/external_root/boot/flags/ALERT_DOWNGRADE", "false");
|
||||
QProcess process;
|
||||
process.startDetached("inkbox", QStringList());
|
||||
qApp->quit();
|
||||
}
|
||||
}
|
||||
|
|
2
alert.h
2
alert.h
|
@ -16,6 +16,8 @@ class alert : public QWidget
|
|||
public:
|
||||
explicit alert(QWidget *parent = nullptr);
|
||||
~alert();
|
||||
bool signatureError = false;
|
||||
bool downgradeError = false;
|
||||
|
||||
private slots:
|
||||
void on_continueBtn_clicked();
|
||||
|
|
Loading…
Reference in a new issue