Xiaomi MIUI Official Forum

Gold Member

Rank: 3Rank: 3

Credits
317
Device
Mi 3
MIUI Version
6.4.14
Online time
17 Hours
Send PM

I Love MIUIMIUI 2017Fan Of MIUI SpainMIUI Global Forum 2014

[Tools, Tips & Tutorials] [GUIDE] How to enable network location in Mi3/4 WCDMA

[ Promote]
4255 7 |
17:51, Dec-17-2014 | From PC
|
|
Go to reply no.
This post was edited by koboldo81 at 17:55, Dec-17-2014

Hi all!

After some tests, finally I got the network location working outside China. This fix is needed to have the Weather app working correctly.
Before continue reading, keep in mind that is supposed that you already know how to use apktool.

Here we go:

1. Pull the framework-res.apk from your phone or from a ROM.
2. Decompile framework-res.apk
3. Check the file res/values/strings.xml
    - Find this line:
  1. <string name="config_networkLocationProviderPackageName">com.amap.android.location</string>
Copy the Code
- Change that line into this one:
  1. <string name="config_networkLocationProviderPackageName">@null</string>
Copy the Code
- Find this another line:
  1. <string name="config_fusedLocationProviderPackageName">com.qualcomm.location</string>
Copy the Code
- Change that line into this one:
  1. <string name="config_fusedLocationProviderPackageName">com.android.location.fused</string>
Copy the Code
4. Check the file res/values/bools.xml:
    - Find this line:
  1. <bool name="config_enableNetworkLocationOverlay">false</bool>
Copy the Code
- Change that line into this one:
  1. <bool name="config_enableNetworkLocationOverlay">true</bool>
Copy the Code
- Find this another line:
  1. <bool name="config_enableFusedLocationOverlay">false</bool>
Copy the Code
- Change that line into this one:
  1. <bool name="config_enableFusedLocationOverlay">true</bool>
Copy the Code
5. Compile framework-res.apk and push it to your ROM/phone (remember to apply the correct permissions -644-)
6. Delete the app /system/app/AMAPNetworkLocation.apk
7. Reboot in recovery and wipe cache and Dalvik.
8. In the next reboot, a message appears asking to allow to Google to locate you. If you agree to that message, the network location will work correctly.
9. Voilà! The Weather app now is locating correctly.

Thanks to Redber and Faralai for their help. ;)

Favorite2 Share

Rated by 3 people   Experience Reason  

115212260 + 5 Thanks!
ygorigor + 2 Thanks!
64izadi + 2 Thanks!

Experience +9  View Rating Log

Diamond Member

Rank: 5Rank: 5

Credits
717
Device
Mi 5
MIUI Version
V8.1.2.0.MAAMIDI
Online time
116 Hours
Send PM

I Love MIUIMIUI 7MIUI 4th AnniversaryFan Of MIUI India

18:17, Dec-17-2014 | Via mobile
|
Great, definitely going to try

Senior Member

Rank: 2

Credits
28
Device
Mi 4
MIUI Version
4.12.19
Online time
3 Hours
Send PM
20:55, Jan-04-2015 | From PC
|
I can't get it to work, building fails, even when testing it without changes to the apk. I tried the last stable and the newest version of apktool.
Which version of the apktool are you using?

Senior Member

Rank: 2

Credits
32
Device
0
MIUI Version
6.9.1
Online time
4 Hours
Send PM
23:20, Mar-10-2015 | From PC
|
Is there a simpler way to do this?

Gold Member

Rank: 3Rank: 3

Credits
317
Device
Mi 3
MIUI Version
6.4.14
Online time
17 Hours
Send PM

I Love MIUIMIUI 2017Fan Of MIUI SpainMIUI Global Forum 2014

 Author| 05:18, Mar-13-2015 | From PC
|
Fei666Fei replied at 2015-1-4 20:55
I can't get it to work, building fails, even when testing it without changes to the apk. I tried the ...

I am using the version 2.0.0 RC1, but I am testing with the newer one, the 2.0.0 RC4.

Gold Member

Rank: 3Rank: 3

Credits
317
Device
Mi 3
MIUI Version
6.4.14
Online time
17 Hours
Send PM

I Love MIUIMIUI 2017Fan Of MIUI SpainMIUI Global Forum 2014

 Author| 05:18, Mar-13-2015 | From PC
|
cvaz replied at 2015-3-10 23:20
Is there a simpler way to do this?

No, I'm afraid this is the only way. Sorry

Senior Member

Rank: 2

Credits
32
Device
0
MIUI Version
6.9.1
Online time
4 Hours
Send PM
01:27, Mar-17-2015 | From PC
|
:(. Tks, I will keep w8ing for something else to fix this.

MIUI Fan Site

Rank: 6Rank: 6

Credits
350
Device
Mi 5 Pro
MIUI Version
7.7.13
Online time
164 Hours
Send PM

MIUI 6Fan Of MIUI PolandMIUI Follower

03:42, Mar-18-2015 | From PC
|
Actually there is second way that also works.
Instead of setting fused location as provider you set qualcomm location (which might be native).

So this:
  1. config_networkLocationProviderPackageName
Copy the Code
set to com.qualcomm.location, and don't touch bools to enable overlay location provider.

Credits Management

Quick Reply Top Return to the list