# [FIX - Confirmed] Aosp network location fix



## skinien

This is a fix for the network location bug on AOSP ROMs. The network location bug can be seen when you attempt to get a location without using WiFi or GPS (using carrier network only). While using only carrier network to obtain your location, your phone will think you're in another city, state, country, planet, galaxy, etc. You can test this by refreshing a weather widget after turning off GPS and Wifi.

Grab the NetworkLocation.apk from the link below and put it on the root of your sdcard. It's from the 2.11.605.3 Sense ROM.

*Using a file explorer like root explorer*:

- You must use the file explorer to mount /system/app as r/w.

1) Rename (or delete if you're brave) NetworkLocation.apk to NetworkLocation.bak from:
/system/app

2) Reboot.

3) Place a COPY of /sdcard/NetworkLocation.apk (from 2.11.605.3) in: 
/system/app

4) Change the permissions of /system/app/NetworkLocation.apk to:
rw-r--r--
Owner: read, write
Group: read
Others: read

5) Even though I placed the file in /system/app, I still had to "install" it. So, click on the NetworkLocation.apk on your SD Card and let it install.

6) Reboot.

*For those of you brave enough to use Terminal Emulator, I haven't tried these steps, but they should work:*

Open Terminal Emulator

$ su
# mount -o rw,remount -t ext4 /dev/block/mmcblk0p25 /system
# cd /system/app
# mv NetworkLocation.apk NetworkLocation.bak (or if you want to delete it use "rm" instead of "mv")

REBOOT

Open Terminal Emulator

$ su
# mount -o rw,remount -t ext4 /dev/block/mmcblk0p25 /system
# cp /sdcard/NetworkLocation.apk /system/app
# chmod 644 /system/app/NetworkLocation.apk

exit terminal

Click on /sdcard/NetworkLocation.apk to install.

REBOOT

Here's a link to the apk I used:
http://db.tt/U974Crfk

Let me know if this works for you! *crossing fingers*

Edit: tried to make steps a little more clear.

Thanks freehood4all - pointed out an error in the terminal commands.


----------



## miketoasty

Will let you know in T Minus 10 minutes.

Edit: Well 2 interesting things happened. First off it didn't work then second not even after enabling WiFi would it pick up on my location. So I don't know if I did something wrong or what but it did not work correctly for me.


----------



## skinien

miketoasty said:


> Will let you know in T Minus 10 minutes.


Shared a link to the .apk if it helps.


----------



## miketoasty

skinien said:


> Shared a link to the .apk if it helps.


Already had 2.11.605.3 on my phone (Like to try out all the OTA's just for the hell of it) but should help with other testers and may be that mine was corrupted.


----------



## skinien

miketoasty said:


> Will let you know in T Minus 10 minutes.
> 
> Edit: Well 2 interesting things happened. First off it didn't work then second not even after enabling WiFi would it pick up on my location. So I don't know if I did something wrong or what but it did not work correctly for me.


That's what happened to me until I installed the apk by clicking it. After installing it, I rebooted and everything worked.


----------



## bagoffreedom

I installed and rebooted but it didn't work. I'm on OMFGB 9-13 nightly.

Question. Did you install the apk in the system apps or the one from the sd card?


----------



## skinien

bagoffreedom said:


> I installed and rebooted but it didn't work. I'm on OMFGB 9-13 nightly.
> 
> Question. Did you install the apk in the system apps or the one from the ad card?


SD Card.

Damn, I hope I'm not forgetting a step. It seemed that just placing the .apk in system/app wasn't sufficient; I couldn't obtain a location. In fact, google.com in my browser didn't even give me the option to update my location. After I installed the .apk sitting on my SD Card, I rebooted and everything worked.


----------



## skinien

miketoasty said:


> Will let you know in T Minus 10 minutes.
> 
> Edit: Well 2 interesting things happened. First off it didn't work then second not even after enabling WiFi would it pick up on my location. So I don't know if I did something wrong or what but it did not work correctly for me.


Sorry dude, I'm betting you know how to restore the old .apk. I've edited the OP to instruct testers to rename the original .apk rather than deleting it.

Just in case, you can grab the CM .apk from the CM ROM sitting on your SD card.


----------



## gfro9191

OH MY GLOB, IT WORKED [:

Thanks!


----------



## miketoasty

Guys, this ACTUALLY works! For the first time I was able to pull my network location in the Network Location APP (From the market). Please if you are running try this and see if it works, because so far it has worked for 3 people. Use the link provided for the Network Location.apk

My Steps:

Delete Network Location.apk from /system/app

Reboot

Copy *New* Network Location.apk from /sdcard/download/ to /system/app

Change permissions to RW-/R--/R--

Go back to SD Card and install Network Location.apk *The new one*

Reboot

Not be in Africa!

*Running CM7 RC1.8, Stock Kernel*


----------



## Mustang302LX

miketoasty said:


> Guys, this ACTUALLY works! For the first time I was able to pull my network location in the Network Location APP (From the market). Please if you are running try this and see if it works, because so far it has worked for 3 people. Use the link provided for the Network Location.apk
> 
> My Steps:
> 
> Delete Network Location.apk from /system/app
> 
> Reboot
> 
> Copy *New* Network Location.apk from /sdcard/download/ to /system/app
> 
> Change permissions to RW-/R--/R--
> 
> Go back to SD Card and install Network Location.apk *The new one*
> 
> Reboot
> 
> Not be in Africa!
> 
> *Running CM7 RC1.8, Stock Kernel*


Doing now standby!!!


----------



## miketoasty

Mustang302LX said:


> Doing now standby!!!


God speed, Mustang!


----------



## Mustang302LX

miketoasty said:


> God speed, Mustang!


The Imoseyon 3.7.1 kernel makes me lose status bar sometimes so I'm having issues right now. Damn!

Gonna switch back to stock CM7 kernel and see how it goes. Will restart the process in a few.


----------



## johnfoam

This appears to work for me as well. Good find! Will test more and report back. Wonder what other files we should bull from the stock rom to make other features work better.


----------



## miketoasty

johnfoam said:


> This appears to work for me as well. Good find! Will test more and report back. Wonder what other files we should bull from the stock rom to make other features work better.


After this what else needs fixed? I know that Bluetooth is buggy as hell, but other than that I would say, everything, works. I don't know if you guys have other issues but this was literally the LAST issue I personally was having with AOSP.


----------



## Scooter

Wow this actually worked! Thank you so much!

Sent from my ADR6400L using RootzWiki Forums


----------



## feedhead

Working as intended ... finally
Nice find, thanks given

CM7 1.8
Imo 3.7.1 AOSP


----------



## skinien

Wow! I'm glad this thing may be fixed. Running CM 1.6.1 - this is the ONLY bug I have. Or should I say, HAD.


----------



## miketoasty

Just tried with IMO's latest kernel and all seems to still be working.


----------



## Mustang302LX

I think it's my theme causing it. Anyways I'm having all sorts of issues right now. Google.com has a blue dot next to my city finally so this works! But I can't download from the market and my SU won't update binary. Damn!

Edit: Market is good to go now but my SU keeps FCing now.


----------



## watson387

Applied the fix and BAM! Worked. Lol

Sent from my Liquid Thunderbread HTC Thunderbolt


----------



## thisismalhotra

Goto androidsu.com and download su 3.0 zip to flash in recovery

Sent from my ADR6400L using Tapatalk


----------



## asianrage

WOW! Works perfectly on AOSP BlackSourc3 !!


----------



## Mustang302LX

thisismalhotra said:


> Goto androidsu.com and download su 3.0 zip to flash in recovery
> 
> Sent from my ADR6400L using Tapatalk


Thanks!!! All fixed now. Sorry for hijacking the thread! AMAZING find this is awesome! So glad network location is fixed!


----------



## miketoasty

Network location was fixed, and there was much rejoicing.


----------



## skinien

miketoasty said:


> Network location was fixed, and there was much rejoicing.


Ha! I'm glad I'm not the only one excited about this!


----------



## miketoasty

Updated three times on my drive home. Got the correct location all three tries.


----------



## n0thng2bdone

there's already a book and a movie based on this bug fix called _Out of Africa_


----------



## skinien

n0thng2bdone said:


> there's already a book and a movie based on this bug fix called _Out of Africa_


hahahaha! I expect royalties.


----------



## Mustang302LX

n0thng2bdone said:


> there's already a book and a movie based on this bug fix called _Out of Africa_


LMAO that's awesome!

Skinien did you inform Slayher and Xoomdev?


----------



## jimmydene84

Awesome job man!

Sent from my ADR6400L using Tapatalk


----------



## skinien

Mustang302LX said:


> LMAO that's awesome!
> 
> Skinien did you inform Slayher and Xoomdev?


Tweeted them both.


----------



## milkman dan

Toto, I have a feeling we aren't in Skinnskatteberg anymore 

Thank you so much!


----------



## kci

Confirmed, working for me as well... 
Awesome job!!!! This is why I come here, an awesome community geared to making our phones better for US!!!

Edit: I was normally in Shuitunzhen, China... Glad to be back in Iowa.


----------



## villae81

May I ask what is the network location use for?


----------



## skinien

villae81 said:


> May I ask what is the network location use for?


Getting a "coarse" location without the use of WiFi or GPS. It uses the cellular network to get an estimated location.


----------



## johndoe86x

Awesome! That'd be great to get out of India! (I'm craving a Burger!)

Sent from my Thunderbolt using Tapatalk


----------



## UAV online

Two questions:

1. How do I change permissions for /system/app/NetworkLocation.apk ?

2. Does it matter if I place the new NetworkLocation.apk on my SD card before deleting the old one and rebooting?

Thanks,
Steve


----------



## skinien

UAV online said:


> Two questions:
> 
> 1. How do I change permissions for /system/app/NetworkLocation.apk ?
> 
> 2. Does it matter if I place the new NetworkLocation.apk on my SD card before deleting the old one and rebooting?
> 
> Thanks,
> Steve


1) The easiest way is to use an app like RootExplorer (paid). I think there are free apps that do this too (ES File explorer). Or, you can open terminal emulator and do it the hard way. This should work:
Open Terminal Emulator

$ su
# mount -o rw,remount -t ext4 /dev/block/mtdblock3 /system
# cd /system/app
# mv NetworkLocation.apk NetworkLocation.bak (or if you want to delete it use "rm" instead of "mv")

REBOOT
Open Terminal Emulator

$ su
# mount -o rw,remount -t ext4 /dev/block/mtdblock3 /system
# cp <location of Sense NetworkLocation.apk> /system/app
# chmod 644 /system/app/NetworkLocation.apk
exit terminal

Click on NetworkLocation.apk to install.
Reboot

2) Nope.


----------



## UAV online

Thanks for the quick reply. I have ES File Explorer, and I just realized I had to enable Root Explorer under Root settings and enable Mount File System. It wasn't even allowing me to rename or delete NetworkLocation.apk, which is obvious to be now because that kind of operation requires SuperUser Permission. And now I see the Permissions under Properties. Thanks, skinien.. keeping my fingers crossed that this works as it has for others...

...

Edit: Wooohooo!! It worked. The weather is much nicer here in Los Angeles than in Estonia.

Many thanks, skinien! This bug was one of the few annoyances of CM7 (AOSP) that were holding me back from giving it a ringing endorsement. Now if we could just figure out how to unmute the mic when regular stereo headphones are plugged in, so I can use my car stereo as a speakerphone.


----------



## Jaben2

I can confirm this is working on Liquid 3.0. Just tried it and it finds me on weatherbug, beautiful widgets, and both network location apps I tried. 
Everything still seems to be working,
Thanks,


----------



## MikereDD

Im on latest OMFGB 9/29 this worked like a charm.
Thanx to OP


----------



## gfro9191

So, if Slayher doesn't fix this in the next release, could we just open the new .zip of CM7 and place this file in there?


----------



## lambda

Great job!


----------



## skinien

gfro9191 said:


> So, if Slayher doesn't fix this in the next release, could we just open the new .zip of CM7 and place this file in there?


Not sure. I just flashed 1.8 over 1.6.1. I only wiped cache and everything is still working.

Edit:

See miketoasty's reply below.


----------



## miketoasty

skinien said:


> Not sure. I can tell you that flashing without doing a data wipe preserves the fix. I just flashed 1.8 over 1.6.1. I only wiped cache and everything is still working. Looks like you only need to apply the fix if you wipe data.
> 
> I would definitely try your method if you plan on wiping data.


The only way to remove the fix is to format system or install a new ROM. These are the only 2 ways to delete anything in the system folder (Without doing it manually).

Also just placing it in the ZIP might work. I would definately recommend fixing permissions afterward just to be sure.


----------



## skinien

miketoasty said:


> The only way to remove the fix is to format system or install a new ROM. These are the only 2 ways to delete anything in the system folder (Without doing it manually).
> 
> Also just placing it in the ZIP might work. I would definately recommend fixing permissions afterward just to be sure.


Oops, yeah. It's if you format /system is where you'll lose the fix.


----------



## villae81

"skinien said:


> Getting a "coarse" location without the use of WiFi or GPS. It uses the cellular network to get an estimated location.


How do I test mine if it works?


----------



## skinien

villae81 said:


> How do I test mine if it works?


Turn GPS off
Turn WiFi off
Open your browser and go to www.google.com. If it asks you if the site can use your location, select yes. At the bottom of the page, you should see your location (city & state).


----------



## villae81

Cool tnx skinien. Can somebody post a screenshot on their permission please?


----------



## skinien

villae81 said:


> Cool tnx skinien. Can somebody post a screenshot on their permission please?


Not a screenshot but it should be:

rw-r--r--

It should basically match all of the other apps in /system/app.


----------



## mikeinrichmond

Working great here too, latest CM7 and imoseyon's kernel.. I liked being in London, it was nice, but I'm glad to be home in Virginia...LOL...Thanks!!


----------



## Mustang302LX

skinien said:


> Turn GPS off
> Turn WiFi off
> Open your browser and go to www.google.com. If it asks you if the site can use your location, select yes. At the bottom of the page, you should see your location (city & state).


Also important to note before it would show my location but with a grey bubble next to it because it loaded through wifi. If the bubble is blue it means its current and using your location whether it be network GPS or wifi.

Sent from my Thunderbolt running CyanogenMod 7 using the Tapatalk app.


----------



## Mustang302LX

skinien said:


> Not a screenshot but it should be:
> 
> rw-r--r--
> 
> It should basically match all of the other apps in /system/app.


Below.

Sent from my Thunderbolt running CyanogenMod 7 using the Tapatalk app.


----------



## villae81

"skinien said:


> Not a screenshot but it should be:
> 
> rw-r--r--
> 
> It should basically match all of the other apps in /system/app.


Oh okay thanks


----------



## skinien

mikeinrichmond said:


> Working great here too, latest CM7 and imoseyon's kernel.. I liked being in London, it was nice, but I'm glad to be home in Virginia...LOL...Thanks!!


You didn't like being called mikeinlondon?


----------



## AbsoluteZero

Everyone realizes that this is installing the package to /data/app right? That's what sideloading does. Anyway, just making sure people are aware of that. You can install the app from SD as directed then use TiBu (or something similar) to convert it to a /system app and rename from com.google.android.location or whatever it was to NetworkLocation.apk (after renaming the old one btw). You know, just in case you dont wan't two packages. 

Nice find though skinien. It won't be as easy as it seems to include that fix in roms built from source but I'm sure they'll figure it out.


----------



## skinien

Mustang302LX said:


> Also important to note before it would show my location but with a grey bubble next to it because it loaded through wifi. If the bubble is blue it means its current and using your location whether it be network GPS or wifi.
> 
> Sent from my Thunderbolt running CyanogenMod 7 using the Tapatalk app.


I _think_ the grey bubble means that it loaded it from cache, not wifi; it's the last known location.


----------



## Subliminal

Awesome! Thank you!


----------



## ridobe

Worked great. Thanks!

Sent from my omfgb Thunderbolt using RootzWiki Forums


----------



## skinien

AbsoluteZero said:


> Everyone realizes that this is installing the package to /data/app right? That's what sideloading does. Anyway, just making sure people are aware of that. You can install the app from SD as directed then use TiBu to convert it to a /system app and rename from com.google.android.location or whatever it was to NetworkLocation.apk (after renaming the old one btw). You know, just in case you dont wan't two packages.
> 
> Nice find though skinien. It won't be as easy as it seems to include that fix in roms built from source but I'm sure they'll figure it out.


Yes, there may be seem superfluous steps in the OP but that's what worked. For some reason, just putting the apk in /system/app didn't work, I had to side-load it as well. I'm not sure if JUST side-loading works. I just figured that since CM and Sense ROMs both place the .apk in /system/app, I should replace it to prevent issues.

My initial thought was that the Sense NetworkLocation.apk has changes to it so it can get network location from LTE and EHRPD.


----------



## mikeinrichmond

skinien said:


> You didn't like being called mikeinlondon?


Hahaha! It was interesting though watching Google Navigation try and route me over the Atlantic Ocean to my destination. :gasp:


----------



## miketoasty

"AbsoluteZero said:


> Everyone realizes that this is installing the package to /data/app right? That's what sideloading does. Anyway, just making sure people are aware of that. You can install the app from SD as directed then use TiBu to convert it to a /system app and rename from com.google.android.location or whatever it was to NetworkLocation.apk (after renaming the old one btw). You know, just in case you dont wan't two packages.
> 
> Nice find though skinien. It won't be as easy as it seems to include that fix in roms built from source but I'm sure they'll figure it out.


Just checked and it's not sideloaded on mine. Just saying.


----------



## AbsoluteZero

skinien said:


> Yeas, there may be seem superfluous steps in the OP but that's what worked. For some reason, just putting the apk in /system/app didn't work, I had to side-load it. I'm not sure if JUST side-loading works. I just figured that since CM and Sense ROMs both place the .apk in /system/app, I should replace it to prevent issues.


Yea, I'm not saying don't do what you said. I'm just saying there's no need to copy it over to /system/app if you use something like TiBu b/c converting to a system app does that for you. Then you just rename. Same thing you are doing essentially, you just don't have the second copy in /data.

And no, just sideloading doesn't work unless it or a copy of it is in /system/app.



miketoasty said:


> Just checked and it's not sideloaded on mine. Just saying.


If you installed from SD, it definitely is. Heck, regardless of where the apk was you installed, it should sideload it. If the app installer in android could install stuff to /system then rooting would be unneeded (well, not really...but anyway, it doesn't have RW perm for /system.)


----------



## skinien

AbsoluteZero said:


> Yea, I'm not saying don't do what you said. I'm just saying there's no need to copy it over to /system/app if you use something like TiBu b/c converting to a system app does that for you. Then you just rename. Same thing you are doing essentially, you just don't have the second copy in /data.
> 
> If you installed from SD, it definitely is. Heck, regardless of where the apk was you installed, it should sideload it. If the app installer in android could install stuff to /system then rooting would be unneeded.


I think it's listed as /data/app/com.google.android.location-1.apk.


----------



## brizey

Interesting. The reboot after delete thing is what I don't understand. I bet people have tried to sideload this before and failed because of that odd step. Can anyone explain what it does?


----------



## pmdied

This worked for me, first time using root explorer.


----------



## Mustang302LX

skinien said:


> I _think_ the grey bubble means that it loaded it from cache, not wifi; it's the last known location.


Yeah that's what I mean. I would get my location at home on wifi and when on 3G or 4G it would show my location with a grey bubble and it wouldn't update as I traveled. Now the bubble is blue and all is well where I am vs. Estonia lol. Ahhh how I will miss Estonia!



pmdied said:


> This worked for me, first time using root explorer.


Root Explorer is AWESOME! I don't think I could function without it on my device!!


----------



## ProgHouse

I just removed NetworkLocation.apk from gapps and replaces it with the one in the OP, flashed 1.8 and gapps, and all is well. I wiped data, cache, system, and dalvik before. I do that regardless, kinda anal about it.

Sent from my ADR6400L using Tapatalk


----------



## Jaxidian

Thanks for this find! I'm temporarily sticky'ing (stickying? stickiing? how the hell would you spell that?) this thread for a couple days to help other peeps find this until we start to see the fix bundled in ROMs or mods for the ROMs.

On a side note, I wonder if running "sync" as su from a terminal, then rebooting would keep you from having to "install" the apk after you copy it to /system/app. I still don't know what this "sync" command does, but it seems to randomly help with these sorts of things. 

*update*
And what do you know, I can't get the bug to affect me right now so I can't really tell if this fixes it for me or not. I guess I'll leave this "sync" idea out there for somebody else. This might slightly simplify the installation process. Also, I know the OMFGB folks have released a copy of GAPPS that bundles this fix in case somebody wants to use that as a way to install the fix.


----------



## Jaxidian

MikereDD said:


> Im on latest OMFGB 9/29 this worked like a charm.
> Thanx to OP


Quite a bit off topic... but "OMFGB 9/29"? I missed that...


----------



## nativi

This worked on the latest experimental OMFGB 9/29. Thanks.

via OMFGBolt


----------



## bagoffreedom

nativi said:


> This worked on the latest experimental OMFGB 9/29. Thanks.
> 
> via OMFGBolt


Where did you happen to pick up OMFGB 9/29 experimental at?


----------



## nativi

bagoffreedom said:


> Where did you happen to pick up OMFGB 9/29 experimental at?


Post 2764 i think. Page 276.
Also from what i gather from r2 there's going to be an update tonight

via OMFGBolt


----------



## bagoffreedom

nativi said:


> Post 2764 i think. Page 276
> 
> via OMFGBolt


Thanks man


----------



## freehood4all

Jaxidian said:


> Thanks for this find! I'm temporarily sticky'ing (stickying? stickiing? how the hell would you spell that?) this thread for a couple days to help other peeps find this until we start to see the fix bundled in ROMs or mods for the ROMs.
> 
> On a side note, I wonder if running "sync" as su from a terminal, then rebooting would keep you from having to "install" the apk after you copy it to /system/app. I still don't know what this "sync" command does, but it seems to randomly help with these sorts of things.
> 
> *update*
> And what do you know, I can't get the bug to affect me right now so I can't really tell if this fixes it for me or not. I guess I'll leave this "sync" idea out there for somebody else. This might slightly simplify the installation process. Also, I know the OMFGB folks have released a copy of GAPPS that bundles this fix in case somebody wants to use that as a way to install the fix.


What sync does is makes sure all I/O is written to disk before remounting the filesystem.



skinien said:


> Open Terminal Emulator
> 
> $ su
> # mount -o rw,remount -t ext4 /dev/block/mtdblock3 /system
> # cp /sdcard/NetworkLocation.apk /system/app
> # chmod 644 /system/app/NetworkLocation.apk


The mount line is wrong! This is an emmc device not mtd...

Update original post with

$ su
# mount -o rw,remount -t ext4 /dev/block/mmcblk0p25 /system
# cp /sdcard/NetworkLocation.apk /system/app
# chmod 644 /system/app/NetworkLocation.apk

for future refference on an emmc device use:
cat /proc/emmc
dev: size erasesize name
mmcblk0p17: 00040000 00000200 "misc"
mmcblk0p21: 0087f400 00000200 "recovery"
mmcblk0p22: 00400000 00000200 "boot"
mmcblk0p25: 35dffe00 00000200 "system"
mmcblk0p28: 001ffe00 00000200 "local"
mmcblk0p27: 1b4ffc00 00000200 "cache"
mmcblk0p26: a7c00000 00000200 "userdata"
mmcblk0p29: 014bfe00 00000200 "devlog"
mmcblk0p30: 00040000 00000200 "pdata"

And like wise on mtd device:
"cat /proc/mtd"

Thanks for finding this, if it does indeed fix location. Looking forward to testing it out!


----------



## Breezer23

Thank you so much! You rock!!


----------



## Jaxidian

freehood4all said:


> What sync does is makes sure all I/O is written to disk before remounting the filesystem.


Thanks for the quick lesson.


----------



## tv31284

Thanks for the great find. Works great.


----------



## JuggalotusHeat

I would go back to AOSP if NFL Mobile worked...arggghhh!!!!


----------



## Bxrider117

This is the 1st time I have put an AOSP rom on the Tbolt. I really like it. This fixed helped with my network recogition for GPS. Now we need a NFL football app fix.


----------



## freehood4all

skinien said:


> Thanks freehood4all - pointed out an error in the terminal commands.


No, Thank You Sir!


----------



## Haydenpup

Thanks Skinien! Nice work!


----------



## ruinsofzach

it works ! running cm7 rc 1.7. Skinien, you're awesome! thanks!


----------



## jimnutt

All you actually need in the mount command is: "mount -o rw,remount /system"

It'll pick up the rest from the existing mount.


----------



## Shawn

Merci Beaucoup! It was a pleasant 81 degrees in Paris today according to my network location using Beautiful Widgets. I did a clean install / wipe / system format of cm7 1.8. I installed only root explorer and beautiful widgets and did not use maps or wifi. After doing the fix the location is perfect (c'est la vie)! Great job and for me, the only hangup with the AOSP Roms on the Thunderbolt is gone.


----------



## The Stick

Wow, this worked great! Thanks so much, skinien! It's SO NICE to finally have my weather widget display my real location instead of Suresnes, France!


----------



## pimfram

So great to no longer get the weather for France. Thank you very much.


----------



## Mustang302LX

Nevermind. 

Sent from my Thunderbolt running CyanogenMod 7 using the Tapatalk app.


----------



## Adrynalyne

So I was looking at why this worked (mostly because vinylfreak was bugging me ).

The google apps networklocation.apk is looking in the wrong place in our framework.jar. It is looking for code that we don't have (in that location) 



Code:


 invoke-static {v1}, Lcom/google/android/location/CellState;->getRadioType(Landroid/telephony/TelephonyManager;)I

CellState does not eixst in that location.

Out NetworkLocation.apk is unique to us, I'm sure.


----------



## stearic

Haha, figures it would be unique to our phone. Just another hurdle for us to go through to get this at 100% (ish).


----------



## lortay78

So, can I just add this network location .apk to the gapps .zip and flash it? I am going to try that out I think.

-Edit_ Seems to be working great so far. I added the network.apk and the new Gtalk.apk into the 8/28 gapps and all seems well.


----------



## Adrynalyne

lortay78 said:


> So, can I just add this network location .apk to the gapps .zip and flash it? I am going to try that out I think.


Yeppers.


----------



## rufflez2010

Worked like a champ! Thanks... now I can use foursquare to checkin at work :/

Edit: I was supposedly smack dab in the middle of India. I know both Miami and India are warm climates... but I prefer A/C


----------



## madzozs

So I have tried this 3 times today. I'm still in Estonia. I have followed the directions word for word. Not sure what is going on. Just for clarification.

Downloaded file and put it on my sdcard.
Renamed the file under system/app, then rebooted.
Copied file from card to system/app and set permissions.
Went back to my card and installed the .apk then rebooted.
Checked goggle.com and i'm in Estonia.


----------



## eris72

this works amazingly but I keep getting major battery drain from Maps after doing this trick. anyone else getting the same?

on latest cm7, using tiamat 1.1.3

okay Maps and Movies (flixter app) both say gps ran for 15m for each. gps has not been on today.


----------



## Mustang302LX

madzozs said:


> So I have tried this 3 times today. I'm still in Estonia. I have followed the directions word for word. Not sure what is going on. Just for clarification.
> 
> Downloaded file and put it on my sdcard.
> Renamed the file under system/app, then rebooted.
> Copied file from card to system/app and set permissions.
> Went back to my card and installed the .apk then rebooted.
> Checked goggle.com and i'm in Estonia.


On Google.com next to Estonia is there a blue or grey dot? Try holding down on update and it will open a new window of Google.com. see if that fixes it.

Sent from my Thunderbolt running CyanogenMod 7 using the Tapatalk app.


----------



## madzozs

Mustang302LX said:


> On Google.com next to Estonia is there a blue or grey dot? Try holding down on update and it will open a new window of Google.com. see if that fixes it.
> 
> Sent from my Thunderbolt running CyanogenMod 7 using the Tapatalk app.


Blue dot. I turn on wifi and it shows me in Cohoes with a blue dot.

Now I check it and it's showing me in Cohoes. Rebooted without wifi on and it's working properly. Checked Google+ "Nearby" and its showing apprpriately.

I don't know why or how, but it's working now.
Thanks


----------



## noisufnoc

I didn't need this for CM7.1.1 on my tbolt, Network Location app found me just fine.

Thanks for helping out those who did need the fix


----------



## Mustang302LX

madzozs said:


> Blue dot. I turn on wifi and it shows me in Cohoes with a blue dot.
> 
> Now I check it and it's showing me in Cohoes. Rebooted without wifi on and it's working properly. Checked Google+ "Nearby" and its showing apprpriately.
> 
> I don't know why or how, but it's working now.
> Thanks


Well glad it's working now. Screw Estonia and their weather lol! That's where my phone always showed me as well.


----------



## cm22

Yay!! My phone finally has stopped travelling the world!! I really could care less about the weather in Paris or random African Villages, or Indonesia! lol

Thank You!!! :grin:


----------



## trombone dixie

Without WiFi on Google maps shows me being about a half block away from where I am. At least it's not showing me in Stockholm anymore.


----------



## thepolishguy

Thank you. I finally gave up on cm7 bc of this issue. You have discovered a fix. I am glad to be back home. thanks again.


----------



## shadowpunx

Is navigation supposed to work with this?

All I get is searching for GPS....
You should have killed me, when you had the chance


----------



## watson387

shadowpunx said:


> Is navigation supposed to work with this?
> 
> All I get is searching for GPS....
> You should have killed me, when you had the chance


My navigation works.

Sent from my Liquid Thunderbread HTC Thunderbolt


----------



## cm22

shadowpunx said:


> Is navigation supposed to work with this?
> 
> All I get is searching for GPS....
> You should have killed me, when you had the chance


This only will fix the network location issue, to do things like tell you the weather in the area you are in without having gps turned on. If your having a GPS/Nav issue this wont fix it. I know this might not be too helpful, but running CM7.1.1 i am getting instant and accurate GPS locks. Have you tried wiping everything and reflashing cm7.1.1? It might work. Good Luck.


----------



## shadowpunx

Yes tried wiping countless times, tried the keep GPS on in sense and then flash cm7, but just won't unfortunately a deal breaker for me...back to bamf
You should have killed me, when you had the chance


----------



## cm22

"shadowpunx said:


> Yes tried wiping countless times, tried the keep GPS on in sense and then flash cm7, but just won't unfortunately a deal breaker for me...back to bamf
> You should have killed me, when you had the chance


Have you flashed the newest radios?


----------



## Markstamp

Testing now.


----------



## Markstamp

Markstamp said:


> Testing now.


Worked like a charm!!!!!!!!! Thanks!!


----------



## ryanpitt

Working great so far! Thanks OP.


----------



## Walter White

Working for me as well!! Thanks!!


----------



## dd0yl3

I need help. I did all the steps but when it comes to installing the one on the sd card it keeps telling me that app is not installed, am I doing something wrong or did i forget something?


----------



## cm22

"dd0yl3 said:


> I need help. I did all the steps but when it comes to installing the one on the sd card it keeps telling me that app is not installed, am I doing something wrong or did i forget something?


When I did it I installed the one I had to change permissions on.


----------



## dd0yl3

I tried that one as well. It wont install either of them.


----------



## cm22

"dd0yl3 said:


> I tried that one as well. It wont install either of them.


Are you using root explorer?


----------



## dd0yl3

I am using ES file explorer.


----------



## cm22

"dd0yl3 said:


> I am using ES file explorer.


Try root explorer. That's what I used and it worked like a charm, its in the market.


----------



## watson387

cm22 said:


> Try root explorer. That's what I used and it worked like a charm, its in the market.


+1 for root explorer. That's what I used too.

Drunk texted from my Thunderbreaded Bolt


----------



## doomedromance

totally forgot what thread i was in and posted off topic. delete.


----------



## drumstikka

Thank you so much, this is beautiful.


----------



## CC268

wait so this fixes navigation feature on maps? because my maps location works fine and it fairly spot on


----------



## luniz7

"CC268 said:


> wait so this fixes navigation feature on maps? because my maps location works fine and it fairly spot on


Spot on as in your exact address? Don't think so, but with this fix it is spot on.


----------



## skinien

CC268 said:


> wait so this fixes navigation feature on maps? because my maps location works fine and it fairly spot on


Added this to the OP. Hopefully, it clarifies...

This is a fix for the network location bug on AOSP ROMs. The network location bug can be seen when you attempt to get a location without using WiFi or GPS (using carrier network only). While using only carrier network to obtain your location, your phone will think you're in another city, state, country, planet, galaxy, etc. You can test this by refreshing a weather widget after turning off GPS and Wifi.


----------



## Omega

I am running CM 7.1.1 and using Root Explorer. I have renamed the networklocation.apk to .bak, rebooted, copied the new networklocation.apk to /system/apps and set permissions properly. I have also verified that the unknown sources box is checked in Settings>Applications. When I try to install networklocation.apk from Root Explorer, the application FCs on me. Any pointers?


----------



## skinien

Omega said:


> I am running CM 7.1.1 and using Root Explorer. I have renamed the networklocation.apk to .bak, rebooted, copied the new networklocation.apk to /system/apps and set permissions properly. I have also verified that the unknown sources box is checked in Settings>Applications. When I try to install networklocation.apk from Root Explorer, the application FCs on me. Any pointers?


Where is the file when you try to click on it to install? I clicked on the file that existed in /sdcard (not /system/app).

Try:
Reboot (again), click the file on your sdcard.

If that doesn't work, I'd try the entire process over again. Good luck!


----------



## Joshjunior

no clue what i'm doing wrong but i cant get it to work for me for the life of me. ive completely started from scratch twice lol. keeps putting me in brazil. i suppose i'll try the terminal method.

edit: go figure i did it the harder way with the terminal and it works..lol


----------



## Omega

skinien said:


> Where is the file when you try to click on it to install? I clicked on the file that existed in /sdcard (not /system/app).
> 
> Try:
> Reboot (again), click the file on your sdcard.
> 
> If that doesn't work, I'd try the entire process over again. Good luck!


I am clicking on the file in /sdcard. I also have rebooted already. I will try the process again. Thanks!


----------



## Omega

Still no joy. Am still getting a FC with root explorer while trying to install the apk


----------



## skinien

"Omega said:


> Still no joy. Am still getting a FC with root explorer while trying to install the apk


Try another file explorer?


----------



## turbonegro32

it wont let me rename the networkapk because its read only... any help with that?


----------



## cm22

"turbonegro32 said:


> it wont let me rename the networkapk because its read only... any help with that?


Click on top where it says mount r/w

Sent from my ADR6400L using RootzWiki Forums


----------



## timcampbell

Anybody know if the NEW network location fix..THIS ONE...is included in liquid 3.0??...or do we have to still do this?????


----------



## Jaxidian

Unsticking this thread. Again, big thanks to the OP for this!


----------



## skinien

Jaxidian said:


> Unsticking this thread. Again, big thanks to the OP for this!


Glad I was finally able to give _something_ back to the community.


----------



## fly_of_DEATH

I'm late to this party, I know, but I just did this and my Tbolt with CM7 no longer thinks I'm in Nairobi! Rock on!


----------



## Steve Mannix

Late to the party as well, but I can confirm this works (at least, for me).

Thanks to skinien and the others in the thread.


----------



## cm22

"Steve Mannix said:


> Late to the party as well, but I can confirm this works (at least, for me).
> 
> Thanks to skinien and the others in the thread.


It's still a great party!

Sent from my ADR6400L using RootzWiki Forums


----------



## wakeforsoul

Followed it, didn't work.

Then I wiped the data/cache of Network.apk from "manage applications", and so far so good.

Awesome post!


----------



## Ibrick

Anyone checked to see if the networklocation.apk from the newest 605.5 RUU is the same as the one posted here (605.3)?

*edit*

Just checked and apk is the same from 605.3 and 605.5

Sent from my cellular telephone


----------



## skinien

Ibrick said:


> Anyone checked to see if the networklocation.apk from the newest 605.5 RUU is the same as the one posted here (605.3)?
> 
> *edit*
> 
> Just checked and apk is the same from 605.3 and 605.5
> 
> Sent from my cellular telephone


No, I haven't updated the NetworkLocation.apk but don't see a reason to as it should be the same apk )


----------



## sk3litor

"Steve Mannix said:


> Late to the party as well, but I can confirm this works (at least, for me).
> 
> Thanks to skinien and the others in the thread.


I'm very late to the party but j can't even attempt these things as I'm still such a noob I have no idea what anyone is talking about. Ha ha ha guess ill just enjoy my vacation in Guam for now.


----------



## skinien

sk3litor said:


> I'm very late to the party but j can't even attempt these things as I'm still such a noob I have no idea what anyone is talking about. Ha ha ha guess ill just enjoy my vacation in Guam for now.


Just make a backup and give it a try. Worst case scenario your phone explodes.


----------



## JerseyDubbin

Followed instructions to a T and it's still saying accurate to within 1500 meters and is definitely off by at least that much. Should i try installing the old and reinstall the new again?

hmm wonder if this could be the GPS not starting issue, although i do see the icon in the status bar when i open maps.

WOOO Just started working i think it was actually something with my network connection (using 4g)

Thanks,
Phil


----------



## sk3litor

skinien said:


> Just make a backup and give it a try. Worst case scenario your phone explodes.


That's kinda my point I don't even understand what that means " system/app" or where to find it or anything like that and I don't want to clog up the thread with my wonderous ignorance so if someone wants to pm me and guide me through then cool, if not that's cool too. Guam is actually making leaps and bounds in progress of sewageO


----------



## TheTyler0013

sk3litor said:


> That's kinda my point I don't even understand what that means " system/app" or where to find it or anything like that and I don't want to clog up the thread with my wonderous ignorance so if someone wants to pm me and guide me through then cool, if not that's cool too. Guam is actually making leaps and bounds in progress of sewageO


Lol I live in Guam


----------



## sandman2211

A few weeks ago I tried installing the new NetworkLocation.apk linked to in the first post but it's not working for me. Install went fine - replaced the old one, set permissions, rebooted, all that. Now location services aren't working at all. Google Maps GPS is fine, but weather widgets and such don't work anymore, even the stock CM7 weather / clock app. Does anybody have any ideas? The original NetworkLocation.apk only worked correctly about half the time so I'm not going back to that.

I'm running CM7.1.1 and both RUU 2.11.605.3 radios right now. I was running older version radios (not sure which ones) but updating them didn't make any difference either way as far as network location services are concerned.


----------



## skinien

sandman2211 said:


> A few weeks ago I tried installing the new NetworkLocation.apk linked to in the first post but it's not working for me. Install went fine - replaced the old one, set permissions, rebooted, all that. Now location services aren't working at all. Google Maps GPS is fine, but weather widgets and such don't work anymore, even the stock CM7 weather / clock app. Does anybody have any ideas? The original NetworkLocation.apk only worked correctly about half the time so I'm not going back to that.
> 
> I'm running CM7.1.1 and both RUU 2.11.605.3 radios right now. I was running older version radios (not sure which ones) but updating them didn't make any difference either way as far as network location services are concerned.


Open your browser and go to www.google.com. At the bottom, does it give you a location? If so, is it blue or gray? Is there an "update" link? If so, is it blue or gray?


----------



## sandman2211

skinien said:


> Open your browser and go to www.google.com. At the bottom, does it give you a location? If so, is it blue or gray? Is there an "update" link? If so, is it blue or gray?


Huh. Now it's working for the first time in weeks. When I went to follow your suggestion, I remembered that I had blocked location access to a few different websites including Google when it asked. So I went into browser settings and hit "Clear location access". When I went to Google it correctly identified my location. I checked the weather and it's working, and this "find my location" type widget I have immediately found my position. Apparently that setting in the web browser applied to a lot more than I thought.

Thanks!


----------



## franzie3

sandman2211 said:


> Huh. Now it's working for the first time in weeks. When I went to follow your suggestion, I remembered that I had blocked location access to a few different websites including Google when it asked. So I went into browser settings and hit "Clear location access". When I went to Google it correctly identified my location. I checked the weather and it's working, and this "find my location" type widget I have immediately found my position. Apparently that setting in the web browser applied to a lot more than I thought.
> 
> Thanks!


Hoping this is my issue.....going to try this now....right now im based in Estonia...


----------



## sandman2211

franzie3 said:


> Hoping this is my issue.....going to try this now....right now im based in Estonia...


I did have that thing going on last month where it would say I was in Illinois, or off the coast of Africa but switching to the NetworkLocation.apk that skinien found resolves that issue. The problem I was having until (hopefully) just recently was where the whole thing was blocked, like it couldn't talk to Google location services at all. The fact that I'd told google.com it couldn't have access to my location info in my browser might have been related to that somehow...


----------



## franzie3

sandman2211 said:


> I did have that thing going on last month where it would say I was in Illinois, or off the coast of Africa but switching to the NetworkLocation.apk that skinien found resolves that issue. The problem I was having until (hopefully) just recently was where the whole thing was blocked, like it couldn't talk to Google location services at all. The fact that I'd told google.com it couldn't have access to my location info in my browser might have been related to that somehow...


i think i just tried a whole bunch of crap and im not sure if its working yet or not.

i gotta wait until i leave my building 1 - its a big concrete brick, 2 it houses computers and network crap, who knows what could be interferring.


----------



## Ianxcom

Thanks for the awesome fix. Worked perfectly for me on miui.


----------



## stvnx7

How do you change permissions? I've had very bad luck with file explorers that require root. They always force close. I think it has to do with my ROM or something.


----------



## jerrycycle

Try fix permission in your recovery.
I use root explorer. Find the apk needed it if choose the change is for. Make sure the mount R/ O is showing in the top right corner. Long press, see permission in the list. Change to desired and reboot


----------



## marieke

Amazing. Absolute fix.


----------



## Breezer23

I really feel this should be left as a stickied topic...


----------



## thisismalhotra

can we sticky this please mods ????


----------



## srs731

Okay-I switched back to OMFGB and my navigation doesn't work, my location is correct but the navigation portion is broken and constantly searches for GPS. Everything worked fine for me on Liquid 3.2 so will this location fix take care of my navigation problem as well?


----------



## thisismalhotra

nope to fix GPS need to flash a sense ROM get a gps lock and immediately go back to CWM and restore your OMFGB backup


----------



## srs731

thisismalhotra said:


> nope to fix GPS need to flash a sense ROM get a gps lock and immediately go back to CWM and restore your OMFGB backup


Thank you.


----------



## squarecat

I was only having occasional/temporary GPS issues so I can't say this was a full fix, but it does function properly.


----------



## xmetalfan99

Does this fix still work?


----------



## nativi

xmetalfan99 said:


> Does this fix still work?


Yes

Sent from my ADR6400L using Tapatalk


----------



## xmetalfan99

nativi said:


> Yes
> 
> Sent from my ADR6400L using Tapatalk


Hmmm, I wonder what I am doing wrong then. I Did the fix and the location holds for a few minutes, then I'm back in Queens instead of WV.


----------



## skinien

xmetalfan99 said:


> Hmmm, I wonder what I am doing wrong then. I Did the fix and the location holds for a few minutes, then I'm back in Queens instead of WV.


Try clearing the app data/cache for NetworkLocation.apk.

You should be able to find it in the application listing in Menu -> Settings -> Applications -> Manage Applications.


----------



## xmetalfan99

skinien said:


> Try clearing the app data/cache for NetworkLocation.apk.
> 
> You should be able to find it in the application listing in Menu -> Settings -> Applications -> Manage Applications.


Weather says I am in Pittsburgh. Google Maps and Google.com say I am in Claysburg, PA. How can I be getting two different locations when just using the network location? Google.com has a blue dot next to the location.

EDIT: I got the weather to match up with the network location, but it is still Claysburg, PA.

EDIT Two: Now my sense rom claims I am in Claysburg.

EDIT Three: Google.com won't update my location even when I have GPS on now.


----------



## skinien

xmetalfan99 said:


> Weather says I am in Pittsburgh. Google Maps and Google.com say I am in Claysburg, PA. How can I be getting two different locations when just using the network location? Google.com has a blue dot next to the location.
> 
> EDIT: I got the weather to match up with the network location, but it is still Claysburg, PA.
> 
> EDIT Two: Now my sense rom claims I am in Claysburg.
> 
> EDIT Three: Google.com won't update my location even when I have GPS on now.


Your Sense ROM? Did you try this fix on a Sense ROM or are you saying you went back to Sense?

If you're on AOSP, I'd start all over again.

If you're on Sense, nothing should have really changed because you're simply replacing the AOSP .apk with the Sense one. There could be a possibility that the Sense ROM doesn't like "installing" the app.


----------



## xmetalfan99

skinien said:


> Your Sense ROM? Did you try this fix on a Sense ROM or are you saying you went back to Sense?
> 
> If you're on AOSP, I'd start all over again.
> 
> If you're on Sense, nothing should have really changed because you're simply replacing the AOSP .apk with the Sense one. There could be a possibility that the Sense ROM doesn't like "installing" the app.


I switched back to sense after I tried the fix to see where it said I was.

I have tried redoing the process multiple times.

EDIT: I flashed a new ROM and it still says I am in Claysburg, PA. Could the issue be google?


----------



## xmetalfan99

After retrying the fix multiple times and having the same issue on sense roms, I am going to assume the issue is google right now.


----------



## skinien

Very strange. Hope your issue gets fixed...


----------



## daniel.uramg

Hello,

I need *networklocation.apk* for Android 4.0 ICS
The unit I bought did not come with this file, then the Maps do not get my location.
I downloaded several files on the internet but none could be installed on my device, nor this topic. I bought from China and has no mark!

Tanks.


----------



## JDely31

Works on SfK cm7 JB. Thanks skinien.

Sent from my ADR6400L using Tapatalk 2


----------

