diff --git a/encryptionmanager.cpp b/encryptionmanager.cpp index 40cec56..3bc6cf9 100644 --- a/encryptionmanager.cpp +++ b/encryptionmanager.cpp @@ -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); diff --git a/functions.h b/functions.h index 2a68a42..11e37c6 100644 --- a/functions.h +++ b/functions.h @@ -628,7 +628,7 @@ namespace { reboot(true); } bool getEncFSStatus() { - return checkconfig("/run/encfs_mounted"); + return checkconfig("/external_root/run/encfs_mounted"); } } diff --git a/main.cpp b/main.cpp index 7bd5c18..6c69edf 100644 --- a/main.cpp +++ b/main.cpp @@ -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"); diff --git a/settings.cpp b/settings.cpp index 4f3b60f..9033c10 100644 --- a/settings.cpp +++ b/settings.cpp @@ -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(); } } -