mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-05-08 14:33:23 +00:00
Compare commits
11 Commits
4.8.9.2
...
feature/ad
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
477a2f3591 | ||
|
|
3c3870f270 | ||
|
|
ee7ac389a4 | ||
|
|
bd414191e9 | ||
|
|
4eebb6673a | ||
|
|
a36585d035 | ||
|
|
c4de28bb3b | ||
|
|
dcf1989414 | ||
|
|
bd2288c239 | ||
|
|
781dba61f1 | ||
|
|
926d3643a4 |
@@ -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";
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user