Compare commits

...

11 Commits

Author SHA1 Message Date
Aleksandar Dimov
477a2f3591 fix macOS command 2024-04-01 18:23:35 +02:00
Aleksandar Dimov
3c3870f270 Merge branch 'dev' into feature/add-uninstaller-checkbox 2024-04-01 18:10:11 +02:00
Aleksandar Dimov
ee7ac389a4 add minor improvements 2024-03-27 23:41:28 +01:00
Aleksandar Dimov
bd414191e9 remove onNextButtonClicked 2024-03-27 23:38:39 +01:00
Aleksandar Dimov
4eebb6673a Merge branch 'dev' into feature/add-uninstaller-checkbox 2024-03-27 22:38:16 +01:00
Aleksandar Dimov
a36585d035 update linux command 2024-03-22 19:51:45 +01:00
Aleksandar Dimov
c4de28bb3b refactor 2024-03-22 00:19:53 +01:00
Aleksandar Dimov
dcf1989414 fix linux command 2024-03-21 22:55:32 +01:00
Aleksandar Dimov
bd2288c239 Merge branch 'dev' into feature/add-uninstaller-checkbox 2024-03-21 22:16:49 +01:00
Aleksandar Dimov
781dba61f1 Merge branch 'dev' into feature/add-uninstaller-checkbox 2024-03-20 20:10:35 +01:00
Aleksandar Dimov
926d3643a4 add checkbox on uninstaller 2024-03-19 22:54:51 +01:00
3 changed files with 36 additions and 11 deletions

View File

@@ -16,6 +16,12 @@
using namespace QKeychain;
namespace {
constexpr auto settingsKeyTag{"settingsKeyTag"};
constexpr auto settingsIvTag{"settingsIvTag"};
constexpr auto keyChainName{"AmneziaVPN-Keychain"};
}
SecureQSettings::SecureQSettings(const QString &organization, const QString &application, QObject *parent)
: QObject { parent }, m_settings(organization, application, parent), encryptedKeys({ "Servers/serversList" })
{
@@ -50,7 +56,7 @@ QVariant SecureQSettings::value(const QString &key, const QVariant &defaultValue
// check if value is not encrypted, v. < 2.0.x
retVal = m_settings.value(key);
if (retVal.isValid()) {
if (retVal.userType() == QVariant::ByteArray && retVal.toByteArray().mid(0, magicString.size()) == magicString) {
if (retVal.userType() == QMetaType::QByteArray && retVal.toByteArray().mid(0, magicString.size()) == magicString) {
if (getEncKey().isEmpty() || getEncIv().isEmpty()) {
qCritical() << "SecureQSettings::setValue Decryption requested, but key is empty";

View File

@@ -8,10 +8,6 @@
#include "keychain.h"
constexpr const char *settingsKeyTag = "settingsKeyTag";
constexpr const char *settingsIvTag = "settingsIvTag";
constexpr const char *keyChainName = "AmneziaVPN-Keychain";
class SecureQSettings : public QObject
{
Q_OBJECT
@@ -44,7 +40,7 @@ public:
private:
QSettings m_settings;
mutable QMap<QString, QVariant> m_cache;
mutable QHash<QString, QVariant> m_cache;
QStringList encryptedKeys; // encode only key listed here

View File

@@ -141,6 +141,15 @@ Controller.prototype.FinishedPageCallback = function ()
installer.autoAcceptMessageBoxes();
gui.clickButton(buttons.FinishButton);
}
if (installer.isUninstaller()) {
var widget = gui.pageById(QInstaller.InstallationFinished);
if (widget) {
widget["RunItCheckBox"].visible = true;
widget["RunItCheckBox"].text = "Remove all settings and data";
gui.finishButtonClicked.connect(onFinishButtonClicked);
}
}
}
Controller.prototype.RestartPageCallback = function ()
@@ -215,11 +224,25 @@ onBrowseButtonClicked = function()
}
}
onNextButtonClicked = function()
{
var widget = gui.pageById(QInstaller.TargetDirectory);
if (widget !== null) {
installer.setValue("APP_BUNDLE_TARGET_DIR", widget.TargetDirectoryLineEdit.text);
onFinishButtonClicked = function() {
let widget = gui.pageById(QInstaller.InstallationFinished);
if (widget) {
let isChecked = widget["RunItCheckBox"].checked;
if (isChecked) {
if (runningOnWindows()) {
let cmdArgs = ["/C", "reg", "delete", "HKEY_CURRENT_USER\\Software\\AmneziaVPN.ORG", "/f"];
installer.execute("cmd", cmdArgs);
}
else if (runningOnMacOS()) {
let plistPath = QDesktopServices.storageLocation(QDesktopServices.HomeLocation) + "/Library/Preferences/org.amneziavpn.AmneziaVPN.plist";
installer.performOperation("Delete", [plistPath]);
}
else if (runningOnLinux()) {
let cmdArgs = ["-c", "rm -rf ~/.config/AmneziaVPN.ORG"];
installer.execute("/bin/bash", cmdArgs);
}
}
}
}