yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] rac2030:
but Google want's maps for all and not just for UK ;-)

Ok, they have different data sources for different regions.

And yes, in some regions OSM data is more accurate then navigon or teleatlas data because of the cooperation between governments and OSM mappers.

Like in Germany some citys that own the rights for their street maps including building plans have given them to the OSM team and if you go for example to Berlin you can see some regions of Berlin with perfect maps including all buildings with correct shapes.

But this is another topic and not meant for this thread.
[G1 Android Development] fl4r3:
I get the exact same problem....although Im using the command under superuser and hence the 'pm uninstall method'...but always says Failure.

I've got the debugging mode and 'allow unknown sources' checked too so am really confused :confused:

Im using a Hero btw....don't know if this will make a difference as the uninstall process should be the same! Some help would be appreciated...
[G1 Android Development] rac2030:
The name of the apk shouldn't mather, you could name it bull****.apk and it should still install correctly, on the phone the apk gets the name of the package taken from AndroidManifest.xml inside the apk
[G1 Android Development] Xpire:
He means uninstalling it, not installing it
[G1 Android Development] spacestation:
Think it might have something to do with me attempting to update maps from the Market first (unable to because of a package signing wrong error).

After trying that, maps wasn't listed as installed anymore. Also tried "find" instead of uninstall and it said the package didn't exist. I moved on and hit a new error when attemping to install the new maps

pm install -r maps-root-aligned-apk

comes back with an error about not having enough space
[G1 Android Development] spacestation:
Annnnd this is probably why i'm getting that error. Because the

adb uninstall com.google.android.apps.maps

give me an error as well

EDIT: I checked in Dev Tools in the package browser for com.google.android.apps.maps and wasn't able to locate it, or anything that even resembles google maps. Which is probably why I'm getting the failure message when attempting to remove a package at by that name.

"Google Maps" however is still appearing in the Application manager, and still functions when I use it. So I'm stuck as to how to clear it off my phone. I guess I should also mention that I have my apps installed in the phone memory, and not to SD card (if that makes a difference.)
[G1 Android Development] Brut.all:
No, I was working on a technique for repackaging apks without much binary differences. It is possible, but I didn't take into account one thing:

$ baksmali classes.dex
$ smali out
$ bsdiff classes.dex out.dex o.bsdiff
$ du -h o.bsdiff
120K	o.bsdiff

:-)

Maybe some switches, but I doubt it.
[G1 Android Development] smartwild:
I get failed too when trying on the magic/sapphire
[G1 Android Development] Wysie:
I also got uninstall failure, but was able to install it anyway :D.
[G1 Android Development] adamw156:
try this

In terminal try

Su

Pm uninstall com.google.android.apps.maps

This worked for me
[G1 Android Development] Brut.all:
Hmm... I did it second time and files are identical... :-/ Nevermind, apparently I made a mistake.
[G1 Android Development] realmadrid_cf:
Unfortunately this does not work in Vietnam. Maps show up but the navigation does not find a route. Not surprising since Google maps on the web will not give routes in Vietnam either. Anyone know a Navigation program for the G1 that does work in Vietnam?
[G1 Android Development] beejizzle:
I got this error when i tried to install the patched maps for root.

Maps3.2.1-patched-root.apk

Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]
[G1 Android Development] spacestation:
Pm uninstall com.google.android.apps.maps worked!

I can't remember if i typed that specifically earlier, or if I had just spelled something wrong...

I was still getting a failure message when attempting to install the package through the terminal, so I installed it via the package manager instead... just thought I'd give it a shot. And it worked!

Sweet, sweet Google Nav. About time.
[G1 Android Development] Brut.all:
No, I hadn't mistaken. On second time I accidentally resmalled already resmalled classes.dex file, so both files was built by smali. Unfortunately smali generates much different dex files than dx and it is not surprising.

After patching classes.dex we will need only zip and zipalign (optional) tools working on a device - jarsigner is not necessary, we could work around it. So we could:

- use ~120K bsdiff patch, but it wouldn't be a "we don't package proprietary GM code" patch

- find a way to patch a dex file without resmalling

- resmali it on a device :-/
[G1 Android Development] 3Shirts:
I had a similar error (mine was inconsistent version), just adb reboot after the uninstall and then install when the phone comes back up. Worked for me, though your error is not exactly the same as mine was
[G1 Android Development] rac2030:
"we don't package proprietary GM code" patch is that, what I want to avoid...

Patching a dexfile without resmali... won't be that easy I think

Doing it on client side.. seems to be a valuable option as the time /energy consuming part just happens once it's not that bad

How would you go around the signing process?

Haven't tried to build smali for Android, have you tried?
[G1 Android Development] Brut.all:
Signing is just a process of generating signatures for every file in a apk and storing it in META-INF directory. So if we know, what we will have after patching maps (and we know it), we could "prebuilt" META-INF files and package them in a patcher app. When patching maps on a device, we will only need to overwrite original META-INF directory by that prebuilt by ourself and that's it - apk will be signed by our keys :-)

I'm just working on it. It is in Java, so it shouldn't be much problem.

Unfortunately smali + baksmali = ~5MB. I think the best, what we can do, is:

- dex (bak)smali and host them somewhere

- when patching patcher app will download dexed libs to sdcard and load them up at runtime
[G1 Android Development] rac2030:
Good idea, maybe we create a project on sf or googlecode and host the files there... A patching app for android would be cool even for other purposes like theming to avoid distributing proprietary code and just patch the icons in.
[G1 Android Development] dopee:
I had the same problem, but when I disabled sound in the navigation app itself it kept working though now I don't have spoken directions...

Anyone have an idea how to enable speech without constant force closes. I have a dutch G1 non-rooted running stock 1.6
[G1 Android Development] Skythe:
YESSSSSSS!

Thank you so much to Brut.all and TAPP (as well as canadiancow for starting the thread), now have it working in Australia :)
[G1 Android Development] canadiancow:
Brut.all and rac2030, it would be extremely useful for you to add something to the patched version that can be easily detected.

For example, if you added an activity named "ModifiedMaps", I could call startActivity() using that name. If it exists, that Activity could simply forward the call to the real Navigation Activity. If it doesn't, it would throw an Exception that I could catch, and then perform the patch.

Even if we don't get the patch working, it would be a really useful way to determine if the modified version of Navigation is installed.
[G1 Android Development] Brut.all:
I have just run baksmali on an emulator :-) Android is awesome, that was so simple :-)

But... it took about 20 minutes and then process silently closes. ~60% of Maps3.2.1.apk files was disassembled.

Maybe I screwed up something, but this was simple as running one of methods. I think we should forget about this solution :-/

Yes, I have written about this earlier:
[G1 Android Development] canadiancow:
Sure. Whatever works :)

Ideally, I'd want to detect two things:

1) Is Navigation installed?

2) Will it work outside the United States?

I haven't spent much time on this, but right now the way I'm detecting if it's installed is to launch it. It would be more useful to be able to detect it without launching it.
[G1 Android Development] Brut.all:
Hmm... on a ADP1 it took 17 mins and I get exactly the same files, as on emulator. So that was some kind of success process end, but there are still missing files :-/

I will look through dexlib API, maybe it is possible to add files to *.dex, so we could (dis)assemble only these files, which we need.
[G1 Android Development] shagrath78:
This is working fine here, many thanks... But what about legal repercussions ? I mean, using this is clearly a breach in the Google maps TOS in the rest of the world. Maybe even providers such TeleAtlas could attack Google for letting users access worldwide mapping datas ? (cause I think their money deals don't include turn by turn)
[G1 Android Development] canadiancow:
I'm not a lawyer, but the way I see it, if we get the patch process working, then we aren't doing anything illegal. However, Google could be breaching their contracts with map providers.
[G1 Android Development] coredalae:
If you write an app that 'hacks' google maps to be used outside the vs its esentially the end user doing the hacking (same as with cyanogens g apps stuff) though they might want it removed from market. But i think they'll only do that if the map companies complain, cause its good for them as it is atm (they get to 'not' provide turn by turn. And still have the publicity of actually providing it ;)

But i'm no lawyer and only have a little knowledge on this.
[G1 Android Development] rac2030:
I'm also not a lawyer but that's one reason I don't want to distribute maps itself, but giving the user the possibility (or better the tools) that they can patch there own maps application.

Of course, this is a dark gray zone but in the end it should be the user who does it with his own "copy" of maps.

If we find a good way to patch apk's and stay legal, such an patching app could also come handy for other stuff like theming / personalizing an app.

But the only way I see at the moment of doing this would be packaging an app with (bak)smali, a ziptool (optionally zipalign) and if possible an signing app that can sign the resulting apk's and of course an app that automates the disassembly, patching, assembly, zip, sign, zipalign and install stuff.
[G1 Android Development] coredalae:
you should contact Stericson, hes working on an app (metamortph) that changes apk's while the phone is running for theming purposes (also zipaligns etc)

maybe his way of opening/closing apk's could also work for this patch?
[G1 Android Development] adamw156:
Can anybody help me with this I did the things in first post through terminal (pm uninstall com.google.android.apps.maps) I got failure. I tried installing it and it says cannot be installed on this phone. I am currently using cm 4.2.5 any help will be appreciated thanks adam
[G1 Android Development] Brut.all:
This is how I see this:

http://code.google.com/p/android-omnipatcher/

:-)

Hmm... I'll search forum/Google for this.
[G1 Android Development] goatmonkey:
I love you guys!

Oh, and this way worked for me:

adb remount
adb shell find /system /data -name \*google\*maps.apk\* -o -name Maps.apk "|" xargs rm
adb uninstall com.google.android.apps.maps

Then install apk from SD using EOE App Installer.
[G1 Android Development] pmp.s:
can u plz tell me did u do the adb shell on the pc or su emulator? thanks
[G1 Android Development] goatmonkey:
adb was from the PC
[G1 Android Development] pmp.s:
it work i used apk installer :)
[G1 Android Development] rac2030:
Did found it yesterday, he hasn't uploaded this code to github and it's still early alpha.

http://relentlessaddictions.com/android/

and here is the XDA thread: http://xdaforums.com/showthread.php?t=574556

About omnipatcher, description looks good but it will be a huge project.

I have to take a closer look to smali to see if we could rewrite (combine smali and baksmali) and make something like patching on the fly so not the hole parsing (or is it the lexing stuff?) has to be done (don't hope that I can do this but I will try, I just had some theory about compiler writing in school but never done it practically).

EDIT: If I see it right, Stericson has compiled versions of zip and zipalign and metamorph really seems to be very similaire except that it's targetting theming and doesn't have the part with smali/baksmali and the patching inside.

But we should definitly get in contact with stericson for this.
[G1 Android Development] Cholera:
Hi there!

I have the same problem deinstalling maps on cyanogen 4.2.5 :(

Any solution?

THX!
[G1 Android Development] Brut.all:
Big, but not huge :-) And so far it was evolving very rapidly :-)

Beside of that it will be iterating project. First we need patcher with some of basic features. Minimalistic UI and configuration, libs and patches will be downloaded manually to SD. Then we will add some automation, new features and so on.

I did it already, this was really esay :-) And file is significantly smaller, because smali/baksmali are built with Maven and hence have doubled deps.

I don't understand... You mean (bak)smaling only needed files? It is possible, I checked it :-)

I though Java has native zip support?

And we should definitively move to another thread :-)
[G1 Android Development] CompactDstrxion:
Same problem cannot uninstall Maps on cyan 4.2.5 using Terminal Emulator and yes I have su'd and remounted /system!
[G1 Android Development] rac2030:
I hope you don't mind => http://xdaforums.com/showthread.php?p=5024266

The discussion about omnipatch can continue there
[G1 Android Development] Xpire:
OMG I love you, that worked!
[G1 Android Development] goatmonkey:
Also, navigation can be launched right from Google Maps by going Menu --> Directions --> Navigate

This... is... AWESOME!
[G1 Android Development] Brut.all:
:-)

Half of this thread is about this ;-)
[G1 Android Development] immyh:
Because you guys are so awesome. Google engineers must be sitting back and totally in respect of what you guys have achieved here it is something that we all thought was never possible. So we all are just so excited.
[G1 Android Development] josevtome:
PERFECT!!!!!!!!!!!! I'm in Spain and the Navigation is working just perfect with this! Thanks a lot!!! :D:D:D:D:D:D:D I can either chose initial and destination addresses, or just using the Navigation Launcher if I have the address stores in the address book... EXCELENT WORK!!
[G1 Android Development] HyeProfile:
I've tried the same thing using ConnectBot on CM 4.2.5, also su'd, and still not able to uninstall GMaps. Has anyone running CM4.2.5 been able to run the shell commands successfully?
[G1 Android Development] pdagenius:
Have been trying the same thing and also have the same problem? :confused:
[G1 Android Development] josevtome:
I have CM 4.2.5. Couldn't run the shell commands because couldn't find the "|" (jeje) so I used the adb and worked perfectly.
[G1 Android Development] pdagenius:
Am missing something somewhere. I have tried both procedures and get "Failure" after each one. Not sure what to try next? :confused:
[G1 Android Development] jezzaaaa:
I agree, and the map providers would be putting financial pressure on Google to close this hole.

In response, I don't think Google will go after the patched app or the patching app, or even bother with a C&D letter ($lawyers$). IMHO the most likely scenario if Google works out what we're (legally) doing, is that Google blocks turn-by-turn access on their servers for addresses outside the US. I can't see that this would be hard for them to do.

Then we'd be back to fudging the requests so they go to their "directions" URI instead of "navigation" URI.
[G1 Android Development] suffeks:
google made the "outside of US" check client side on purpose, cause they knew this would eventually happen. they will tell map providers they tried to "reasonably" protect against turn by turn navigation using their data. when in fact not so, and google is happy people are happy with their world wide free nav :)

if they really wanted to protect it, the check would be server side.
[G1 Android Development] jezzaaaa:
While I think they'd be happy that their nav is being used outside of the US, I don't believe they would consciously decide to make it possible. I would speculate that it has more to do with their contracts with the map makers of other countries. Let's say the contract has something along the lines of: "Google must not create an end-user product that provides mobile voice-guided navigation". This would be a stipulation on the Maps app, but does not apply to the servers. Google's published app complies with such a stipulation. The patched app is something that's out of Google's control.
[G1 Android Development] rac2030:
If you see the usage conditions of the google API for Navigation, it says (as far as I remember) clearly that it is allowed for Navigation use but not realtime Navigation because of the contracts with the map distributors.

And I think that was one of the main reasons why AndNav switched from google maps to OSM (v.1 to v.2)

The worst thing that can happen for us is, that google just decides to shutdown serverside requests with points out of US.
[G1 Android Development] bjtheone:
I have been pondering this one. I am not a lawyer (thank god) but I used to negotiate large licensing contracts for CAD tools and ASIC libraries and have spent far too much time with our corporate lawyers.

If it can be shown that Google knowing created an app that could be easily changed to allow this, or created conditions that allowed it, or did not take reasonable precautions to prevent the misuse of the licensed map data, then they could be opening themselves up to a claim, especially since Google is the party that is serving up the licensed data.

If this only worked with rooted phones them I would be fairly comfortable that they were on more solid ground. However, given that it works with stock phones, by just loading another app, I would think they have some issues.

Having really deep pockets, a good legal team, and the map vendors wanting to have a continuing relationship also helps Google.

The other issue, is that the hacking community is only a small subset of Android handset users. Most phones are stock, with only apps directly from the market, and only do the things that the carriers want them to do. We likely are not a big enough blip for the Map vendors to get into a legal pissing contest with Google over. Especially since I suspect that Google is working on rolling out these services to a larger audience.
[G1 Android Development] djduong:
Works on the milestone! ;)

Hey guys, just wanted to give a quick shout out to all that made this happen! You rock!

I have a milestone running android 2.0 (yes, milestone :) ) and it's one of the prototypes, so it's unlocked and I'm on Rogers up here in the great white north. Just wanted to confirm that indeed the 3.2.1-patched-no-root apk worked flawlessly. Simply put it on an SD card, eoe installed and done. :)

Just another note, while I was down in the states, I was given a real droid (active on verizon, so with the real map nav. :)), there was this feature that doesn't seem to be present, and not sure it ever will with our hacks. But with the verizon droid, from the home screen, you could click on the mic. (voice search) and say "navigate to Disney World, florida" and if it found the location, it would take you right into to GM Nav. Curious what it would take to get that going :D

Anyways, great work guys! Canadiancow, where are you located? If you're close enough, I owe you a beer!
[G1 Android Development] Suepahfly:
I was having the same issue, what worked for me is *first* run

adb shell find /system /data -name \*google\*maps.apk\* -o -name Maps.apk "|" xargs rm

and *second*

adb uninstall com.google.android.apps.maps

After that just copy the patched maps apk on SD and install
[G1 Android Development] bolmedias:
Confirmed working on Eugene's Eclair ROM, simply followe these instructions:

adb remount

adb shell find /system /data -name \*google\*maps.apk\* -o -name Maps.apk "|" xargs rm

adb uninstall com.google.android.apps.maps

Then install the patched version of the ROM (which is in my case the rooted one) via Astro or similar.
[G1 Android Development] xenio2000:
I have a strange problem,

the 3.2.1 patched works until reboot, after a reboot the Navigate disapper and the latitude is not updating anymore... I am using TheOfficial Rom.

Anybody else have this problem? I don't know how to resolve it.

Thanks
[G1 Android Development] alou2:
Patched Maps app breaks other apps that use maps...

Hi there,

while installing and using the patched Maps app works fine on my G1 (thanks for that, Maps Nav is an awesome feature), it seems to break all other "Map using apps". For example, launching Glympse or Places Directory ends up in Force Close each time and sends me back to the home app... Anyone else having this ? :confused:

Another odd thing that happens is that on each reboot of my phone, it automagically reinstalls the old stock Maps app and I must reinstall the patched app to get Nav back (which to be fair is not a complicated process so it's no big deal...)
[G1 Android Development] alou2:
That's what I experience too. On reboot it reinstalls the stock Maps app, thus losing Nav and user data (like Latitude, you have to register again).
[G1 Android Development] rac2030:
I will work on that to get the layout that the widget from NavStarter can differentiate click on text box and click on voice search icon, this should bring then up voice search and you should be able to say "disney world, florida" and Navigation to there get's launched.

I will update NavStarter when this change is done but as many users want voice search to start directly from the widget... ;-)
[G1 Android Development] dph1987:
Non rooted users...

Any one no how to get rid of the old icon on a non rooted uk phone :( Or overwrite the newest update with the patched version?

Muchos respect to you developers, this is why iPhone sucks!
[G1 Android Development] canadiancow:
We're not using the API :p

I'm in Ottawa for another 3 weeks, then I'm heading to Waterloo.
[G1 Android Development] pdagenius:
Ok, have cracked it and it was worth the perseverance - it's ace! :) Am in the UK for reference to others wondering where I am.

For others struggling to get it to work, the 2 things I did different were to update to the latest SDK tools r3 (which has a revised ADB I presume, or the file size is different anyway) and to put a "space" in the adb shell command line between "/system" and "/data". I know it's supposed to be there now but on first inspection it wasn't obvious to me.

Anyway - whatever. Am happy. A very big thank you to canadiancow :)
[G1 Android Development] rac2030:
I just updated NavStarter so speak button on widget is now functional and starts speech recognition.

I also tested with saying "disney world florida" and it worked, just the "Navigate to" has to be left out.

I don't know if my widget works on the Milestone... would be nice if you could test it out and post if it works or not.

You can get it at http://www.2030.tk/link/navstarter
[G1 Android Development] xenio2000:
Lost navigation and latitude on reboot

Thanks to Enom, there is soon a solution for TheOfficial

this is the post: http://xdaforums.com/showpost.php?p=5031792&postcount=5056

I did not try it, I'll wait 1 or 2 days for the latest release.

Xenio
[G1 Android Development] rac2030:
I just tested short in the emulator with 2.0

There the widget doesn't do anything on click (it doesn't receive any signal) and contacts lookup doesn't work.

Else, all is working including Navigation ;-) (I installed non-root patched maps on emulator)
[G1 Android Development] djduong:
Works! (Still playing around with it, comparing to the built in voice search. Will give you more feedback as I play with it.)

Now, how to get your voice search to replace the one in the "Car Home" screen? :D

http://cache.gawker.com/assets/images/gizmodo/2009/10/IMG_0312.jpg