Work profile with Google account on Lineage 14.1 - LineageOS Questions & Answers

Hi all.
I've tried to set up my work profile on lineageos and here is what i came up to:
The process is as follows:
1. I got a gemini (Xiaomi Mi5) device with latest LineageOS nightly and opengapps installed before first boot.
2. To set up a work profile, my organization uses Mobicontrol from SOTI.
3. After authorization in Mobicontrol and creating work profile on device (which goes without issues, i.e. i get second settings app, files, phone, etc with a suitcase icon), i must add Google account to my work profile and here i get stuck.
As i can see, there is no Play Market/Services app with a suitcase icon, thus, no Play Services available in work profile and thus, I am unable to complete my work profile creation.
I guess, the issue is somewhere between opengapps and lineage as play services are not included when work profile gets generated.
Looks like opengapps are not counted as a system (or built-in) application.
Is there any workaround to include gapps to work profile?

I have this same issue. My work uses MobileIron to setup the Work profile. It tries to set it up, but fails complaining that 'Google Play services aren't available', which I believe is the same failure mechanism observed here.
Any updates?

Related

Hangouts Crash in Work Profile SMS

Hangouts repeatedly crashes when trying to type a GVoice SMS in my Android for work profile. It works correctly in my main profile. I'm able to create a new message, but as soon as I try to type in the text field, it crashes. When installed as a system app, it just tells me it has crashed and I have to click OK. When installed as a user app, it gives me the option to report the crash. The system info from the report suggests that the app is trying to do something with another SMS function.
I have tried reinstalling and recreating the work profile. I have installed the latest nightly CM and the latest openGapps. I've tried excluding hangouts in Gapps and manually installing from the Play Store. I've tried manually installing an older version because I found a relevant thread on Google Product Forums.
I have the same setup on my Z300c (Zenpad 10) which is running rooted stock (Android 5.0), and I'm not having any problems.

microg / playstore / signature spoofing

so, i now nothing about linux, i know about android only as much as every other phone user. i used android emulators, one day i though hey, what if you just use android as an os and i found this new dimension, almost.
now, i installed the last bliss os, i had many crashing problems (installing apps from apkpure caused crash, installing from built-in file manager also caused crash) and i figured pretty much all of those problems stem from notification problems. so i go and disabled all notifications, app by app, including system ui notifications. now i can install anything from apkpure, i don't receive any crashing.
another problem was with vertical apps. they didn't show properly, solved that problem with the built in orientation tool.
now, i want to know wth is this microg thing is. i can install any apk from apkpure so i don't need store for that. i am also okay with playing games in guest mode. all i want being able to ignore google login part. (edit: i just installed another game in which you login with plarium registration method which also stopped working when loading bar was showing "connecting to store systems". makes sense, i guess.)
microg thing has a self check and i guess when everything checked it will do exactly that? it will fool apps as if i have google play while i don't? so i need a tutorial about that. what's unchecked for me?
system has signature spoofing support CHECKED
system grants signature spoofing support CHECKED
system spoof signature UNCHECKED
play services gmscore installed CHECKED
play services gmscore has correct signature UNCHECKED
playstore phonesky installed CHECKED
playstore phonesky has correct signature UNCHECKED
(everything else between checked)
last entry called "network based location enabled" UNCHECKED. (it says you either disabled this in system setting which i didn't or the system is not supported)
thanks in advance.
I have a similar problem - I managed to get some of the unchecked checked by clicking on the option itself and sometimes a dialog would come up asking to grant some sort of permission. But I am still stuck with 'System spoofs signature' and 'Play Services (GmsCore) has correct signature' unchecked.
Does this mean the signature spoofing is not happening? If so I'm not sure what else I need to do to get it set up on Bliss OS 11.14.

How to get rid of "Device is not Certified"?

Hello Guys! I wanted to ask that is there any solution for getting rid of this "Device is not Certified" without/with root? I have flashed Phusson's GSI and then GApps Micro but the first error j get is that on Setup screen, it sticks on Checking for Update no matter how much time I give it to check(Problem 1). The second problem is that I have sent the Android device ID (or whatever) used to certify the device but if no avail. It's still saying not Certified. I can spoof it by Magisk, that it is Certified by a module ummm... I forgot it's name(but it's not PlayStore Visa for sure) but still I can't use Google Play services in my device. Whenever I use an app that requires so, it gives an error that "Google Play Services is having trouble .....". What can I do to resolve this issue and use Google Play Services?
SafetyNet vs. Full Block
This seems to be a chronic problem for GSIs, but there are really two distinct levels of hell here:
Google Play Store -> Settings -> Play Protect certification reads "Device is not certified" and apps requiring SafetyNet won't work
Google Play Services completely blocks your device, and a barrage of noisy alerts are generated as soon as you attempt to log in
Many users won't even notice the first limitation, but the second blocks the setup wizard and makes the device effectively unusable until you register the GSF in on Google's registration page. But can anyone tell me why some custom ROMs trigger the second behavior and others don't?
As a custom ROM developer, some of my builds (usually the ones based on GSIs with an OEM vendor partition) have required device registration to be usable, and I'd really like to avoid that. I've tried spoofing known-good build fingerprints like some Magisk modules, but that hasn't worked so far. Has anyone found a decent workaround?
Or even better, can custom ROM developers just register our build fingerprints with Google? (I realize that this still won't satisfy SafetyNet, but it would allow custom ROM developers to go legit.)
It will never show up as certified if the build is not signed (or signed with public keys), and selinux is disabled. If that's not the case, you can try setting BUILD_SIGNATURE prop from latest OEM stable build and match your device.
baunilla said:
It will never show up as certified if the build is not signed (or signed with public keys), and selinux is disabled.
Click to expand...
Click to collapse
I'm not really interested in getting a "Device is certified" message (a.k.a. SafetyNet certification) with custom ROM development, since having the bootloader unlocked is going to cause it to fail anyway.
One thing I've noticed that seems to cause Google Play Services to block any login is when the GSI is signed with test keys and the OEM vendor partition is signed with release keys. Considering that we probably don't have the OEM's private release keys, is there any way to re-sign the vendor partition with test keys?
And interestingly enough, apps like Netflix are actually more likely to work if selinx is set to permissive. I've used that workaround on my custom ROMs before.
this is a very important topic, it is strange that it attracts so little attention.
One thing that I have discovered is that running "adb shell su 0 /system/bin/phh-securize.sh" to disable root on GSI AOSP builds by @phhusson will copy the required properties to look like stock ROM. This makes Play Protect play nice and you no longer have to register your GSF ID to stop the constant barrage of alerts.
I haven't had the time to figure out how he does it, but his source is shared on GitHub.

Problem with Rooted Stock Rom with AirWatch

My company is now enforcing and managing BYOD with AirWatch. I'm trying to enrol my Magisk-rooted Pixel 2 XL. I've searched around XDA and other sites and I was able to enrol the phone when I use Magisk Hide to hide from the AirWatch agent, aka now the Intelligent Hub. It creates a Work profile and installed several work related apps. The only other app aside from Intelligent Hub I've tested so far is Boxer and it works for the few minutes during my test.
When I say Boxer works for a few minutes, that is because next I attempted to open Workspace One. As it loads, I'm guessing it checks other details about the phone, then it would popup a message saying Work apps and profile removing because the device is "compromised" and uninstall the work apps and Word profile.
I would like to use Magisk Hide and hide from Workspace One app, but Magisk Hide doesn't even list that and other apps in the Work profile. An admin at work checked the AirWatch server and it shows the device compromised detection with the status "Malicious file found - Check files in system or exec folder".
So my question is, outside of troubleshooting step by step from wiping phone and setting up each thing from scratch, anyone else have an insight on what else I can check?
FYI, these are the following setup I have on my phone
- Pixel 2 XL
- Rooted with latest version of Magisk and Manager
- Latest Pie 9.0 Aug 2019 Update
- Magisk Modules Installs: Busybox, Viper4Android
- Apps with Root Access: AdAway, BetterBatteryStats, Franco Kernel Manager, Material Terminal, Titanium Backup
s0l1dsn8k3 said:
My company is now enforcing and managing BYOD with AirWatch. I'm trying to enrol my Magisk-rooted Pixel 2 XL. I've searched around XDA and other sites and I was able to enrol the phone when I use Magisk Hide to hide from the AirWatch agent, aka now the Intelligent Hub. It creates a Work profile and installed several work related apps. The only other app aside from Intelligent Hub I've tested so far is Boxer and it works for the few minutes during my test.
When I say Boxer works for a few minutes, that is because next I attempted to open Workspace One. As it loads, I'm guessing it checks other details about the phone, then it would popup a message saying Work apps and profile removing because the device is "compromised" and uninstall the work apps and Word profile.
I would like to use Magisk Hide and hide from Workspace One app, but Magisk Hide doesn't even list that and other apps in the Work profile. An admin at work checked the AirWatch server and it shows the device compromised detection with the status "Malicious file found - Check files in system or exec folder".
So my question is, outside of troubleshooting step by step from wiping phone and setting up each thing from scratch, anyone else have an insight on what else I can check?
FYI, these are the following setup I have on my phone
- Pixel 2 XL
- Rooted with latest version of Magisk and Manager
- Latest Pie 9.0 Aug 2019 Update
- Magisk Modules Installs: Busybox, Viper4Android
- Apps with Root Access: AdAway, BetterBatteryStats, Franco Kernel Manager, Material Terminal, Titanium Backup
Click to expand...
Click to collapse
The following works but I am not sure if all the steps are crucial and which ones may be superfluous. Those instructions in (parentheses) may be not necessary).
I am not a programmer (Basic on a C-64 doesn't count, I take it), don't know anything about computer architectures etc., just able to follow instructions and wrap my mind around them to tweak my devices.
The main part is to "Hide Magisk Manager" after Boxer is installed (but before it is opened/setup) as that also creates another Magisk app (instance?) with the new name for the work profile where Boxer etc. show up and can be hidden with Magisk Hide.
The other (first) part is to hide anything that would alert and conflict with Hub before or during setting up the work profile - I pretty much hid everything under Magisk Hide...
I don't know BYOD nor Workspace One, so the solution below may not work.
- uninstall Hub (that's the only app remaining after the auto-uninstall, right?)
- if Magisk Manager is already hidden: go to Settings\Restore Magisk Manager "with original package and app names" - that seems to be important, as hiding it later and with another name will then also create a Work Profile where one can see and click and hide the work profile apps such as Boxer (not sure if it works the other way around, i.e. starting off hidden with a different name and then later restoring to original will create a Magisk work profile)
- Magisk Hide: click almost every system app, not just the Google ones, but almost everything, camera, calendar, contacts etc. and your phone maker's versions as well (not sure what is necessary, but only Google system apps didn't seem to do it...), also all root and SU related apps like BusyBox etc. (not sure what Hub looks for)
(- System\Apps > clear storage data for Google Play Store and other Play Apps, also make sure Hub is really uninstalled. If not or having problems at least clear data storage as well)
- reboot (can also go into TWRP and wipe cache/Dalvik, not sure if necessary)
- install Hub, don't open it
- open Magisk, go to Magisk Hide: click Hub
(- close Magisk)
(- reboot)
- open Hub, let setup run its course creating the work profile
- if there are conflicts showing in Hub (and/or on your employer's MDM website for your device), e.g. root certificate not installed, don't install any apps yet such as Boxer etc. and reboot instead
- Are those conflicts resolved after reboot?
- install Boxer and other apps (trough Hub itself, MDM website push (or Google Play)) but don't open/start them
(- reboot)
- open Magisk, go to Settings\Hide Magisk Manager and click on it, pick a name and confirm: this will then change the name of Magisk AND create a another Magisk app (with the new name) for the work profile.
- open that new Magisk work profile and go to Magisk Hide: click Boxer (and other apps controlled by Hub); Hub itself and everything already hidden in the private (= non-work) profile Magisk app should show up here as already hidden. Double and triple check.
(- reboot)
- open Boxer and start set-up
That's it. Stable, even after another reboot.
Did this solution work for you @s0l1dsn8k3?
I am in a similar boat. @s0l1dsn8k3 please let me know if you found an alternate solution.
I am in a similar boat. @s0l1dsn8k3 please let me know if you found an alternate solution.

Themes / Apps / Mods [Magisk] UnifiedNlp enabler module for stock ROM

UnifiedNlp enabler for stock ROM (Magisk module)​​What's this and what does it do?​
It's a Magisk module. You need to have Magisk working to use it. This thread can help with that.
It installs UnfiedNlp 1.6.8 as a system app and also does the magic that allows it to work as a location provider alongside Google Apps (aka GApps).
I've only tested it on the stock Sony ROM (firmware 62.0.A.3.163 to be more exact). Reports of whether it works on other versions are welcome.
It can in theory work on other ROMs but it depends a lot on the ROM. ROM variations is actually what makes it so fiddly and why such a deceptively simple module is so hard to find for your device. I don't intend to install other ROMs to test it but again reports are welcome. Please see below for explanations about how it works if you want to tackle it.
​No but seriously, what's UnifiedNlp and why do I care?​Your location provider (on a stock ROM from an established vendor like Sony) is Google. Elephant in the room, Google spies on you. They watch your location 24/7 and they learn things about you: where you work, where you live, where you shop, where you go to school, where you go in your spare time. They use this information to serve you ads. All vendors that want to be able to carry the Android trademark and be friends with Google are forced to put Google's location provider on their phone.
But Android actually has the ability to install multiple location providers, and switch them on and off at will. Except most stock ROMs come with this ability deactivated.
UnifiedNlp is an open source location provider with very cool features. It uses modules which let you use more privacy-oriented location services when you're online, and also let you determine your location offline, which gives you better privacy and also is very useful when you don't have a data connection. This Magisk module installs UnifiedNlp and tells the stock Sony ROM to let you use it.
But GPS already works fine on my phone​This isn't about GPS. Every phone/ROM has built-in GPS as a basic location provider. GPS doesn't depend on Google or anything else. You either get direct visibility to 4+ GPS satellites or you don't, and the AGPS (Assisted GPS) data that speeds up GPS fix is freely available online.
This is about being able to use WiFi spots and mobile cell towers for location. This works faster than GPS and also works indoors.
In order to use something to determine your location you need to know its position. The positions of GPS satellites are well known, but the positions of wifi spots and cell towers isn't. To get those positions you need to go to someone who has walked all around your street and has used GPS to determine the exact position of the spots and towers.
Google has cars that go everywhere in the world doing that, but every time you ask Google for this information they also use your location to track you. This module will give you access to that information from sources other than Google.
How do I use this?​
Install UnifiedNlp:
Download the attached ZIP on your phone (preferably under Download/).
Open Magisk, go to the modules tab, hit "install from storage" and pick the ZIP, then reboot.
After reboot you should have a UnifiedNlp system app installed. Some launchers will show it in their app drawer or even put it directly on the home screen for you, but regardless you can always open it from Settings > Location > Advanced >UnifiedNlp Settings. If it's not in the settings something is wrong.
Open UnifiedNlp settings and hit "Self Check".This gives you a screen with several checkmarks that should be on so everthing will work fine:
Permissions check: most of this will have been taken care of by the Magisk module, but you still need to tap it at least once. Grant location access if prompted.
Android version supported: will most likely never be checked, but like it says it doesn't mean much.
System supports this location provider: must be already checked. If it isn't, reboot once more after you've granted the location permission.
UnifiedNlp is registered in system: same as above, must be already checked. If it isn't, try a reboot. If this and the above check still don't enable something is wrong and this module doesn't seem to work on your ROM. See below for possible tinkering solutions.
Location backends set up: this will only become enabled after you install some modules. It's ok if it's off for now.
Network based location enabled: if this isn't checked, go to Settings > Location > Advanced > Google Location Accuracy and turn it on. In spite of the name it has nothing to do with Google, this enables/disables the use of wifi and mobile cells for location.
The last two checks ("has known location" and "provides location updates") may or may not show a check, but it doesn't matter, the real test will be getting your apps to work.
Install some modules. UnifiedNlp won't do anything without them. If you have F-Droid installed you can get these modules from it, otherwise you can grab the APKs from the F-Droid website.
NominatimNlpBackend: this is a must-have. It's an address backend, not a location backend. It matches a position to a postal address (city, street, number, that sort of thing).
MozillaNlpBackend or Apple UnifiedNlp Backend: at least one of these must be installed. These are the main location providers, equivalent to Google's. They need a data connection. They send information about nearby wifi spots and cell towers to Mozilla or Apple, and they get back an exact position. Both work equally well. Apple's has slightly higher precision, but Mozilla's privacy policy is better.
Modules below this point are optional. If you just wanted UnifiedNlp to be functional you can skip them, but they can be very useful when you don't have a data connection.
Deja Vu: when you have a GPS fix, this module saves/updates the position of nearby wifi spots and cell towers. When you don't have a GPS fix, it uses previously saved spot/tower positions to give you an approximate location. Doesn't need a data connection, doesn't need you to do anything, and it never needs any external service.
GSM Location Service: this module will offer to download a database of cell tower locations for your area. Then it will use it to determine your location based on cell towers detected nearby. Only needs data connection for the initial database download or for updates, after that it works offline.
WiFi Location Service: same as above, but for wifi spots.
After you install a module you must activate it in the UnifiedNlp settings, under "Configure location backends" or "Configure address backends".
Some of them may have additional settings available in there (gear icon). The GSM and WiFi location modules will need you to indicate your area and download a database.
If you can't enable location modules you've most likely missed a step (Network based location enabled) in Self-check.
If you're using XPrivacyLua you may want to either extempt these modules from restrictions or allow them location access.
Remember to grant Internet access in your firewall, if you have one, to the modules that need a data connection.
Verify that UnifiedNlp works:
Some app suggestions:
The NLP Test app lets you explicitly use "LM" (network-location like wifi/cells) or "GMS" (GPS) and also shows you lots of useful information, accuracy, different map markers for high/low precision etc.
The Gmaps WV app is a lightweight alternative to the Google Maps app (it uses the Google Maps website wrapped in a webview).
The OsmAnd app is a feature-rich map and navigation app that uses open map data from sources completely independent from Google.
The GPS Test app by Chartcross is very good for checking whether you're getting a GPS signal or not.
For testing that network-based location works you want to be indoors and you want GPS positioning to not work.
Disable all location modules in UnifiedNlp and check that NLP Test can't determine "LM" location.
Enable only one module, Mozilla or Apple, and check that NLP Test can get a "LM" location and also what accuracy you get.
The following tests are optional and results will also vary depending on your area and what cell/wifi coverage you get.
Enable only one module in turn between the GSM or WiFi service and see if you can get a "LM" fix with it.
Activate Mozilla or Apple module and Deja Vu, get a GPS fix, wait a minute or two, go indoors, check that you no longer get a GPS fix, disable Mozilla/Apple, and see if you get a "LM" fix in NLP Test with just the Deja Vu module activated.
​I don't like it, how do I uninstall and go back to Google location?​
Uninstall the module in Magisk and reboot. That's it.
Optionally you can uninstall the UnifiedNlp modules. They don't do anything without UnifiedNlp. Consider keeping them in case you change your mind and reinstall UnifiedNlp later. If you uninstall the modules you also lose the databases that they've created and you'll have to re-download them or let them recreate them (in Deja Vu's case).
How does this work (and how can I make it work on other ROMs)?​There are three things needed to make this work:
The UnifiedNlp app needs to be installed as a system app in /system/priv-app/UnifiedNlp/UnifiedNlp.apk. You want the version with GAPPS. Can get it from F-Droid or GitHub.
UnifiedNlp (org.microg.nlp) needs a bunch of system-level permissions. They can be granted manually, but the more elegant method is to put them in /system/etc/permissions/org.microg.nlp.xml.
Overwrite several location provider-related settings in framework-res.apk by using Runtime Resource Overlays (RROs), to allow UnifiedNlp to act as location provider.
Which packages are allowed to act as a location provider is set inside framework-res.apk in the config_locationProviderPackageNames array. This array typically only lists Google packages and org.microg.nlp needs to be added in there. There's also some string settings that indicate the "master" location provider which need to be set to org.microg.nlp.
In the olden days the only way to do this was to unpack framework-res.apk, modify the values, repack it with a custom signature, put it back on the ROM and hope for the best. Often this would fail if the ROM was checking that the apk was not tampered with.
At some point a better method came along: RROs. These are APKs that overwrite values in framework-res.apk. Sounds pretty simple, but it's complicated by the fact that different ROMs have different rules about what overlays can overwrite what settings. The Xperia 10 III (XQ-BT52) /system/build.prop gives the following priority order for RRO locations: odm,vendor,product,system_ext,system. Therefore this module installs the /system/product/overlays/UnifiedNlpOverlay/UnifiedNlpOverlay.apk RRO.
You will need to accomplish all three things above to make this work on another ROM. The 3rd one is the tricky one because there are multiple places where a RRO can go and not all of them work. Some custom ROMs already take care of step 3 for you. Otherwise, check the documentation I linked. You may want to try other dirs instead of /system/product (alternatives are listed in the docs). Or you may need to change the overlay XML files, in which case it gets more complicated, and you'll also need apktool to unpack and repack the overlay.
Credits​
The microg project for making UnifiedNlp.
TontyTon for the overlay.
Misaka4e21 for the Magisk module and the permissions XML.
I added the UnifiedNlp.apk to the module and figured out where the overlay needs to be placed on the stock Sony ROM to make it work.
Doesn't seem to install in Magisk. But I'm very interested in this module though ideally I'd want stock rom with microg.
lufei said:
Doesn't seem to install in Magisk. But I'm very interested in this module though ideally I'd want stock rom with microg.
Click to expand...
Click to collapse
What version of Magisk are you using? I'm on v24. Are you getting any errors, or are you just not seeing the zip in the Magisk installer?
wirespot said:
What version of Magisk are you using? I'm on v24. Are you getting any errors, or are you just not seeing the zip in the Magisk installer?
Click to expand...
Click to collapse
When trying to install the zip in Magisk I just get "copying zip to temp directory ! Unzip error" installing other modules work and I use Magisk 24.2
Can you also check that the zip was downloaded correctly? You can do this with md5sum from a terminal or adb shell, it should have checksum a54c4de46ecdbb228c496c59bc2cf275.
You can also try to install the zip from the command line like this: magisk --install-module filename.zip
Found the problem, I was putting the files inside another directory instead of putting them directly in the root of the zip. I've swapped the attachment in the first post with a correct file. Added a MD5 in the filename too, just in case. Thanks @lufei !
wirespot said:
Found the problem, I was putting the files inside another directory instead of putting them directly in the root of the zip. I've swapped the attachment in the first post with a correct file. Added a MD5 in the filename too, just in case. Thanks @lufei !
Click to expand...
Click to collapse
Now it installs and I was able to get all boxes checked, let's see how it works!
Thank you for the detailed explanation.
The topic of finding a location provider other than Google had interested me for a long time.
Until now, however, I had not yet dealt with it.
With this excellent tutorial I am now not only wiser, but can also confirm that everything as described also runs with the LOS18.1 GSI Rom and latest Sony Firmware.
Don't know if it's the GSI lineageOS or because I flashed the OpenGapps via Magisk, but I had trouble getting the current location in certain apps via both "LM" and "GMS".
The error was exactly as described here:
No GPS fix for most apps
With the solution described there, the problem could then be solved:
Code:
adb shell pm grant com.google.android.gms android.permission.ACCESS_COARSE_LOCATION
adb shell pm grant com.google.android.gms android.permission.ACCESS_FINE_LOCATION
Do you still get a LM fix if you disable all location modules in UnifiedNlp, or if you disable this Magisk module? Because I suspect you're actually using the Google location provider.
This Magisk module relies on the assumption that the UnifiedOverlay.apk file is placed in a location that will override the values provided by /system/framework/framework-res.apk. For the stock ROM it seems to work with /system/product but if that's not true for Lineage you may want to try modifying the zip and also copying system/product/overlay as system/vendor/overlay, system/oem/overlay, system/odm/overlay, system/system_ext/overlay and system/overlay.
wirespot said:
Do you still get a LM fix if you disable all location modules in UnifiedNlp
Click to expand...
Click to collapse
No, if I disable the location modules LM fix is not possible anymore.
psychofaktory said:
No, if I disable the location modules LM fix is not possible anymore.
Click to expand...
Click to collapse
Ah that's cool then. It's interesting that it requires .gms to also have location rights even if it's not using it. I guess as long as it's installed and listed as an official location provider it needs to have the permissions that go with it too.
@wirespot
Is there anything against using this Magisk module on a device other than the Xperia 10 III?
It won't break anything, it just won't work if the folders aren't good. UnifiedNlp settings will complain that the service could not be registered.
See post #10 for a list of folders. If it doesn't work as is, duplicate the system/product folder with all those other names, repack the zip, and try with that.
What ROM are you planning to try it on?
wirespot said:
What ROM are you planning to try it on?
Click to expand...
Click to collapse
Offical LineageOS 18.1 von Sony Xperia XA2 an unofficial LineageOS 18.1 on Xiomi Mi 9 lite.
On LineageOS you don't need the overlays (so none of the /system/*/overlay/* files or dirs) because its framework-res.apk already allows you to use UnifiedNlp (it lists org.microg.nlp as an approved location provider). This actually solves a major headache.
You can still use a Magisk module to install the UnifiedNlp apk to /system/priv-app and the permissions file to /etc/permissions/ systemlessly if you want (as opposed to actually mounting the root partition read-write and copying them there). This makes it easier for these modifications to survive LineageOS updates. (If you need to install them physically you will either need to copy them again after every update, or you can use a script that protects them during updates as described here.)
Please note that the actual apk you need to install depends on whether you install with Gapps or without. My module is made for a stock Sony ROM with Google Apps so of course there's already a location provider from Google (com.google.android.gms), so I need to use the UnifiedNlp.apk, package name org.microg.nlp, which is designed to work alongside Gapps. If you plan on installing Gapps on LineageOS then you need to do the same so you can use my module with just the */overlay/* stuff removed.
If you plan to use LineageOS without Gapps then you need to get the NetworkLocation.apk version of UnifiedNlp, which has package name same as the original Google package (com.google.android.gms). You will need to replace /system/priv-app/UnifiedNlp/UnifiedNlp.apk with /system/priv-app/UnifiedNLP/NetworkLocation.apk in the module zip, and also edit /system/etc/permissions/org.microg.nlp.xml and change the package name from "org.microg.nlp" to "com.google.android.gms". (The actual file name of the .xml doesn't matter, the system loads all the .xml files in that dir anyway, but you can change that too if you want to be tidy.)
Thank you very much for your answer.
Whenever possible, I prefer the systemless variant.
Therefore, your Magisk module would be a good way.
For all LineageOS installations I have installed the OpenGApps.
That means I simply remove the system\product\overlay\ folder and its contents from the zip file and can then flash the module directly with Magisk?
Is it enough to adjust the values in the module.prop to change the display name of the module, or is there anything else that needs to be considered here?
Tried with the steps I described in my post above.
Everything worked so far.
Except UnifiedNlp didn't register in system.
What's wrong with my setup?
Does it say "system supports location provider" in UnifiedNlp self-check?
Two common gotchas:
In the Self-check list, tap "permission to access location" at least once. It may be needed to grant additional location permission.
Make sure that using network-based location is enabled in the settings. I don't know what it's called on Lineage. On stock ROM it's called "Google location accuracy" which of course isn't useful.
Reboot once after doing all of the above.
Wait a couple of minutes after restart before you do Self-check, sometimes it takes a bit longer.
If none of this works try copying system/product/overlay as system/vendor/overlay, system/oem/overlay, system/odm/overlay, system/system_ext/overlay and system/overlay, in the zip, reinstall the module and reboot.
Self-check says that system supports location provider. Permissions are set and every mark is checked.
Network-based location is also active.
Phone was rebootet several times and I waited bevore testing with NLP TEST app.
I have created and installed a new ZIP file based on your recommendation. That seemed to did the trick.
Got a location wie LM NLP test. But far from my actually position.
But then I figured out, that the problem came from somewhere else:
Mozilla NLP gave me wrong Informations about my position. So I disabled it and enabled Apple NLP instead.
Since then everything works find.
If I see this correctly, the newly created Magisk module should then work on all LineageOS roms with GApps installed. Regardless of the device type.
Am I correct here?

Categories

Resources