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

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

README.md2.0 KiBRenderedCodeRaw
1# gs-loc protocol reference
2
3These two files are recovered from commit `cb9f1c384^`, which is the last commit before
4`:networklocation` dropped its online Apple WPS client. They are **reference only** โ€” nothing
5builds them. They are the specification the Rust client in `../src/gsloc.rs` implements.
6
7| File | What it pins |
8| --- | --- |
9| `apple_wps.proto` | The `gs-loc` wire schema: `WifiPositioning`, `CellPositioning`, and the `BeaconLocation` payload, including the per-beacon `horizontal_accuracy` field. |
10| `ApplePositioningService.kt.txt` | The endpoint, the ASCII request envelope, the 10-byte response header, and the `1e8` coordinate scale. |
11
12Recover them again with:
13
14```sh
15git show cb9f1c384^:networklocation/src/main/proto/apple_wps.proto
16git show cb9f1c384^:networklocation/src/main/java/com/vayunmathur/networklocation/apple/ApplePositioningService.kt
17```
18
19## The bits that matter
20
21**Endpoint** `POST https://gs-loc.apple.com/clls/wloc`, `Content-Type:
22application/x-www-form-urlencoded`, with a spoofed `locationd` User-Agent.
23
24**Request envelope**, big-endian, wrapping the serialized protobuf:
25
26```
27u16 1 version
28u16 len, ascii locale "en_US"
29u16 len, ascii identifier "com.apple.locationd"
30u16 len, ascii version "8.4.1.12H321"
31u32 1
32u32 0
33u16 payload_len
34payload
35```
36
37**Response**: a fixed 10-byte header, then the serialized protobuf.
38
39**Coordinates** are `int64` degrees x 1e8. `horizontal_accuracy` is `int32` metres; a negative
40value (and the `(-1, -1)` coordinate pair) means "location unknown for this beacon".
41
42## Why this is the whole harvester
43
44A request carries only beacon identifiers; the response echoes each identifier back with its
45own location filled in. Apple does not return a device position. Critically, it returns *more*
46beacons than were asked for โ€” querying one BSSID yields a few hundred nearby ones โ€” which is
47what makes a snowball crawl possible: every response both answers the query and extends the
48frontier.