apple-corelocation-experiments icon indicating copy to clipboard operation
apple-corelocation-experiments copied to clipboard

Other things to look into

Open acheong08 opened this issue 1 year ago • 12 comments

https://gsp85-ssl.ls.apple.com/wifi_request

  • Comes from com.apple.geod
  • Sends MAC address and gets a fixed64 back. (Does 1804284399684943872 mean anything to anyone?)

acheong08 avatar May 25 '24 01:05 acheong08

$ strings -a dyld_shared_cache_x86_64h | rg -i "gsp85-carry.ls.apple.com"

https://gsp85-carry.ls.apple.com/wifi_request_tile

Can't find wifi_request in any binaries but found something close in dyld_shared_cache_x86_64h. Need to figure out which of the many dylds contained is the one that gave that

acheong08 avatar May 25 '24 01:05 acheong08

Some magic numbers: 167797871, 3982925012049145399, 6124895493240913920

They seem to be shared across requests for different BSSIDs. Might encode my location but it's not right (it's somehow in the middle of the sea). I'm guessing the first number is an offset somehow

acheong08 avatar May 25 '24 01:05 acheong08

The first URL seems to send the BSSID of whatever network you're connected to along with metadata. Can reliably reproduce by joining new network.

acheong08 avatar May 25 '24 01:05 acheong08

This is too fucking hard. They generate C code from their protobuf definitions without embedding the proto file itself and stripped all symbols from GeoServices

acheong08 avatar May 25 '24 02:05 acheong08

image

Not even Apple knows what the fields mean

acheong08 avatar May 25 '24 02:05 acheong08

Update on wifi_request endpoint. X-tilekey seems to be morton code encoded with a different index. More experimentation required but I need sleep

acheong08 avatar May 26 '24 17:05 acheong08

It is indeed morton encoded.

(y-, x+) Basically the further north, the more y decreases and the further east, the more x increases

acheong08 avatar May 28 '24 17:05 acheong08

Hi, great tool. Is there a way to get the vendor name matching a MAC address, possibly as a display option?

AK47-2020 avatar Jun 02 '24 16:06 AK47-2020

Yup. Just did. Note that the CLI is just for me to play around and experiment with things more easily. Don't expect it to be coherent.

acheong08 avatar Jun 02 '24 22:06 acheong08

Thanks. How do I extract a list of MAC addresses from, say, a square area? Also, it would be good to have a dialog box to change default coordinates. Indeed, you can them manually.

AK47-2020 avatar Jun 04 '24 09:06 AK47-2020

How do I extract a list of MAC addresses from, say, a square area?

I'm not sure I want to have that in the demo UI. You can do that with code by taking the GPS coordinates of 2 corners, encode them into tile coordinates (morton.Encodemorton.Unpack), and have 2 loops to go through each tile in the area, morton.Pack to tileKey, and use lib.GetTile to fetch the access points in that area. That only covers 1 network each so you'll need to then use the wloc api to fill it up with the MAC addresses from tiles as seeds.

Also, it would be good to have a dialog box to change defaut coordinates.

I'll add it as a CLI option.

acheong08 avatar Jun 04 '24 12:06 acheong08

Thanks. I am not a go programmer, but I'll give it a try

AK47-2020 avatar Jun 04 '24 12:06 AK47-2020

It is indeed morton encoded.

(y-, x+) Basically the further north, the more y decreases and the further east, the more x increases

Is this still the case or was it resolved in related REAME.md "Update 2"? I stumbled across something that reminded me of this project: WGS 84

Pardon this intrusion if its unrelated or you've checked that, I hardly understand coordinate systems and do understand various ways this type of relation can manifest, but appreciate this project and the work being done.

h2oFanti avatar Oct 28 '24 21:10 h2oFanti

Is this still the case or was it resolved in related REAME.md "Update 2"?

Yup. I found the solution and it works fine now.

acheong08 avatar Oct 28 '24 21:10 acheong08