2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-22 09:58:08 +00:00

Do not disconnect when there's a version mismatch

Just trust the encrypted packet.
This commit is contained in:
Albert Vaca Cintora 2025-02-08 01:55:44 +01:00
parent bec807fa63
commit 6121fa04bc

View File

@ -223,7 +223,7 @@ public class LanLinkProvider extends BaseLinkProvider {
int protocolVersion = identityPacket.getInt("protocolVersion");
if (deviceTrusted && isProtocolDowngrade(deviceId, protocolVersion)) {
Log.w("KDE/LanLinkProvider", "Refusing to connect to a device using an older protocol version.");
Log.w("KDE/LanLinkProvider", "Refusing to connect to a device using an older protocol version:" + protocolVersion);
return;
}
@ -254,9 +254,9 @@ public class LanLinkProvider extends BaseLinkProvider {
if (!DeviceInfo.isValidIdentityPacket(secureIdentityPacket)) {
throw new JSONException("Invalid identity packet");
}
if (secureIdentityPacket.getInt("protocolVersion") != protocolVersion) {
Log.e("KDE/LanLinkProvider", "Protocol version changed half-way through the handshake");
return;
int newProtocolVersion = secureIdentityPacket.getInt("protocolVersion");
if (newProtocolVersion != protocolVersion) {
Log.w("KDE/LanLinkProvider", "Protocol version changed half-way through the handshake: " + protocolVersion + " ->" + newProtocolVersion);
}
} else {
secureIdentityPacket = identityPacket;