From 8f9fde8f40210dbd9f9b42991c91cb2fa43e381e Mon Sep 17 00:00:00 2001 From: Albert Vaca Date: Wed, 2 Mar 2016 16:38:03 -0800 Subject: [PATCH] Fixed crash when pairing old Android apps. --- core/backends/lan/landevicelink.cpp | 5 +++++ core/backends/lan/lanlinkprovider.cpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/core/backends/lan/landevicelink.cpp b/core/backends/lan/landevicelink.cpp index 50c8dcb54..324cd18e6 100644 --- a/core/backends/lan/landevicelink.cpp +++ b/core/backends/lan/landevicelink.cpp @@ -140,6 +140,11 @@ void LanDeviceLink::userRequestsUnpair() void LanDeviceLink::setPairStatus(PairStatus status) { + if (status == Paired && mSocketLineReader->peerCertificate().isNull()) { + Q_EMIT pairingError(i18n("This device can't be paired because is running an old version of KDE Connect.")); + return; + } + DeviceLink::setPairStatus(status); if (status == Paired) { Q_ASSERT(KdeConnectConfig::instance()->trustedDevices().contains(deviceId())); diff --git a/core/backends/lan/lanlinkprovider.cpp b/core/backends/lan/lanlinkprovider.cpp index 9389f89db..4e6301355 100644 --- a/core/backends/lan/lanlinkprovider.cpp +++ b/core/backends/lan/lanlinkprovider.cpp @@ -235,7 +235,7 @@ void LanLinkProvider::connected() return; // Return statement prevents from deleting received package, needed in slot "encrypted" } else { qWarning() << "Incompatible protocol version, this won't work"; - addLink(deviceId, socket, receivedPackage, LanDeviceLink::Remotely); + //addLink(deviceId, socket, receivedPackage, LanDeviceLink::Remotely); } } else {