showProgressUI("encrypt");
::sleep(1);
+ runtime::File file("/opt/etc/.odeprogress");
+ file.create(0640);
+
INFO(SINK, "Closing all known systemd services that might be using internal storage.");
stopKnownSystemdUnits();
::vconf_set_str(VCONFKEY_ODE_CRYPTO_STATE, "encrypted");
server.notify("InternalEncryptionServer::mount");
+ file.remove();
+
INFO(SINK, "Syncing disk and rebooting.");
::sync();
::reboot(RB_AUTOBOOT);
showProgressUI("decrypt");
::sleep(1);
+ runtime::File file("/opt/etc/.odeprogress");
+ file.create(0640);
+
if (engine->isMounted()) {
INFO(SINK, "Closing all known systemd services that might be using internal storage.");
stopKnownSystemdUnits();
INFO(SINK, "Decryption complete.");
::vconf_set_str(VCONFKEY_ODE_CRYPTO_STATE, "unencrypted");
+ file.remove();
+
INFO(SINK, "Syncing disk and rebooting.");
::sync();
::reboot(RB_AUTOBOOT);
if (state == State::Corrupted)
Ext4Tool::mkfs(engine->getSource());
- std::fstream fs;
- fs.open("/opt/.factoryreset", std::ios::out);
- fs.close();
+ runtime::File file("/opt/.factoryreset");
+ file.create(0640);
::sync();
try {