nobody's blog




UnifiedNLP on LineageOS 16.0/17.1

Margret Riegert29 Oct 2020 - views


Update 2021-04-12: I’ve added a compatibility section going over some current issues regarding installing UnifiedNLP on certain devices that have a qualcomm location services blob.


UnifiedNLP is a part of the microG project intended to replace the proprietary Google location services with an open-source alternative. These services essentially make it so your device’s location can be calculated from cellular towers and Wi-Fi networks, otherwise your device will use GPS which make take longer and use more battery. This isn’t required when using OpenGApps (as this uses Google’s location services) or microG (which has UnifiedNLP baked in).


Some devices have a QC Location proprietary blob which prevents the installation of UnifiedNLP. In order to properly verify which devices still have this blob, I got a list of these devices by cloning the repositories for all LineageOS devices on GitHub and searching them to see if they had the blob. This is a 20 GiB download and took about 40 minutes.

for num in $(seq 23); do curl -s "${num}&per_page=100" | grep \"clone_url\" | awk '{print $2}' | sed -e 's/"//g' -e 's/,//g' | grep "android_device_" | xargs -n1 git clone; done

grep -R "<bool name=\"config_enableNetworkLocationOverlay\" translatable=\"false\">false</bool>" . 2>/dev/null

As of 2021-04-12, these are the devices that have the QC location blob:

Unfortunately for the time being the work around is a little complex, involving modifying a system APK and resigning it yourself (for security purposes). Those steps are provided here by Aqq123.

The other solution is getting the blob removed from the official builds of LineageOS, which has already been done for various other devices. There is currently an open issue for gingko on getting this blob removed, and no currently open issues for the other devices.

Installing UnifiedNLP

Here is how to install UnifiedNLP on LineageOS 16.0 and 17.1 without GApps.

I’ve tested this out on my OnePlus 3 running LineageOS 17.1, as well as my OnePlus 5T running LineageOS 16.0. I have not tested this on A/B devices, so be warned if you have an A/B device. This will also persist across LineageOS updates.

This will require a computer with a working version of ADB (Android Debugging Bridge). I did this using Linux, though the commands should translate to Windows and MacOS.

  1. Enable ABD and ADB root

    This will enable us to install UnifiedNLP without having to root our entire device, and is built into Android. This is also not permanent, and only accessible when using ADB.

    Enable ADB by going to Settings > About phone and tap on Build number 5 times. From here go to Settings > System > Advanced > Developer options and check Android debugging.

    ADB root can be enabled at Settings > System > Advanced > Developer options > Rooted debugging.

  2. Connect device to computer running ADB and authorize it

    After plugging in the phone and running adb devices, the adb server should start and there should be a popup on the device asking to authorize the computer for use with ADB. After agreeing, ensure that the device shows up and doesn’t say ‘unauthorized’ next to it.

     $ adb devices
     List of devices attached
     ffffffff	device
  3. Download the latest version of UnifiedNLP to your computer here

  4. Create a file called privapp-permissions-unifiednlp.xml and add this to it

    <?xml version="1.0" encoding="utf-8"?>
        <privapp-permissions package="">
            <permission name="android.permission.INSTALL_LOCATION_PROVIDER"/>
            <permission name="android.permission.ACCESS_FINE_LOCATION"/>
            <permission name="android.permission.ACCESS_COARSE_LOCATION"/>
            <permission name="android.permission.ACCESS_COARSE_UPDATES"/>
  5. Create another file called and add this to it. This is the script that will allow UnifiedNLP to survive LineageOS updates

    # /system/addon.d/
    . /tmp/backuptool.functions
    list_files() {
    cat <<EOF
    case "$1" in
            list_files | while read FILE DUMMY; do
                backup_file $S/$FILE
            list_files | while read FILE REPLACEMENT; do
                [ -n "$REPLACEMENT" ] && R="$S/$REPLACEMENT"
                [ -f "$C/$S/$FILE" ] && restore_file $S/$FILE $R
  6. Start ADB with root and remount to make the file system read/write. Be careful as running adb root and abd remount can be dangerous if not used properly.

     adb root
     adb remount
  7. Push the files to device, assuming the files are in the same directory as the current shell

     adb push NetworkLocation.apk /system/priv-app/UnifiedNLP/NetworkLocation.apk
     adb push privapp-permissions-unifiednlp.xml /system/etc/permissions/privapp-permissions-unifiednlp.xml
     adb push /system/addon.d
     adb shell chmod 755 /system/addon.d/
  8. Unroot and restart your device

     adb unroot
     adb reboot

Enabling UnifiedNLP

Great! You’ve now successfully installed UnifiedNLP. Now here are the steps on how to set it up.

  1. Check the UnifiedNLP settings

    Settings > Location > Advanced > UnifiedNLP Settings, or alternatively there should be a new app icon in your app drawer/home screen.

    Click on Self-Check and enable Permission to access approximate location ... (if this is unable to be checked off, proceed ahead regardless).

    Make sure UnifiedNlp is registered in system is checked.

    Location backend(s) set up is only checked after enabling location backends.

  2. Install location backends from F-Droid

    Some examples:



    There are several more listed here:

  3. Enable backends in UnifiedNLP Settings

    Settings > Location > Advanced > UnifiedNLP Settings

    Click Configure location backends and check off the services you want to use.

  4. Test out a map program to see if it works (such as OsmAnd~)

  5. Disable ADB and ADB root, both in Developer options

And that’s it! You have now installed UnifiedNLP. If you find UnifiedNLP (and by extension microG) useful, please consider donating to its continued development here!

Uninstalling UnifiedNLP

If for some reason it’s not working correctly, or you’re just not happy with it, here are the steps to uninstall UnifiedNLP.

  1. Enable ABD and ADB root (same as above) and connect your phone to a computer with a working version of ADB

    Make sure it’s connected by running

     $ adb devices
     List of devices attached
     ffffffff	device
  2. Start ADB with root and remount

     adb root
     adb remount
  3. Remove the installed files

    Make sure to type the command exactly as shown below as changes made here are permanent.

     adb shell rm /system/priv-app/UnifiedNLP/NetworkLocation.apk
     adb shell rm /system/etc/permissions/privapp-permissions-unifiednlp.xml
     adb shell rm /system/addon.d/
  4. Unroot and restart your device

     adb unroot
     adb reboot
  5. Uninstall location backends

Then you’re all set. UnifiedNLP is now successfully removed from your phone.


© 2020-2024 Margret Riegert
Unless otherwise noted, content is under a CC BY 4.0 license.