kcd connect <ip> can never succeed: pre-TLS identity carries targetDeviceId 'manual', app drops it
Summary
kcd connect <ip> dials with targetID = "manual" (internal/daemon/ipc_routes.go), and DialDevice unconditionally copies that into the pre-TLS plaintext identity as TargetDeviceID (internal/daemon/transport.go). The Android app enforces targetDeviceId when present (LanLinkProvider.kt):
val targetDeviceId = identityPacket.getStringOrNull("targetDeviceId")
if (targetDeviceId != null && targetDeviceId != DeviceHelper.getDeviceId(context)) {
Log.e("KDE/LanLinkProvider", "Received a connection request for a device that isn't me: $targetDeviceId")
socket.closeSafe()
return
}
So every manual connect is rejected with isn't me: manual. kcd itself enforces the same rule inbound (transport.go: preBody.TargetDeviceID != "" && != localDeviceID \u2192 drop), so a literal "manual" value is wrong on both sides.
Evidence (live capture, kcd 1.18.1 + KDE Connect Android 1.35.16, Pixel 10a)
Phone logcat at the moment of kcd connect 192.168.178.98:
I KDE/LanLinkProvider: identity packet received from a TCP connection from mercury
E KDE/LanLinkProvider: Received a connection request for a device that isn't me: manual
Daemon side only ever shows the dial (device_id=manual); the phone closes right after reading the identity.
Impact
Combined with no dial-on-startup (auto-reconnect only runs post-drop) and the phone not dialling back on its own, there is currently no working path to (re)establish a link to a known paired device short of a full unpair/re-pair cycle.
Suggested fix
When the target id is unknown (manual connect), omit TargetDeviceID (empty \u2192 field absent) instead of sending the placeholder. The app skips the check when the field is null, and auto-reconnect/pair flows that pass the real id are unaffected.
Root cause was exactly as diagnosed, when running kcd connect <ip> stamped the "manual" placeholder into the pre-TLS identity's targetDeviceId, and stock Android drops any pre-TLS identity addressed to another device
fixed in (400a8b9b7e524d83b7a89be4c64107a8e6fa7761) with added tests. it's part of V1.19.0 release
Confirmed fixed on real hardware with 1.19.0 (Pixel 10a, KDE Connect Android 1.35.16): kcd connect <ip> completes on the first dial after a daemon restart — device connected and responsive. Thanks!