|
@@ -15,7 +15,15 @@ MainWindow::MainWindow(QWidget *parent)
|
|
|
std::string scode = text.toStdString();
|
|
|
if (scode=="catarcshenlanv2pro")
|
|
|
{
|
|
|
- ui->setupUi(this);
|
|
|
+ bool code_ok;
|
|
|
+ sys_code = QInputDialog::getText(this, tr("Enter system password:"),
|
|
|
+ tr("system password:"), QLineEdit::Password,
|
|
|
+ Q_NULLPTR, &code_ok);
|
|
|
+ if (code_ok && !sys_code.isEmpty())
|
|
|
+ {
|
|
|
+ ui->setupUi(this);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -32,7 +40,11 @@ void MainWindow::on_pushButton_clicked()
|
|
|
void MainWindow::on_pushButton_2_clicked()
|
|
|
{
|
|
|
QProcess process;
|
|
|
- QString command="echo 'nvidia' | sudo -S blkid";
|
|
|
+ QString command="echo '"+sys_code+"' | sudo -S blkid";
|
|
|
+ if (command.isEmpty())
|
|
|
+ {
|
|
|
+ qDebug()<<"system password error";
|
|
|
+ }
|
|
|
process.start("/bin/bash", QStringList() << "-c" << command);
|
|
|
process.waitForFinished();
|
|
|
QString output=process.readAllStandardOutput();
|
|
@@ -55,6 +67,7 @@ void MainWindow::on_pushButton_2_clicked()
|
|
|
diskid=subStr;
|
|
|
} else {
|
|
|
qDebug() << "UUID not found.";
|
|
|
+ return;
|
|
|
}
|
|
|
QString final_license="catarc"+diskid+"shenlanv2pro";
|
|
|
QString hashedStr=hashString(final_license);
|