[Think Tank #2 - SOLVED] Modifying Maps to enable Navigation outside USA

Search This thread

canadiancow

Senior Member
Feb 15, 2008
472
3
San Francisco
Edit 4: New Thread
Since the main issue in this thread has been solved (Navigation works outside the USA), I'm going to stop updating it. For the latest updates on Brut.all's mod, please use http://forum.xda-developers.com/showthread.php?t=630887

Edit 3: Solution

Brut.all has done it again with 4.0.0. The modified version works anywhere Google has the "Directions" feature, but it has reduced functionality (including in the USA).

The reduced functionality is as follows:
*No street name at the top
*No arrow indicating next turn direction
*Voice guidance is delayed, if at all present
Please do not waste space posting these issues. They are known.


If you are only going to be using Navigation in the USA, then get the official version from the Market. If you need Navigation outside the USA, then install the modified version.

If you don't want to do the installation manually, then uninstall Google Maps, and download and install Nav Launcher 2.1.3 from the Market (see below for a QR code). It will install the modified version of 3.3.1 for you.

If you want to do it manually, then follow these instructions:

If you have root, uninstall the current Maps app.

adb:
Code:
adb remount
adb shell find /system /data -name \*google\*maps.apk\* -o -name Maps.apk -delete
adb uninstall com.google.android.apps.maps

shell:
Code:
mount -o remount,rw /system
find /system /data -name \*google\*maps.apk\* -o -name Maps.apk -delete
pm uninstall com.google.android.apps.maps

Next, regardless of whether you have root, install the SpeechSynthesis Data. You can do this either by going into the market and searching "SpeechSynthesis Data Installer", or on some ROM's, like CM 4.2.7.1, Menu -> Settings -> Speech synthesis -> Install voice data

If you have root, download http://ul.to/1ofshq/maps4.0.0-brut4.apk (4.0.0)
If you do not have root, download http://ul.to/6w7e8n/maps4.0.0-brut4-alt.apk (4.0.0)
These files were created by Brut.all, without whom we would not have Navigation outside the USA.

Install the new file that you downloaded:
adb install -r maps4.0.0-brut4.apk
or
adb install -r maps4.0.0-brut4-alt.apk

Edit 2: Broken again

Google has made some anticipated changes to block us from using Navigation outside the USA. It looks like Brut.all is going to be looking at the original proxy idea again. For now, you might as well upgrade to 3.3.0, as it does have some cool new features (and you can always revert if necessary). Stay tuned to the thread for more details.

Edit 1: Solution (NO LONGER WORKS)

Brut.all and TAPP got it working. Here are some more in-depth instructions for those of you having issues:

If you have root, uninstall the current Maps app.

adb:
Code:
adb remount
adb shell find /system /data -name \*google\*maps.apk\* -o -name Maps.apk -delete
adb uninstall com.google.android.apps.maps

shell:
Code:
mount -o remount,rw /system
find /system /data -name \*google\*maps.apk\* -o -name Maps.apk -delete
pm uninstall com.google.android.apps.maps

Next, regardless of whether you have root, install the SpeechSynthesis Data. You can do this either by going into the market and searching "SpeechSynthesis Data Installer", or on some ROM's, like CM 4.2.5, Menu -> Settings -> Speech synthesis -> Install voice data

If you have root, download http://ul.to/uwa3gp/Maps3.2.1-patched-root.apk or http://files.legendofbong.co.uk/download.php?file=534750032-Maps3.2.1-patched-root.apk
If you do not have root, download http://ul.to/18fckr/Maps3.2.1-patched-no-root.apk or http://files.legendofbong.co.uk/download.php?file=1240234753-Maps3.2.1-patched-no-root.apk
These files were created by Brut.all and TAPP, without whom we would not have Navigation outside the USA.

Install the new file:
adb install -r maps-root-aligned-apk
or
adb install -r maps-no-root-aligned-apk

Update: I made a simple launcher app called Nav Launcher that lets you easily navigate to a contact or any other destination by typing or speaking the name or address. Search the Market for "Nav Launcher", go to market://search?q=pname:com.madcowsolutions.NavLauncher on your device, or scan this QR code:
qrcode-s.png

Discuss this app at http://navlauncher.madcowsolutions.com

rac2030 made a similar application called NavStarter that you can download from http://www.2030.tk/link/navstarter

Reply to this thread if you have any issues.

Original Post

Now that we have Google Maps Navigation working on other devices, I thought the next logical step was to get it working outside the USA.

I noticed something very interesting.

I turned off cell/gps location services, then opened Maps, and plotted a route from Detroit to San Francisco. I got the Navigate option.

When I selected it, it prompted me to download the voice stuff, so I did. Then it told me to go into settings to enable GPS. When I did that, and came back, it popped up a dialog "No route found - Navigation to your destination is not available.".

HOWEVER, under this dialog is a Navigation view of my area. Which means it was able to download the necessary map data, but something is preventing it from retrieving or using a route.

Here's an example of this from the emulator, with the GPS set to be right in front of parliament in Ottawa:


It's possible that the route could be transmitted in the same format as normal directions in Maps, but that either:
a) The server is rejecting the request because it's coming from Navigation and has a Canadian endpoint, or
b) The application is discarding it because it has a Canadian endpoint.

If it's a), then we might be able to setup a proxy server (even a locally running server on the phone) to mask the signature of the request.
If it's b), then we might have to modify some of the Maps code.

But the fact that it can render the Navigation view of Ottawa, Ontario, Canada means that it is downloading the appropriate map data, so that's a great start for getting Navigation to work outside the United States. We just need to find a way to tell it that it is allowed to work.

I made some Wireshark captures of a successful route being generated, as well as one that failed because it's in Canada, but the transmitted data isn't textual for the most part, and I don't know how it's encoded.

One interesting thing to note is that in my Wireshark captures, Navigation uses "DriveAbout" in all of its requests to the server, whereas regular driving directions uses "GMM" in the same spot.

I'm going to see if I can setup a simple proxy to forward requests, replacing "DriveAbout" with "GMM" to see if that gets us any further.

Hopefully some other people can help with this so that everyone, everywhere, can enjoy Google Maps Navigation.
 
Last edited:

skyred

Member
Sep 11, 2007
14
0
New York
I installed the Nav, then Google Voice stopped working, no matter how many times I uninstalled GV and re-installed it. Also, I rm -r /cache/*.apk. but GV keeps saying Downloading.... Then I flushed the old build.prop and build.trout.prop back, and reboot. and both Nav and GV are working.
 

AlexandrUa

Member
Aug 6, 2009
10
0
Ukraine, Kyiv
Interesting

It's interesting. I couldn't start navigation at all - I think it because of my location (Ukraine) - but some Motorola Droid apps was installed without any problems.
 

canadiancow

Senior Member
Feb 15, 2008
472
3
San Francisco
It's interesting. I couldn't start navigation at all - I think it because of my location (Ukraine) - but some Motorola Droid apps was installed without any problems.

If you've installed it properly, and you enter two US locations as the endpoints, you should get the Navigate option.

If you use "My Location" as the start point, you won't get the navigate option unless you're in the USA.
 

xdowner18

New member
Nov 11, 2009
4
0
i think it depends on the map licence. e.g. in germany google maps use another provider for the map data. thats the reason why google just allow navigation in us. i think it must be possible to change that.
 

crypticc

Senior Member
Aug 22, 2009
1,248
171
London
Couple of weeks ago google terminated their licence with european maps provider teleatlas because or related to that licence not allowing turn-by-turn. Is that relevant? Was on financial mkt news.
 

theomajigga

Senior Member
Sep 26, 2009
263
6
Hudson, WI
Just an idea

what I would do, is get a map route in the US with WiFi, use wireshark to see where/who it's talking to to see if its getting the directions from an online server...

If not, it would be internal then

Like i said, just an idea.
 

canadiancow

Senior Member
Feb 15, 2008
472
3
San Francisco
what I would do, is get a map route in the US with WiFi, use wireshark to see where/who it's talking to to see if its getting the directions from an online server...

If not, it would be internal then

Like i said, just an idea.

I've already used Wireshark, and it's talking to a Google server. However, the exchange looks a lot like normal driving directions, except with the identifier "DriveAbout" instead of "GMM".

I'm working on routing all connections to this server through a proxy so that I can replace "DriveAbout" with "GMM", to see if that will make it work.
 

jezzaaaa

Senior Member
Nov 11, 2009
76
9
I've already used Wireshark, and it's talking to a Google server. However, the exchange looks a lot like normal driving directions, except with the identifier "DriveAbout" instead of "GMM".

I'm working on routing all connections to this server through a proxy so that I can replace "DriveAbout" with "GMM", to see if that will make it work.

Nice work Mr Cow. :)

I get the same behaviour here in Oz where it gives me a nav map of where I am before pasting over it with a "nuh-ah, can't do that" message.

Something else to get it to start navigating without having to pick two locations in the US is to create a desktop shortcut to "Directions", select a location/contact, and ensure that "turn-by-turn navigation" is selected. Then when the shortcut is launched, a navigation splash screen loads, it says "getting driving directions" while showing my local map in the background, and then says "Navigation to your destination is not available."

In flight mode it tries to get directions for about 10 seconds, then speaks to me for the first time ever, saying "data connection lost".
 

jezzaaaa

Senior Member
Nov 11, 2009
76
9
Has anyone used the "mock location" setting? It might help with testing, if we can quickly switch into and out of US locations. I've done no dev, so I don't know how it works, but I read that it's possible to use XML files to specify a virtual location path. Might be a waste of time.

CCow: just for my interest, what do you think you might find with your proxy protocol hacks?
 

canadiancow

Senior Member
Feb 15, 2008
472
3
San Francisco
Has anyone used the "mock location" setting? It might help with testing, if we can quickly switch into and out of US locations. I've done no dev, so I don't know how it works, but I read that it's possible to use XML files to specify a virtual location path. Might be a waste of time.

CCow: just for my interest, what do you think you might find with your proxy protocol hacks?

I'm doing most of my testing with an emulator, so I can send GPS "fixes" very easily.

When Google Maps Mobile contacts the Google server for directions, it reports itself as "GMM". The server returns a full set of directions, and it displays them.

When Google Maps Navigation contacts the Google server for directions, it reports itself as "DriveAbout". The server sends some data back, but not nearly as much when you're outside the USA.

I'm setting up a proxy so that whenever it contacts the server as "DriveAbout", the proxy will replace that with "GMM", so that the server will return the full set of directions.

If this works, it will still be a bit of a challenge to do this on the phone, but if I can get the emulator navigating in Canada, it's a great start.
 

jezzaaaa

Senior Member
Nov 11, 2009
76
9
Lots of others have complained that the new nav option goes away after up to 8 hours. Mine has stayed with me for just over 8 hours now. Any non-US users lost the nav option? Perhaps it's got something to do with using it.
 

canadiancow

Senior Member
Feb 15, 2008
472
3
San Francisco
I'm having issues getting Maps to work at all through a proxy with the emulator. The browser is going through my proxy alright, but Maps sends one request, and then hangs.
 

jezzaaaa

Senior Member
Nov 11, 2009
76
9
I'm having issues getting Maps to work at all through a proxy with the emulator. The browser is going through my proxy alright, but Maps sends one request, and then hangs.

Is it a transparent proxy, or are you somehow configuring Android to use a proxy?

As you can probably guess, I don't have a lot of dev experience with Android, but I do have lots of experience with proxies.
 

Skythe

Member
Jul 26, 2009
20
0
Well, I'm in Australia. I haven't been able to see the navigate option at all, although i did restore the original build.prop files and reboot. I have a dev phone; tried setting the locale to US with no joy. I'll be paying a close eye to this thread, and of course if anybody wants me to try anything i am more than willing.

Part of me suspects that Navigate might not even be technically possible outside of the US, until google changes something. There could be some navigate-specific data that is only currently available for US that is preventing it from even being able to work elsewhere.

.. I hope not though. I want navigate :)!

Edit: Some Research:\
http://googlemobile.blogspot.com/2009/10/announcing-google-maps-navigation-for.html

The first phone to have Google Maps Navigation and Android 2.0 is the Droid from Verizon. Google Maps Navigation is initially available in the United States. And like other Google Maps features, Navigation is free.

(This does offer me some relief, i've had a bad feeling that it might be droid-only. I want it for my Dev Phone!)
 
Last edited:

rac2030

Senior Member
Jun 9, 2007
213
3
www.2030.tk
I hope that it is the same data and I think it possibly is...
Navigation works outside of US but with the Limitation that you have to click manually but in fact they are turn by turn instructions.
Because of that, it should somehow be possible to make it work and the point with modifying the packets seems interesting.

I don't know iptables that much but it has the option "-t mangle"... can this be used somehow?