EncFS repack function fixes

This commit is contained in:
Nicolas Mailloux 2021-11-14 22:23:09 -05:00
parent 0bd233919c
commit 3712207416
4 changed files with 20 additions and 7 deletions

View file

@ -77,9 +77,14 @@ encryptionManager::encryptionManager(QWidget *parent) :
ui->hourglassWidget->setCurrentIndex(0);
setDefaultWorkDir();
if(checkconfig(".config/18-encrypted_storage/initial_setup_done") == true or checkconfig("/run/encfs_repack") == true) {
if(checkconfig(".config/18-encrypted_storage/initial_setup_done") == true or checkconfig("/external_root/run/encfs_repack") == true) {
ui->activityWidget->hide();
setupPassphraseDialogMode = 1;
if(checkconfig("/external_root/run/encfs_repack") == false) {
setupPassphraseDialogMode = 1;
}
else {
setupPassphraseDialogMode = 2;
}
QTimer::singleShot(500, this, SLOT(setupPassphraseDialog()));
}
else {
@ -345,7 +350,7 @@ void encryptionManager::repackEncryptedStorage() {
mkEncfsDirs();
std::string passphrase = global::encfs::passphrase.toStdString();
global::encfs::passphrase = "";
string_writeconfig("/external_root/run/encfs/encrypted_storage_passphrase", passphrase);
string_writeconfig("/external_root/run/encfs/encrypted_storage_repack_passphrase", passphrase);
string_writeconfig("/opt/ibxd", "encfs_restart\n");
bool exitStatus;
ui->activityWidget->setCurrentIndex(3);

View file

@ -628,7 +628,7 @@ namespace {
reboot(true);
}
bool getEncFSStatus() {
return checkconfig("/run/encfs_mounted");
return checkconfig("/external_root/run/encfs_mounted");
}
}

View file

@ -41,6 +41,14 @@ int main(int argc, char *argv[])
w.show();
return a.exec();
}
else if(checkconfig("/external_root/run/encfs_mounted") == true and checkconfig("/external_root/run/encfs_repack") == true) {
QApplication a(argc, argv);
encryptionManager w;
const QScreen * screen = qApp->primaryScreen();
w.setGeometry(QRect(QPoint(0,0), screen->geometry().size()));
w.show();
return a.exec();
}
else {
// Tell scripts that we're currently running
string_writeconfig("/tmp/inkbox_running", "true");

View file

@ -294,7 +294,7 @@ settings::settings(QWidget *parent) :
// Next interaction will be by the user
enableEncryptedStorageUserChange = true;
}
if(getEncFSStatus() == true) {
if(getEncFSStatus() == false) {
ui->repackLabel->hide();
ui->repackBtn->hide();
}
@ -943,7 +943,7 @@ void settings::cancelDisableStorageEncryption() {
void settings::on_repackBtn_clicked()
{
QDir dir("/data/onboard/encfs-dropbox");
QDir dir("/mnt/onboard/onboard/encfs-dropbox");
if(dir.isEmpty()) {
global::encfs::errorNoBooksInDropboxDialog = true;
generalDialogWindow = new generalDialog(this);
@ -952,6 +952,6 @@ void settings::on_repackBtn_clicked()
}
else {
string_writeconfig("/external_root/run/encfs_repack", "true");
quit_restart();
}
}