mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-28 12:47:43 +00:00
Do not disconnect when there's a version mismatch
Just trust the encrypted packet.
This commit is contained in:
parent
bec807fa63
commit
6121fa04bc
@ -223,7 +223,7 @@ public class LanLinkProvider extends BaseLinkProvider {
|
|||||||
|
|
||||||
int protocolVersion = identityPacket.getInt("protocolVersion");
|
int protocolVersion = identityPacket.getInt("protocolVersion");
|
||||||
if (deviceTrusted && isProtocolDowngrade(deviceId, 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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -254,9 +254,9 @@ public class LanLinkProvider extends BaseLinkProvider {
|
|||||||
if (!DeviceInfo.isValidIdentityPacket(secureIdentityPacket)) {
|
if (!DeviceInfo.isValidIdentityPacket(secureIdentityPacket)) {
|
||||||
throw new JSONException("Invalid identity packet");
|
throw new JSONException("Invalid identity packet");
|
||||||
}
|
}
|
||||||
if (secureIdentityPacket.getInt("protocolVersion") != protocolVersion) {
|
int newProtocolVersion = secureIdentityPacket.getInt("protocolVersion");
|
||||||
Log.e("KDE/LanLinkProvider", "Protocol version changed half-way through the handshake");
|
if (newProtocolVersion != protocolVersion) {
|
||||||
return;
|
Log.w("KDE/LanLinkProvider", "Protocol version changed half-way through the handshake: " + protocolVersion + " ->" + newProtocolVersion);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
secureIdentityPacket = identityPacket;
|
secureIdentityPacket = identityPacket;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user