Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
dependencies ▾

Modern-Apps.git / scripts / networklocation / wps_harvest / reference / README.md

README.md2.0 KiBRenderedCodeRaw

gs-loc protocol reference

These two files are recovered from commit cb9f1c384^, which is the last commit before :networklocation dropped its online Apple WPS client. They are reference only โ€” nothing builds them. They are the specification the Rust client in ../src/gsloc.rs implements.

FileWhat it pins
apple_wps.protoThe gs-loc wire schema: WifiPositioning, CellPositioning, and the BeaconLocation payload, including the per-beacon horizontal_accuracy field.
ApplePositioningService.kt.txtThe endpoint, the ASCII request envelope, the 10-byte response header, and the 1e8 coordinate scale.

Recover them again with:

git show cb9f1c384^:networklocation/src/main/proto/apple_wps.proto
git show cb9f1c384^:networklocation/src/main/java/com/vayunmathur/networklocation/apple/ApplePositioningService.kt

The bits that matter

Endpoint POST https://gs-loc.apple.com/clls/wloc, Content-Type: application/x-www-form-urlencoded, with a spoofed locationd User-Agent.

Request envelope, big-endian, wrapping the serialized protobuf:

u16 1                       version
u16 len, ascii locale       "en_US"
u16 len, ascii identifier   "com.apple.locationd"
u16 len, ascii version      "8.4.1.12H321"
u32 1
u32 0
u16 payload_len
payload

Response: a fixed 10-byte header, then the serialized protobuf.

Coordinates are int64 degrees x 1e8. horizontal_accuracy is int32 metres; a negative value (and the (-1, -1) coordinate pair) means "location unknown for this beacon".

Why this is the whole harvester

A request carries only beacon identifiers; the response echoes each identifier back with its own location filled in. Apple does not return a device position. Critically, it returns more beacons than were asked for โ€” querying one BSSID yields a few hundred nearby ones โ€” which is what makes a snowball crawl possible: every response both answers the query and extends the frontier.