Skip to content

@mega-yfue/eufy-sdk / p2pCodec / buildLookupWithKeyPayload

Function: buildLookupWithKeyPayload()

ts
function buildLookupWithKeyPayload(
   p2pDid, 
   selfHost, 
   selfPort, 
   dskKey
): Buffer;

Cloud-lookup payload — the CLASSIC variant (LOOKUP_WITH_KEY, 0xf126), reverse-engineered byte-exact against the app's own request (cold-start, phone force-stopped then reopened). Distinct from buildLookupWithKeyPayload2 (LOOKUP_WITH_KEY2, 0xf16a) which eufy-sdk already sent: that variant only ever got relay-pool candidates back for a remote (cross-WAN) target; THIS variant is what got the real app a genuine direct-device address.

[p2pDid:20][selfAddr:16][clientVersion:4 = 02 05 01 05][dskKey][0x00000000]. selfAddr is the caller's own observed LAN host:port (the socket's own bound address) — a STUN-like self-report, NOT the target's address. clientVersion was 02 05 01 05 in every capture; reproduced verbatim since its exact semantics (and whether it's validated) are unconfirmed.

Parameters

p2pDid

string

selfHost

string

selfPort

number

dskKey

string

Returns

Buffer

Independent and unofficial. Not affiliated with, endorsed by, or sponsored by Anker Innovations, Anker eufy, or eufy. "Anker eufy", "eufy" and "Anker" are trademarks of their respective owners. Use responsibly — rapid or failed logins can trigger captcha or temporary cooldowns.