Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
so recently apple changed the url from beta.maps.apple.com to maps.apple.com. this has started this weird issue where chromium legacy (my default browser) would start up and go to maps.apple.com whenever i opened the maps app. the maps app still displays it fine but i have no idea why its opening the browser on the side. sounds similar to the other issue i was talking about.
 
The developer, Maupro12321, very kindly shared the source code: https://github.com/ObscureMosquito/MapsX/blob/main/Tweak.x

Instead of porting this to SIMBL I tried modifying Squid's configuration to do a simple URL rewrite:

$_ =~ s/^(https?:\/\/)gspe(\d*)\.ls\.apple\.com/$1gspe$2-ssl.ls.apple.com/g;

The URL rewrite seemed to be working, but it didn't fix MapKit, which actually appears to have already been using the -ssl domain. You can see the problem right in the system console, the url it tries to access returns 503.

If anyone wants to install CharlesProxy/MitmProxy on a newer and older Mac and look at the URLs being called, maybe we could investigate further. I just don't care that much about 2013-era Apple Maps. There's a reason everyone panned this thing when it came out, sure it got better over time but this is the early one.
this is a screenshot taken from macos 10.12.6 sierra, where the stock maps app still works fine
plus, is there a way to do the gspe__.ls.apple.com to gspe__-ssl.ls.apple.com rewrite in charles?
 

Attachments

  • Screen Shot 2025-04-17 at 19.06.06.png
    Screen Shot 2025-04-17 at 19.06.06.png
    2.5 MB · Views: 44
so i regularly use the new modified maps app, but it opens the original one whenever i start up the app.
This is an OS X bug, likely caused by the two apps both being called "Maps". I've usually only seen this happen when the bundle identifier is the same (which they are not in this case), but it has happened enough that I'm confident that is what's happening.

You can delete the original app and this will not happen. If you want to keep a backup, keep it in a zip file.

so recently apple changed the url from beta.maps.apple.com to maps.apple.com. this has started this weird issue where chromium legacy (my default browser) would start up and go to maps.apple.com whenever i opened the maps app. the maps app still displays it fine but i have no idea why its opening the browser on the side. sounds similar to the other issue i was talking about.
No, completely different issue. The app sees "maps.apple.com" as an external URL (because it's on a different subdomain from beta.maps.apple.com), and so it opens the page in your default web browser.

I've updated the app to use the new URL.

 
The developer, Maupro12321, very kindly shared the source code: https://github.com/ObscureMosquito/MapsX/blob/main/Tweak.x

Instead of porting this to SIMBL I tried modifying Squid's configuration to do a simple URL rewrite:

$_ =~ s/^(https?:\/\/)gspe(\d*)\.ls\.apple\.com/$1gspe$2-ssl.ls.apple.com/g;

The URL rewrite seemed to be working, but it didn't fix MapKit, which actually appears to have already been using the -ssl domain. You can see the problem right in the system console, the url it tries to access returns 503.

If anyone wants to install CharlesProxy/MitmProxy on a newer and older Mac and look at the URLs being called, maybe we could investigate further. I just don't care that much about 2013-era Apple Maps. There's a reason everyone panned this thing when it came out, sure it got better over time but this is the early one.
(not very neccessary, just wanted to check if the issue here is certificate pinning) i compared the urls with a charles log from 10.12 sierra, this time with more details. 10.12 maps seems to use gspe19-ssl.ls.apple.com for the map tiles, and gspe11-ssl for satellite tiles. 10.9 maps, on the other hand, tries to connect to gspa35-ssl.ls.apple.com, which no longer exists. i set up a rewrite rule from gspa35 to gspe19, but it does not work. it is also showing <unknown> underneath gspa35. this may be a sign of certificate pinning. the rewrite tool doesn't even see the gspa35-ssl connection, according to the error log. in a browser, the rewrite rule does not seem to work either.
 

Attachments

  • Maps.chls.zip
    12.2 MB · Views: 22
(not very neccessary, just wanted to check if the issue here is certificate pinning) i compared the urls with a charles log from 10.12 sierra, this time with more details. 10.12 maps seems to use gspe19-ssl.ls.apple.com for the map tiles, and gspe11-ssl for satellite tiles. 10.9 maps, on the other hand, tries to connect to gspa35-ssl.ls.apple.com, which no longer exists. i set up a rewrite rule from gspa35 to gspe19, but it does not work. it is also showing <unknown> underneath gspa35. this may be a sign of certificate pinning. the rewrite tool doesn't even see the gspa35-ssl connection, according to the error log. in a browser, the rewrite rule does not seem to work either.
My suspicion is that the underlying api is just different for Mac vs iOS.

I haven't checked specifically, but it simply doesn't make sense to me that Apple would use certificate pinning for the Maps when they use certificate pinning for almost nothing else in Mavericks.
 
Last edited:
tutorial:
open charles proxy (use version 3.12.3)
turn on the mac os x proxy (you should keep it on 24/7)
install and trust charles root certificate
import these two rewrite sets (tools -> rewrite):
download this python script to generate the accesskey for the maps servers (obtains token from duckduckgo and sends it to the mapkit bootstrapper to get accesskey)
enable ssl proxying in charles for the following:
*.pythonhosted.org
*.pypi.org
*.ls.apple.com
gsp1.apple.com
go to https://www.python.org/downloads/release/python-3125/ and install python (anything after 3.12.5 is no longer compatible with 10.9)
open terminal, type python3 -m pip install requests --trusted-host pypi.org --trusted-host files.pythonhosted.org
go into charles, head over to tools -> map remote, enable it
map (or import through the file) the following (use the host box, leave protocol blank, for paths (e.g. /use), put "/use" into the path box):
gspa35-ssl.ls.apple.com -> gspe35-ssl.ls.apple.com
gspa11.ls.apple.com -> gspe11-ssl.ls.apple.com
gspa12.ls.apple.com -> gspe12.ls.apple.com
gspa19.ls.apple.com -> gspe19.ls.apple.com
gsp10-ssl.ls.apple.com/use -> gsp64-ssl.ls.apple.com/a/v2/use
gspa21.ls.apple.com -> gspe21-ssl.ls.apple.com
gsp1.apple.com (no its not a typo, theres no .ls here) -> gspe1-ssl.ls.apple.com
hit ok
run the python script and copy the accesskey (it should start with the unix timestamp and end with an equal sign (=))
paste (replace) the accesskey into the add query param rewrite rule in the accesskey rewrite set
hit ok on everything
the only inconvenience here is that you will have to generate and insert a new accesskey every 30 minutes, because they do expire and the map will stop updating once they expire
the app cannot generate accesskeys on its own because it was never supposed to; apple updated the authentication format from tk (token, which the app can generate) and mapkey (which the app can also generate) to just accesskey (which the app does not know how to generate), and sid (which actually doesnt matter; in fact, this app does send an sid value of 00 by default)
the python script was modified by gemini to help me with the proxy settings and the text
 

Attachments

  • Maps Fix.xml.zip
    917 bytes · Views: 5
  • Maps accessKey.xml.zip
    682 bytes · Views: 7
  • MapKit_accessKey_Generator.py.zip
    1.7 KB · Views: 3
  • Map Remote.xml.zip
    532 bytes · Views: 4
Last edited:
tutorial:
open charles proxy (use version 3.12.3)
turn on the mac os x proxy (you should keep it on 24/7)
install and trust charles root certificate
import these two rewrite sets (tools -> rewrite):
download this python script to generate the accesskey for the maps servers (obtains token from duckduckgo and sends it to the mapkit bootstrapper to get accesskey)
enable ssl proxying in charles for the following:
*.pythonhosted.org
*.pypi.org
*.ls.apple.com
gsp1.apple.com
go to https://www.python.org/downloads/release/python-3125/ and install python (anything after 3.12.5 is no longer compatible with 10.9)
open terminal, type python3 -m pip install requests --trusted-host pypi.org --trusted-host files.pythonhosted.org
go into charles, head over to tools -> map remote, enable it
map the following (use the host box, leave protocol blank, for paths (e.g. /use), put "/use" into the path box):
gspa35-ssl.ls.apple.com -> gspe35-ssl.ls.apple.com
gspa11.ls.apple.com -> gspe11-ssl.ls.apple.com
gspa12.ls.apple.com -> gspe12.ls.apple.com
gspa19.ls.apple.com -> gspe19.ls.apple.com
gsp10-ssl.ls.apple.com/use -> gsp64-ssl.ls.apple.com/a/v2/use
gspa21.ls.apple.com -> gspe21-ssl.ls.apple.com
gsp1.apple.com (no its not a typo, theres no .ls here) -> gspe1-ssl.ls.apple.com
hit ok
run the python script and copy the accesskey (it should start with the unix timestamp and end with an equal sign (=))
paste (replace) the accesskey into the add query param rewrite rule in the accesskey rewrite set
hit ok on everything
the only inconvenience here is that you will have to generate and insert a new accesskey every 30 minutes, because they do expire and the map will stop updating once they expire
the app cannot generate accesskeys on its own because it was never supposed to; apple updated the authentication format from tk (token, which the app can generate) and mapkey (which the app can also generate) to just accesskey (which the app does not know how to generate), and sid (which actually doesnt matter; in fact, this app does send an sid value of 00 by default)
the python script was modified by gemini to help me with the proxy settings and the text
whats working:
standard tiles (can get VERY slow sometimes)
pois, labels, roads
satellite tiles
3d/flyover (not available everywhere)
traffic colored dots
traffic alerts
reviews (i think reviews has always worked)

whats not working:
directions

known issues (most of these are very uncommon):
(common) map tiles (standard and satellite) appearing slowly
oceans and bodies of water dont show up properly in standard
some tiles not loading at all unless you zoom in on them
mis-aligned tiles (e.g. the same road on different tiles causes it to look split up at the border of the tiles; can be fixed by zooming in on the broken section)
random (non existent irl) big 3d objects that block the view of the map (its an issue with apple maps tiles, its what apple maps got hated on for in 2012; these do not appear in satellite)
(common) satellite view will suck up a lot of memory from charles, causing charles to freeze and very occasionally crash when recording
 
Last edited:
  • Like
Reactions: Wowfunhappy
Here's a simplified copy of @iPodNano3's accesskey-retrieval script as a Python 2 script, so it will work with the copy of Python that ships with Mavericks:

Python:
#!/usr/bin/python

import urllib2
import json

browser_headers = {
    "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Safari/605.1.15",
    "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
    "Accept-Language": "en-US,en;q=0.5",
    "Connection": "keep-alive",
    "Referer": "https://duckduckgo.com/"
}

token_request = urllib2.Request("https://duckduckgo.com/local.js?get_mk_token=1")
for header, value in browser_headers.items():
    token_request.add_header(header, value)
  
bearer_token = urllib2.urlopen(token_request).read().strip()
if not bearer_token:
    raise Exception("Received empty response from DuckDuckGo token endpoint.")

mapkit_request = urllib2.Request("https://cdn.apple-mapkit.com/ma/bootstrap?apiVersion=2&mkjsVersion=5.79.95&poi=1")
for header, value in browser_headers.items():
    mapkit_request.add_header(header, value)
mapkit_request.add_header("Origin", "https://duckduckgo.com")
mapkit_request.add_header("Authorization", "Bearer {}".format(bearer_token))

mapkit_data = json.loads(urllib2.urlopen(mapkit_request).read())
access_key = mapkit_data.get("accessKey")
if not access_key:
    raise Exception("accessKey not found in the MapKit response.")

print(access_key)

I'd wanted to automate this and make it work without CharlesProxy, but at the moment I can't get it to work.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.