Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added installation steps for android 9 #187

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,27 @@ Keep in mind that:
* There is another repo containing the [deprecated version](https://github.com/microg/NetworkLocation) of NetworkLocation.apk without the plug-in system.
* [microG GmsCore](https://github.com/microg/android_packages_apps_GmsCore/wiki) project already includes the Unified Network Location Provider.

### Android 9
Since google is now enforcing permission-whitelisting for system apps just copying the apk to `/system/priv-app/` is not sufficient anymore. Therefore an xml file with the following contents has to be placed at `/system/etc/permissions`:
```xml
<?xml version="1.0" encoding="utf-8"?>
<permissions>
<privapp-permissions package="com.google.android.gms">
<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"/>
</privapp-permissions>
</permissions>
```
This leaves us with the following installation steps:

1. Make sure no gapps are installed
2. Download `NetworkLocation.apk`
3. Boot into recovery and copy the apk to `/system/priv-app/` using the adb-command `adb push NetworkLocation.apk /system/priv-app/UnifiedNLP/NetworkLocation.apk` (also make sure you mount the `/system` partition in advance)
4. Still in recovery mode, copy the `privapp-permissions-unifiednlp.xml` with the contents from above to `/system/etc/permissions` using the adb-command `adb push privapp-permissions-unifiednlp.xml /system/etc/permissions/privapp-permissions-unifiednlp.xml`
5. Reboot `adb reboot`


### Android 4.4 - 7.1.1 (KitKat / Lollipop / Marshmallow / Nougat)
Most modern ROMs come with support for non-Google geolocation providers. On these systems installation is easy:
Expand All @@ -35,7 +56,7 @@ Some ROMs, especially those not based on AOSP might have problems using this met
3. Copy `NetworkLocation.apk` to `/system/priv-app` (from your PC, call `adb push NetworkLocation.apk /system/priv-app/NetworkLocation.apk`)
4. Reboot (from you PC, call `adb reboot`) and continue at [Usage](#usage)

**Note:** On Android 7 (or later) an [additional patch](https://github.com/microg/android_packages_apps_UnifiedNlp/blob/master/patches/android_frameworks_base-N.patch) is needed to make it working, or alternatively, you can install it in `/system/priv-app` as explained above.
**Note:** On Android 7 an [additional patch](https://github.com/microg/android_packages_apps_UnifiedNlp/blob/master/patches/android_frameworks_base-N.patch) is needed to make it working, or alternatively, you can install it in `/system/priv-app` as explained above.

### Android 2.3 - 4.3.1 (Gingerbread / Honeycomb / Ice Cream Sandwich / Jelly Bean)
Older Android versions are no longer officially supported. However I still provide a legacy build, that should be compatible with those systems.
Expand Down