check for fileencryption before sdl start
This commit is contained in:
@@ -56,7 +56,12 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
ui->memoTxtChat->setPlaceholderText("Send Message");
|
ui->memoTxtChat->setPlaceholderText("Send Message");
|
||||||
ui->memoTxtChat->setTextColor(Qt::white);
|
ui->memoTxtChat->setTextColor(Qt::white);
|
||||||
|
|
||||||
|
|
||||||
|
// Check for encryption
|
||||||
|
if(fileExists(QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)).filePath("addresslabels.dat.enc")))
|
||||||
|
{
|
||||||
|
this->removeWalletEncryption();
|
||||||
|
}
|
||||||
|
|
||||||
// Status Bar
|
// Status Bar
|
||||||
setupStatusBar();
|
setupStatusBar();
|
||||||
@@ -185,6 +190,12 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
createWebsocket(wormholecode);
|
createWebsocket(wormholecode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool MainWindow::fileExists(QString path)
|
||||||
|
{
|
||||||
|
QFileInfo check_file(path);
|
||||||
|
return (check_file.exists() && check_file.isFile());
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::createWebsocket(QString wormholecode) {
|
void MainWindow::createWebsocket(QString wormholecode) {
|
||||||
qDebug() << "Listening for app connections on port 8777";
|
qDebug() << "Listening for app connections on port 8777";
|
||||||
@@ -332,6 +343,7 @@ void MainWindow::removeWalletEncryption() {
|
|||||||
auto dir = QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));
|
auto dir = QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));
|
||||||
QString target_enc_file = dir.filePath("addresslabels.dat.enc");
|
QString target_enc_file = dir.filePath("addresslabels.dat.enc");
|
||||||
QString target_dec_file = dir.filePath("addresslabels.dat");
|
QString target_dec_file = dir.filePath("addresslabels.dat");
|
||||||
|
|
||||||
FileEncryption::decrypt(target_dec_file, target_enc_file, key);
|
FileEncryption::decrypt(target_dec_file, target_enc_file, key);
|
||||||
|
|
||||||
d.exec();
|
d.exec();
|
||||||
|
|||||||
@@ -100,6 +100,7 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
bool fileExists(QString path);
|
||||||
void closeEvent(QCloseEvent* event);
|
void closeEvent(QCloseEvent* event);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user