Skip to content

Commit f79f75a

Browse files
author
Ed Guloien
committed
Merge branch 'public' of github.com:Windscribe/desktop-v2
This is an unrelated histories merge so it looks quite large. However, all merge resolutions were made using only the newer v.2.3.15 history. As this branch contains all the changes in this master branches history. This was done to preserve the git history of this branch since its inception. # Conflicts: # .gitignore # LICENSE # README.md # backend/engine/engine.pro # backend/engine/engine/autoupdater/autoupdaterhelper_mac.cpp # backend/engine/engine/autoupdater/downloadhelper.cpp # backend/engine/engine/autoupdater/downloadhelper.h # backend/engine/engine/connectionmanager/finishactiveconnections.cpp # backend/engine/engine/connectionmanager/finishactiveconnections.h # backend/engine/engine/connectionmanager/stunnelmanager.cpp # backend/engine/engine/connectionmanager/wstunnelmanager.cpp # backend/engine/engine/dnsresolver/dnsutils_linux.cpp # backend/engine/engine/engine.cpp # backend/engine/engine/engine.h # backend/engine/engine/enginesettings.cpp # backend/engine/engine/enginesettings.h # backend/engine/engine/firewall/firewallcontroller_linux.cpp # backend/engine/engine/firewall/firewallcontroller_linux.h # backend/engine/engine/helper/helper_posix.cpp # backend/engine/engine/helper/helper_win.cpp # backend/engine/engine/helper/windscribeinstallhelper_win.cpp # backend/engine/engine/macaddresscontroller/macaddresscontroller_mac.cpp # backend/engine/engine/macaddresscontroller/macaddresscontroller_win.cpp # backend/engine/engine/networkdetectionmanager/inetworkdetectionmanager.h # backend/engine/engine/networkdetectionmanager/networkdetectionmanager_linux.cpp # backend/engine/engine/networkdetectionmanager/networkdetectionmanager_linux.h # backend/engine/engine/networkdetectionmanager/networkdetectionmanager_mac.cpp # backend/engine/engine/networkdetectionmanager/networkdetectionmanager_mac.h # backend/engine/engine/networkdetectionmanager/networkdetectionmanager_win.cpp # backend/engine/engine/networkdetectionmanager/networkdetectionmanager_win.h # backend/engine/engine/serverapi/serverapi.cpp # backend/engine/engine/serverapi/serverapi.h # backend/engine/engine/types/types.cpp # backend/engine/engineserver.cpp # backend/engine/engineserver.h # backend/engine/mac/info.plist # backend/engine/mac/windscribe_engine.entitlements # backend/engine/main.cpp # backend/engine/utils/dnsscripts_linux.cpp # backend/engine/utils/dnsscripts_linux.h # backend/linux/helper/helper.pro # backend/linux/helper/logger.cpp # backend/linux/helper/logger.h # backend/linux/helper/main.cpp # backend/linux/helper/server.cpp # backend/linux/helper/server.h # backend/linux/helper/wireguard/wireguardadapter.cpp # backend/linux/helper/wireguard/wireguardcommunicator.cpp # backend/linux/helper/wireguard/wireguardcontroller.cpp # backend/mac/helper/helper.xcodeproj/project.pbxproj # backend/mac/helper/src/helper-info.plist # backend/mac/helper/src/ipc/helper_security.mm # backend/mac/helper/src/logger.cpp # backend/mac/helper/src/server.cpp # backend/mac/kext/build_kext.sh # backend/mac/kext/readme.txt # backend/mac/kext/windscribe_kext.xcodeproj/project.pbxproj # backend/mac/kext/windscribe_kext/info.plist # backend/windows/windscribe_service/utils.cpp # backend/windows/windscribe_service/windscribe_service.cpp # backend/windows/windscribe_service/windscribe_service.vcxproj # backend/windows/windscribe_service/windscribe_service.vcxproj.filters # common/changelog.txt # common/ipc/commandfactory.cpp # common/ipc/proto/clientcommands.proto # common/ipc/proto/servercommands.proto # common/ipc/proto/types.proto # common/utils/executable_signature/executable_signature.cpp # common/utils/executable_signature/executable_signature.h # common/utils/executable_signature/executable_signature_mac.h # common/utils/executable_signature/executable_signature_mac.mm # common/utils/executable_signature/executable_signature_win.cpp # common/utils/executable_signature/executable_signature_win.h # common/utils/executable_signature/executablesignature_linux.cpp # common/utils/executable_signature/executablesignature_linux.h # common/utils/extraconfig.cpp # common/utils/extraconfig.h # common/utils/hardcodedsettings.cpp # common/utils/hardcodedsettings.h # common/utils/hardcodedsettings.ini # common/utils/linuxutils.cpp # common/utils/linuxutils.h # common/utils/macutils.h # common/utils/macutils.mm # common/utils/mergelog.cpp # common/utils/utils.cpp # common/utils/utils.h # common/utils/winutils.cpp # common/utils/winutils.h # common/version/windscribe_version.h # common/wintun/wintun-0.9.2/api/resources.rc # gui/authhelper/win/ws_com/ws_com/exports.cpp # gui/authhelper/win/ws_com/ws_com/ws_com.vcxproj # gui/authhelper/win/ws_com_server/ws_com_server/ws_com_server.vcxproj # gui/authhelper/win/ws_proxy_stub/ws_proxy_stub/ws_proxy_stub.vcxproj # gui/backend/backend.cpp # gui/backend/backend.h # gui/backend/preferences/preferences.cpp # gui/backend/preferences/preferenceshelper.cpp # gui/gui/connectwindow/connectstateprotocolport/connectstateprotocolport.cpp # gui/gui/gui.pro # gui/gui/info.plist # gui/gui/mainwindow.cpp # gui/gui/mainwindow.h # gui/gui/preferenceswindow/accountwindow/accountwindowitem.cpp # gui/gui/preferenceswindow/accountwindow/accountwindowitem.h # gui/gui/preferenceswindow/generalwindow/generalwindowitem.cpp # gui/gui/preferenceswindow/ipreferenceswindow.h # gui/gui/preferenceswindow/openurlitem.cpp # gui/gui/preferenceswindow/preferenceswindowitem.cpp # gui/gui/preferenceswindow/preferenceswindowitem.h # gui/gui/utils/authchecker_linux.cpp # gui/gui/utils/authchecker_win.cpp # gui/gui/utils/protoenumtostring.cpp # gui/launcher/mac/windscribelauncher.xcodeproj/project.pbxproj # gui/launcher/mac/windscribelauncher/info.plist # installer/linux/additional_files/wstunnel/windscribewstunnel # installer/linux/debian_package/DEBIAN/postinst # installer/linux/debian_package/DEBIAN/preinst # installer/linux/debian_package/DEBIAN/prerm # installer/linux/debian_package/etc/windscribe/update-resolv-conf # installer/linux/debian_package/etc/windscribe/update-systemd-resolved # installer/mac/installer/installer.xcodeproj/project.pbxproj # installer/mac/installer/installer/ForegroundView.m # installer/mac/installer/installer/Info.plist # installer/mac/installer/installer/helper/installhelper_mac.mm # installer/windows/installer/main.cpp # tools/build_all.py # tools/build_all.yml # tools/create_new_linux_keypair.sh # tools/deps/custom_qt/source_changes.json # tools/deps/install_boost.py # tools/vars/wireguard.yml # vs-chromium-project.txt
2 parents f56cd32 + 114f87f commit f79f75a

File tree

163 files changed

+5035
-1356
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+5035
-1356
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ installer/mac/installer/installer/temp_Info.plist
1313
test-exe/*
1414
common/keys/linux/key.pem
1515
common/keys/linux/key.pub
16+
common/keys/linux/key_pub.txt
1617
drawings/*/*.png
1718
/gui/authhelper/win/ws_proxy_stub/ws_proxy_stub/dlldata.c
1819
/gui/authhelper/win/ws_proxy_stub/ws_proxy_stub/ws_proxy_stub_h.h

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,4 +336,4 @@ This General Public License does not permit incorporating your program into
336336
proprietary programs. If your program is a subroutine library, you may
337337
consider it more useful to permit linking proprietary applications with the
338338
library. If this is what you want to do, use the GNU Lesser General
339-
Public License instead of this License.
339+
Public License instead of this License.

README.md

Lines changed: 197 additions & 197 deletions
Large diffs are not rendered by default.

backend/engine/engine.pro

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ BUILD_LIBS_PATH = $$PWD/../../build-libs
1313

1414
INCLUDEPATH += $$COMMON_PATH
1515

16+
# build_all.py adds 'use_signature_check' to the CONFIG environment when invoked without the '--no-sign' flag.
17+
contains(CONFIG, use_signature_check) {
18+
CONFIG(release, debug|release) {
19+
DEFINES += USE_SIGNATURE_CHECK
20+
}
21+
}
1622

1723
win32 {
1824

@@ -142,7 +148,7 @@ LIBS += -framework NetworkExtension
142148
#QMAKE_OBJECTIVE_CFLAGS += -fobjc-arc
143149

144150
#remove unused parameter warnings
145-
QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-parameter
151+
QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-parameter -Wno-deprecated-declarations
146152

147153
#boost include and libs
148154
INCLUDEPATH += $$BUILD_LIBS_PATH/boost/include
@@ -171,7 +177,8 @@ SOURCES += engine/firewall/firewallcontroller_mac.cpp \
171177
engine/helper/helper_posix.cpp \
172178
engine/helper/helper_mac.cpp \
173179
engine/dnsresolver/dnsutils_mac.cpp \
174-
engine/macaddresscontroller/macaddresscontroller_mac.cpp
180+
engine/macaddresscontroller/macaddresscontroller_mac.cpp \
181+
engine/autoupdater/autoupdaterhelper_mac.cpp
175182

176183
HEADERS += $$COMMON_PATH/utils/macutils.h \
177184
engine/connectionmanager/sleepevents_mac.h \
@@ -189,7 +196,8 @@ HEADERS += $$COMMON_PATH/utils/macutils.h \
189196
engine/ping/pinghost_icmp_mac.h \
190197
engine/networkdetectionmanager/networkdetectionmanager_mac.h \
191198
engine/macaddresscontroller/macaddresscontroller_mac.h \
192-
$$COMMON_PATH/utils/executable_signature/executable_signature_mac.h
199+
$$COMMON_PATH/utils/executable_signature/executable_signature_mac.h \
200+
engine/autoupdater/autoupdaterhelper_mac.h
193201

194202
OBJECTIVE_HEADERS += \
195203
engine/networkdetectionmanager/reachability.h \
@@ -214,22 +222,25 @@ QMAKE_INFO_PLIST = mac/info.plist
214222

215223
#QMAKE_LFLAGS += -sectcreate __TEXT __info_plist $$shell_quote($$PWD/Mac/Info.plist)
216224

217-
MY_ENTITLEMENTS.name = CODE_SIGN_ENTITLEMENTS
218-
MY_ENTITLEMENTS.value = $$PWD/mac/windscribe.entitlements
219-
QMAKE_MAC_XCODE_SETTINGS += MY_ENTITLEMENTS
225+
# The referenced file doesn't exist... perhaps this is old debugging code?
226+
#MY_ENTITLEMENTS.name = CODE_SIGN_ENTITLEMENTS
227+
#MY_ENTITLEMENTS.value = $$PWD/mac/windscribe.entitlements
228+
#QMAKE_MAC_XCODE_SETTINGS += MY_ENTITLEMENTS
220229

221230
#postbuild copy commands
222231
copy_resources.commands = $(COPY_DIR) $$PWD/mac/resources $$OUT_PWD/WindscribeEngine.app/Contents
223232
mkdir_launch_services.commands = $(MKDIR) $$OUT_PWD/WindscribeEngine.app/Contents/Library/LaunchServices
224233
copy_helper.commands = $(COPY_DIR) $$PWD/../../installer/mac/binaries/helper/com.windscribe.helper.macos $$OUT_PWD/WindscribeEngine.app/Contents/Library/LaunchServices
225-
copy_profile.commands = $(COPY_DIR) $$PWD/../mac/provisioning_profile/embedded.provisionprofile $$OUT_PWD/WindscribeEngine.app/Contents
226234
mkdir_helpers.commands = $(MKDIR) $$OUT_PWD/WindscribeEngine.app/Contents/Helpers
227235
copy_openvpn.commands = cp $$BUILD_LIBS_PATH/openvpn_2_5_4/openvpn $$OUT_PWD/WindscribeEngine.app/Contents/Helpers/windscribeopenvpn_2_5_4
228236
copy_stunnel.commands = cp $$BUILD_LIBS_PATH/stunnel/stunnel $$OUT_PWD/WindscribeEngine.app/Contents/Helpers/windscribestunnel
229237
copy_wstunnel.commands = cp $$PWD/../mac/wstunnel/windscribewstunnel $$OUT_PWD/WindscribeEngine.app/Contents/Helpers/windscribewstunnel
230238
copy_kext.commands = $(COPY_DIR) $$PWD/../mac/kext/Binary/WindscribeKext.kext $$OUT_PWD/WindscribeEngine.app/Contents/Helpers/WindscribeKext.kext
231239
copy_wireguard.commands = cp $$BUILD_LIBS_PATH/wireguard/windscribewireguard $$OUT_PWD/WindscribeEngine.app/Contents/Helpers/windscribewireguard
232240

241+
exists( $$PWD/../mac/provisioning_profile/embedded.provisionprofile ) {
242+
copy_profile.commands = $(COPY_DIR) $$PWD/../mac/provisioning_profile/embedded.provisionprofile $$OUT_PWD/WindscribeEngine.app/Contents
243+
}
233244

234245
first.depends = $(first) copy_resources mkdir_launch_services copy_helper copy_profile mkdir_helpers copy_openvpn copy_stunnel copy_wstunnel copy_wireguard copy_kext
235246
export(first.depends)
@@ -250,19 +261,16 @@ QMAKE_EXTRA_TARGETS += first copy_resources mkdir_launch_services copy_helper co
250261

251262
linux {
252263

253-
# uncomment for use signature checking on Linux
254-
#DEFINES += USE_SIGNATURE_CHECK_ON_LINUX
255-
256264
#remove linux deprecated copy warnings
257265
QMAKE_CXXFLAGS_WARN_ON += -Wno-deprecated-copy
258266

259-
260267
#boost include and libs
261268
INCLUDEPATH += $$BUILD_LIBS_PATH/boost/include
262269
LIBS += $$BUILD_LIBS_PATH/boost/lib/libboost_serialization.a
270+
LIBS += $$BUILD_LIBS_PATH/boost/lib/libboost_filesystem.a
263271

264272
INCLUDEPATH += $$BUILD_LIBS_PATH/openssl/include
265-
LIBS+=-L$$BUILD_LIBS_PATH/openssl/lib -lssl -lcrypto
273+
LIBS +=-L$$BUILD_LIBS_PATH/openssl/lib -lssl -lcrypto
266274
INCLUDEPATH += $$BUILD_LIBS_PATH/curl/include
267275
LIBS += -L$$BUILD_LIBS_PATH/curl/lib/ -lcurl
268276

@@ -299,11 +307,6 @@ HEADERS += \
299307
engine/networkdetectionmanager/networkdetectionmanager_linux.h \
300308
engine/macaddresscontroller/macaddresscontroller_linux.h
301309

302-
contains(DEFINES, USE_SIGNATURE_CHECK_ON_LINUX) {
303-
RESOURCES += \
304-
$$COMMON_PATH/common_linux.qrc
305-
}
306-
307310
} # linux
308311

309312

@@ -323,6 +326,7 @@ SOURCES += main.cpp \
323326
application/windowsnativeeventfilter.cpp \
324327
application/windscribeapplication.cpp \
325328
engine/apiinfo/apiinfo.cpp \
329+
engine/apiinfo/checkupdate.cpp \
326330
engine/apiinfo/sessionstatus.cpp \
327331
engine/apiinfo/location.cpp \
328332
engine/apiinfo/group.cpp \
@@ -349,7 +353,6 @@ SOURCES += main.cpp \
349353
engine/locationsmodel/nodeselectionalgorithm.cpp \
350354
engine/packetsizecontroller.cpp \
351355
engine/enginesettings.cpp \
352-
engine/autoupdater/autoupdaterhelper_mac.cpp \
353356
engine/tempscripts_mac.cpp \
354357
$$COMMON_PATH/utils/simplecrypt.cpp \
355358
engine/logincontroller/logincontroller.cpp \
@@ -373,6 +376,7 @@ SOURCES += main.cpp \
373376
engine/connectionmanager/connectionmanager.cpp \
374377
engine/connectionmanager/availableport.cpp \
375378
engine/connectionmanager/wireguardconnection.cpp \
379+
engine/macaddresscontroller/imacaddresscontroller.cpp \
376380
$$COMMON_PATH/types/locationid.cpp \
377381
engine/logincontroller/getapiaccessips.cpp \
378382
engine/helper/initializehelper.cpp \
@@ -446,6 +450,7 @@ SOURCES += main.cpp \
446450
engine/networkaccessmanager/networkaccessmanager.cpp
447451

448452
HEADERS += engine/locationsmodel/locationsmodel.h \
453+
engine/apiinfo/checkupdate.h \
449454
engine/locationsmodel/apilocationsmodel.h \
450455
engine/locationsmodel/customconfiglocationsmodel.h \
451456
engine/locationsmodel/locationitem.h \
@@ -494,7 +499,6 @@ HEADERS += engine/locationsmodel/locationsmodel.h \
494499
engine/ping/keepalivemanager.h \
495500
engine/packetsizecontroller.h \
496501
engine/enginesettings.h \
497-
engine/autoupdater/autoupdaterhelper_mac.h \
498502
engine/connectionmanager/stunnelmanager.h \
499503
engine/tempscripts_mac.h \
500504
$$COMMON_PATH/utils/simplecrypt.h \
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#include "checkupdate.h"
2+
#include <QMetaType>
3+
4+
const int typeIdCheckUpdate = qRegisterMetaType<apiinfo::CheckUpdate>("apiinfo::CheckUpdate");
5+
6+
namespace apiinfo {
7+
8+
bool CheckUpdate::initFromJson(QJsonObject &json, QString &outErrorMessage)
9+
{
10+
// check for required fields in json
11+
QStringList required_fields({"current_version", "supported", "latest_version", "latest_build", "is_beta",
12+
"min_version", "update_needed_flag", "update_url"});
13+
for (const QString &str : required_fields)
14+
{
15+
if (!json.contains(str))
16+
{
17+
outErrorMessage = str + " field not found";
18+
return false;
19+
}
20+
}
21+
22+
d->cui_.set_is_available(true); // is_available used as success indicator in gui
23+
d->cui_.set_version(json["latest_version"].toString().toStdString());
24+
d->cui_.set_latest_build(json["latest_build"].toInt());
25+
d->cui_.set_update_channel(static_cast<ProtoTypes::UpdateChannel>(json["is_beta"].toInt()));
26+
d->cui_.set_url(json["update_url"].toString().toStdString());
27+
d->cui_.set_is_supported(json["supported"].toInt() == 1);
28+
29+
if (json.contains("sha256"))
30+
{
31+
d->cui_.set_sha256(json["sha256"].toString().toStdString());
32+
}
33+
d->isInitialized_ = true;
34+
return true;
35+
}
36+
37+
void CheckUpdate::initFromProtoBuf(const ProtoTypes::CheckUpdateInfo &cui)
38+
{
39+
d->cui_ = cui;
40+
d->isInitialized_ = true;
41+
}
42+
43+
ProtoTypes::CheckUpdateInfo CheckUpdate::getProtoBuf() const
44+
{
45+
Q_ASSERT(d->isInitialized_);
46+
return d->cui_;
47+
}
48+
49+
QString CheckUpdate::getUrl() const
50+
{
51+
Q_ASSERT(d->isInitialized_);
52+
return QString::fromStdString(d->cui_.url());
53+
}
54+
55+
QString CheckUpdate::getSha256() const
56+
{
57+
Q_ASSERT(d->isInitialized_);
58+
return QString::fromStdString(d->cui_.sha256());
59+
}
60+
61+
bool CheckUpdate::isInitialized() const
62+
{
63+
return d->isInitialized_;
64+
}
65+
66+
67+
} // apiinfo namespace
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#ifndef CHECKUPDATE_H
2+
#define CHECKUPDATE_H
3+
4+
#include <QString>
5+
#include <QJsonObject>
6+
#include <QSharedDataPointer>
7+
#include "utils/protobuf_includes.h"
8+
9+
namespace apiinfo {
10+
11+
class CheckUpdateData : public QSharedData
12+
{
13+
public:
14+
CheckUpdateData() : isInitialized_(false) {}
15+
16+
CheckUpdateData(const CheckUpdateData &other)
17+
: QSharedData(other),
18+
isInitialized_(other.isInitialized_),
19+
cui_(other.cui_) {}
20+
~CheckUpdateData() {}
21+
22+
bool isInitialized_;
23+
ProtoTypes::CheckUpdateInfo cui_; // only this data is saved in settings
24+
};
25+
26+
// implicitly shared class CheckUpdate
27+
class CheckUpdate
28+
{
29+
public:
30+
explicit CheckUpdate() : d(new CheckUpdateData) {}
31+
CheckUpdate(const CheckUpdate &other) : d (other.d) {}
32+
33+
bool initFromJson(QJsonObject &json, QString &outErrorMessage);
34+
void initFromProtoBuf(const ProtoTypes::CheckUpdateInfo &cui);
35+
ProtoTypes::CheckUpdateInfo getProtoBuf() const;
36+
37+
QString getUrl() const;
38+
QString getSha256() const;
39+
bool isInitialized() const;
40+
41+
private:
42+
QSharedDataPointer<CheckUpdateData> d;
43+
};
44+
45+
} // apiinfo namespace
46+
47+
#endif // CHECKUPDATE_H

backend/engine/engine/autoupdater/autoupdaterhelper_mac.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,10 @@ bool AutoUpdaterHelper_mac::verifyAndRun(const QString &tempInstallerFilename,
8080

8181
// verify installer
8282
qCDebug(LOG_AUTO_UPDATER) << "Verifying signature and certificate of installer: " << tempInstallerFilename;
83-
if (!ExecutableSignature::verifyWithSignCheck(tempInstallerFilename))
83+
ExecutableSignature sigCheck;
84+
if (!sigCheck.verifyWithSignCheck(tempInstallerFilename.toStdWString()))
8485
{
85-
qDebug(LOG_AUTO_UPDATER) << "Failed to verify signature and certificate of downloaded installer";
86+
qDebug(LOG_AUTO_UPDATER) << "Failed to verify signature and certificate of downloaded installer: " << QString::fromStdString(sigCheck.lastError());
8687
Utils::removeDirectory(tempInstallerFilename);
8788
error_ = ProtoTypes::UPDATE_VERSION_ERROR_SIGN_FAIL;
8889
return false;

backend/engine/engine/autoupdater/downloadhelper.cpp

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
#include "utils/linuxutils.h"
1313
#endif
1414

15-
DownloadHelper::DownloadHelper(QObject *parent, NetworkAccessManager *networkAccessManager) : QObject(parent)
15+
DownloadHelper::DownloadHelper(QObject *parent, NetworkAccessManager *networkAccessManager, const QString &platform) : QObject(parent)
1616
, networkAccessManager_(networkAccessManager)
1717
, busy_(false)
18+
, platform_(platform)
1819
, downloadDirectory_(QStandardPaths::writableLocation(QStandardPaths::DataLocation))
1920
, progressPercent_(0)
2021
, state_(DOWNLOAD_STATE_INIT)
@@ -37,7 +38,7 @@ const QString DownloadHelper::downloadInstallerPath()
3738
const QString path = downloadInstallerPathWithoutExtension() + ".dmg";
3839
#elif defined Q_OS_LINUX
3940
QString path;
40-
if(LinuxUtils::isDeb()) {
41+
if(platform_ == LinuxUtils::DEB_PLATFORM_NAME) { // if getPlatformName() fails, we should never get this far anyway
4142
path = downloadInstallerPathWithoutExtension() + ".deb";
4243
}
4344
else {
@@ -213,22 +214,7 @@ void DownloadHelper::removeAutoUpdateInstallerFiles()
213214
QFile::remove(installerPath);
214215
}
215216

216-
#ifdef Q_OS_LINUX
217-
// remove pre-existing signature and public key:
218-
// | signature and key were required to verify the auto-update installer
219-
const QString &signaturePath = signatureInstallPath();
220-
if (QFile::exists(signaturePath))
221-
{
222-
qCDebug(LOG_DOWNLOADER) << "Removing auto-update installer signature";
223-
QFile::remove(signaturePath);
224-
}
225-
const QString &publicKeyPath = publicKeyInstallPath();
226-
if (QFile::exists(publicKeyPath))
227-
{
228-
qCDebug(LOG_DOWNLOADER) << "Removing auto-update installer key";
229-
QFile::remove(publicKeyPath);
230-
}
231-
#elif defined Q_OS_MAC
217+
#ifdef Q_OS_MAC
232218
// remove temp installer.app on mac:
233219
// | installer.app was unpacked from above .dmg
234220
const QString & installerApp = downloadDirectory_ + "/" + INSTALLER_FILENAME_MAC_APP;
@@ -271,13 +257,3 @@ void DownloadHelper::deleteAllReplies()
271257
reply->deleteLater();
272258
}
273259
}
274-
275-
const QString DownloadHelper::publicKeyInstallPath()
276-
{
277-
return downloadInstallerPathWithoutExtension() + ".key";
278-
}
279-
280-
const QString DownloadHelper::signatureInstallPath()
281-
{
282-
return downloadInstallerPath() + ".sig";
283-
}

backend/engine/engine/autoupdater/downloadhelper.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class DownloadHelper : public QObject
1414
{
1515
Q_OBJECT
1616
public:
17-
explicit DownloadHelper(QObject *parent, NetworkAccessManager *networkAccessManager);
17+
explicit DownloadHelper(QObject *parent, NetworkAccessManager *networkAccessManager, const QString &platform);
1818
~DownloadHelper();
1919

2020
enum DownloadState {
@@ -26,8 +26,6 @@ class DownloadHelper : public QObject
2626

2727
const QString downloadInstallerPath();
2828
const QString downloadInstallerPathWithoutExtension();
29-
const QString publicKeyInstallPath();
30-
const QString signatureInstallPath();
3129

3230
void get(QMap<QString, QString> downloads);
3331
void stop();
@@ -55,6 +53,7 @@ private slots:
5553

5654
QMap<NetworkReply*, FileAndProgress> replies_;
5755
bool busy_;
56+
const QString platform_;
5857

5958
QString downloadDirectory_;
6059
uint progressPercent_;

0 commit comments

Comments
 (0)