{"id":13582306,"url":"https://github.com/retroplasma/flyover-reverse-engineering","last_synced_at":"2025-04-06T14:30:41.547Z","repository":{"id":45910095,"uuid":"168882098","full_name":"retroplasma/flyover-reverse-engineering","owner":"retroplasma","description":"Reversing Apple's 3D satellite mode","archived":true,"fork":false,"pushed_at":"2021-06-18T11:17:11.000Z","size":172,"stargazers_count":590,"open_issues_count":0,"forks_count":45,"subscribers_count":22,"default_branch":"master","last_synced_at":"2024-11-05T22:40:42.391Z","etag":null,"topics":["3d-models","apple-flyover","apple-maps","extract","gis","reverse-engineering"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/retroplasma.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-02T21:50:03.000Z","updated_at":"2024-09-07T19:36:05.000Z","dependencies_parsed_at":"2022-09-02T11:01:12.729Z","dependency_job_id":null,"html_url":"https://github.com/retroplasma/flyover-reverse-engineering","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retroplasma%2Fflyover-reverse-engineering","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retroplasma%2Fflyover-reverse-engineering/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retroplasma%2Fflyover-reverse-engineering/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retroplasma%2Fflyover-reverse-engineering/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/retroplasma","download_url":"https://codeload.github.com/retroplasma/flyover-reverse-engineering/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247495656,"owners_count":20948090,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3d-models","apple-flyover","apple-maps","extract","gis","reverse-engineering"],"created_at":"2024-08-01T15:02:35.204Z","updated_at":"2025-04-06T14:30:41.264Z","avatar_url":"https://github.com/retroplasma.png","language":"Go","funding_links":[],"categories":["Go","\u003ca id=\"1d9dec1320a5d774dc8e0e7604edfcd3\"\u003e\u003c/a\u003e工具-新添加的"],"sub_categories":["\u003ca id=\"8f1b9c5c2737493524809684b934d49a\"\u003e\u003c/a\u003e文章\u0026\u0026视频"],"readme":"\u003cimg alt=\"header\" title=\"Header image: 41.8902, 12.4923\" width=\"100%\" src=\"https://user-images.githubusercontent.com/46618410/94180911-07108600-fe9f-11ea-92d1-3d0960df4c0a.jpg\"\u003e\n\nReverse-engineering *Flyover* (3D satellite mode) from Apple Maps. Similar work is done for Google Earth [here](https://github.com/retroplasma/earth-reverse-engineering).\n\n#### Status\nRoughly, these parts have been figured out:\n- bootstrap of manifests\n- URL structure\n- authentication algorithm\n- map tiling and conversion from geo coordinates\n- mesh decompression (huffman tables, edgebreaker variant etc.)\n- tile lookup using octree\n\nWe can authenticate URLs and retrieve textured 3D models from given coordinates (latitude, longitude).\n\n#### General\nData is stored in map tiles. These five tile styles are used for Flyover:\n\n|Type  | Purpose                                     | URL structure                                        |\n|------|---------------------------------------------|------------------------------------------------------|\n|C3M   | Texture, Mesh, Transformation(, Animation)  | 🅐(?\\|\u0026)style=15\u0026v=⓿\u0026region=❶\u0026x=❷\u0026y=❸\u0026z=❹\u0026h=❺    |\n|C3MM 1| Metadata                                    | 🅐(?\\|\u0026)style=14\u0026v=⓿\u0026part=❻\u0026region=❶                |   \n|C3MM 2| Metadata                                    | 🅐(?\\|\u0026)style=52\u0026v=⓿\u0026region=❶\u0026x=❷\u0026y=❸\u0026z=❹\u0026h=❺    |   \n|DTM 1 | Terrain/Surface/Elevation                   | 🅐(?\\|\u0026)style=16\u0026v=⓿\u0026region=❶\u0026x=❷\u0026y=❸\u0026z=❹         |\n|DTM 2 | Terrain/Surface/Elevation                   | 🅐(?\\|\u0026)style=17\u0026v=⓿\u0026size=❼\u0026scale=❽\u0026x=❷\u0026y=❸\u0026z=❹  |\n\n- 🅐: URL prefix from resource manifest\n- ⓿: Version from resource manifest or altitude manifest using region\n- ❶: Region ID from altitude manifest\n- ❷❸❹: Map tile numbers ([tiled web map](https://en.wikipedia.org/wiki/Tiled_web_map) scheme)\n- ❺: Height/altitude index. Probably from C3MM\n- ❻: Incremental part number\n- ❼❽: Size/scale. Not sure where its values come from\n\n#### Resource hierarchy\n```\nResourceManifest\n└─ AltitudeManifest\n   ├─ C3MM\n   │  └─ C3M\n   └─ DTM?\n```\nFocusing on C3M(M) for now. DTMs are images with a footer and are probably used for the [grid](https://user-images.githubusercontent.com/46618410/53483243-fdcbf700-3a78-11e9-8fc0-ad6cfa8c57cd.png) that is displayed when Maps is loading.\n\n#### Code\nThis repository is structured as follows:\n\n|Directory           | Description                  |\n|--------------------|------------------------------|\n|[cmd](./cmd)        | command line programs        |\n|[pkg](./pkg)        | most of the actual code      |\n|[proto](./proto)    | protobuf files               |\n|[scripts](./scripts)| additional scripts           |\n|[vendor](./vendor)  | dependencies                 |\n\n##### Setup\n\nInstall [Go](https://golang.org/) 1.15.x and run:\n```bash\ngo get -d github.com/retroplasma/flyover-reverse-engineering/...\ncd \"$(go env GOPATH)/src/github.com/retroplasma/flyover-reverse-engineering\"\n```\n\nThen edit [config.json](config.json):\n- automatically (macOS, Linux, WSL):\n  - `./scripts/get_config.sh \u003e config.json`\n- faster (macOS Catalina or older):\n  - `./scripts/get_config_macos.sh \u003e config.json`\n- or manually (Catalina or older):\n  - `resourceManifestURL`: from [GEOConfigStore.db/com.apple.GEO.plist](#files-on-macos) or [GeoServices](#files-on-macos) binary\n  - `tokenP1`: from [GeoServices](#files-on-macos) binary (function: `GEOURLAuthenticationGenerateURL`)\n\n##### Command line programs\nHere are some command line programs that use code from [pkg](./pkg):\n\n###### Export OBJ [\u003csup\u003e[code]\u003c/sup\u003e](./cmd/export-obj/main.go)\n\nUsage:\n```\ngo run cmd/export-obj/main.go [lat] [lon] [zoom] [tryXY] [tryH]\n\nParameter   Description       Example\n--------------------------------------\nlat         Latitude          34.007603\nlon         Longitude         -118.499741\nzoom        Zoom (~ 13-20)    20\ntryXY       Area scan         3\ntryH        Altitude scan     40\n```\n\nThis exports Santa Monica Pier to `./downloaded_files/obj/...`:\n```\ngo run cmd/export-obj/main.go 34.007603 -118.499741 20 3 40\n```\n\nOptional: Center-scale OBJ using node.js script:\n```\nnode scripts/center_scale_obj.js\n```\n\nIn Blender (compatible tutorial [here](https://github.com/retroplasma/earth-reverse-engineering/blob/1dd24a723513d7e96f249e2c635416d4596992c4/BLENDER.md)):\n\n\u003cimg src=\"https://user-images.githubusercontent.com/46618410/65068957-fa06b000-d989-11e9-9091-1e71874b0b0c.png\" width=\"300px\"\u003e\n\n\n###### Authenticate URL [\u003csup\u003e[code]\u003c/sup\u003e](./cmd/auth/main.go)\nThis authenticates a URL using parameters from `config.json`:\n```\ngo run cmd/auth/main.go [url]\n```\n\n###### Parse C3M file [\u003csup\u003e[code]\u003c/sup\u003e](./cmd/parse-c3m/main.go)\nThis parses a C3M v3 file, decompresses meshes, reads JPEG textures and produces a struct that contains a textured 3d model:\n```\ngo run cmd/parse-c3m/main.go [file]\n```\n\n###### Parse C3MM file [\u003csup\u003e[code]\u003c/sup\u003e](./cmd/parse-c3mm/main.go)\nThis parses a C3MM v1 file. The C3MM files in a region span octrees whose roots are indexed in the first file.\n```\ngo run cmd/parse-c3mm/main.go [file] [[file_number]]\n```\n\n#### Files on macOS\n- `~/Library/Containers/com.apple.geod/Data/Library/Caches/com.apple.geod/GEOConfigStore.db`\n  - last resource manifest url\n- `~/Library/Preferences/com.apple.GEO.plist`\n  - last resource manifest url ~prior to catalina\n- `~/Library/Caches/GeoServices/Resources/altitude-*.xml`\n  - defines regions for c3m urls\n  - `altitude-*.xml` url in resource manifest\n- `~/Library/Containers/com.apple.geod/Data/Library/Caches/com.apple.geod/MapTiles/MapTiles.sqlitedb`\n  - local map tile cache\n- `/System/Library/PrivateFrameworks/GeoServices.framework/GeoServices`\n  - resource manifest base url, networking, caching, authentication\n- `/System/Library/PrivateFrameworks/VectorKit.framework/VectorKit`\n  - parsers, decoders\n- `/System/Library/PrivateFrameworks/GeoServices.framework/XPCServices/com.apple.geod.xpc`\n  - loads `GeoServices`\n- `/Applications/Maps.app/Contents/MacOS/Maps`\n  - loads `VectorKit`\n\n#### Important\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fretroplasma%2Fflyover-reverse-engineering","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fretroplasma%2Fflyover-reverse-engineering","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fretroplasma%2Fflyover-reverse-engineering/lists"}