yashsingh1/xdaforums huggingface dataset:
[Moto G Android Development] Scranalot:
'B' Variant - Sans Micro-G, Aurura Store

Morning

As I have stated on here a few times I have 2 Falcons - a XT1032 (my original) & a XT1033 (bought specifically for its dual SIM capabilities).

Both phones had been on your 'B' Variant MSe1969 but I have been trying to become as open source (FOSS) as possible.

I have pretty much achieved it on the XT1033 & so was thinking of going 'A' Variant as I no longer required Micro-G, Aurura Store etc, however I did appreciate the additional security hardening features of 'B' Variant MSe1969 so I decided to stick with the 'B' Variant & remove Micro-G, Fake Store, Gsf Proxy, Aurura Store, Aurura Services along with privapp-permissions-AuroraServices.xml & then install Micro-G UnifiedNlp (NetworkLocation.apk) to /system/priv-app.

All seems to work fine so I've made up a /system/addon.d/ script for any future update & would appreciate you casting your eye over it MSe1969 :

#!/sbin/sh
#
# /system/addon.d/51-microg_changes.sh
# During a LineageOS 14.1 upgrade, this script backs up NetworkLocation.apk,
# /system is formatted and reinstalled, then the files are restored.
#

. /tmp/backuptool.functions

list_files() {
cat <<EOF
/system/priv-app/NetworkLocation/NetworkLocation.apk
EOF
}

case "$1" in
backup)
list_files | while read FILE DUMMY; do
backup_file $S/"$FILE"
done
;;
restore)
list_files | while read FILE REPLACEMENT; do
R=""
[ -n "$REPLACEMENT" ] && R="$S/$REPLACEMENT"
[ -f "$C/$S/$FILE" ] && restore_file $S/"$FILE" "$R"
done
;;
pre-backup)
# Stub
;;
post-backup)
# Stub
;;
pre-restore)
# Stub
;;
post-restore)
rm - rf /system/app/AuroraStore
rm - rf /system/app/GsfProxy
rm - rf /system/priv-app/AuroraServices
rm - rf /system/priv-app/FakeStore
rm - rf /system/priv-app/GmsCore
rm /system/etc/permissions/privapp-permissions-AuroraServices.xml
## rm /system/etc/permissions/privapp-permissions-com.android.vending.xml
## rm /system/etc/permissions/privapp-permissions-com.google.android.gms.xml
;;
esac

As you can see I've commented out the last 2 remove commands in the script as although I think they refer to Fakestore & G* cloud messaging I'm not sure & would be grateful for your advice.

Cheers

Scranalot ;)
[Moto G Android Development] MSe1969:
Hi,

the script looks good to me (haven't obviously tested it, but you did).

Some comments:

Yes /system/etc/permissions/privapp-permissions-com.android.vending.xml is for FakeStore, so you can purge that file, too.

The file privapp-permissions-com.google.android.gms.xml refers to the /system/priv-app/GmsCore file, hence - on first sight - one could think to get rid of it, too. However - the UnifiedNlp is a "subset" of GmsCore, so to say, and therefore I think you would need a similar file to reflect the NLP package, so most probably, same contents for package name "org.microg.nlp", except for FAKE_PACKAGE_SIGNATURE ? So in fact purge the file, but add a file /system/etc/permissions/privapp-permissions-org.microg.nlp.xml to your install list with the below content (make sure the package name is correct, I am not 100% sure:

<?xml version="1.0" encoding="utf-8"?>
<permissions>
<privapp-permissions package="org.microg.nlp">
<permission name="android.permission.INSTALL_LOCATION_PROVIDER"/>
<permission name="android.permission.CHANGE_DEVICE_IDLE_TEMP_WHITELIST"/>
<permission name="android.permission.UPDATE_APP_OPS_STATS"/>
</privapp-permissions>
</permissions>

There are also the following files being installed as part of microG - not sure how you think about those:

/system/etc/permissions/com.google.android.maps.xml
/system/framework/com.google.android.maps.jar

They aim at implementing a "redirect" to OSM for apps wanting to access Google maps. (still WIP on microG site). So in fact not contacting Google . . .
[Moto G Android Development] Scranalot:
Thanks for the response & advice :good:

won't be tested until October OTA update (not wishing to be presumptuous :fingers-crossed: )

No the package name is still com.google.android.gms strangely :confused:

So I'll remove the line:

<permission name="android.permission.FAKE_PACKAGE_SIGNATURE"/>

from the /system/etc/permissions/privapp-permissions-com.google.android.gms.xml file & add that to my my list of backup files in my

/system/addon.d/51-microg_changes.sh

script plus

rm /system/etc/permissions/privapp-permissions-com.google.android.gms.xml

to the

pre-restore)

section of the script so the newly installed privapp-permissions-com.google.android.gms.xml file from the OTA update gets removed then the 'old' privapp-permissions-com.google.android.gms.xml gets restored ;)

Regarding

I think I'll leave them be for the time being & seems innocuous enough - even advantageous perhaps :silly:

So here's the amended script now:

#!/sbin/sh
#
# /system/addon.d/51-microg_changes.sh
# During a LineageOS 14.1 upgrade, this script backs up NetworkLocation.apk,
# /system is formatted and reinstalled, then the files are restored.
#

. /tmp/backuptool.functions

list_files() {
cat <<EOF
/system/priv-app/NetworkLocation/NetworkLocation.apk
/system/etc/permissions/privapp-permissions-com.google.android.gms.xml
EOF
}

case "$1" in
backup)
list_files | while read FILE DUMMY; do
backup_file $S/"$FILE"
done
;;
restore)
list_files | while read FILE REPLACEMENT; do
R=""
[ -n "$REPLACEMENT" ] && R="$S/$REPLACEMENT"
[ -f "$C/$S/$FILE" ] && restore_file $S/"$FILE" "$R"
done
;;
pre-backup)
# Stub
;;
post-backup)
# Stub
;;
pre-restore)
rm /system/etc/permissions/privapp-permissions-com.google.android.gms.xml
;;
post-restore)
rm - rf /system/app/AuroraStore
rm - rf /system/app/GsfProxy
rm - rf /system/priv-app/AuroraServices
rm - rf /system/priv-app/FakeStore
rm - rf /system/priv-app/GmsCore
rm /system/etc/permissions/privapp-permissions-AuroraServices.xml
rm /system/etc/permissions/privapp-permissions-com.android.vending.xml
;;
esac

Cheers :)
[Moto G Android Development] MSe1969:
You can,

and you should

, test it by simply manually flashing my current build over your setup and see the result.

confusing for me, too, but you have verified it on your end, so it'll be

Don't over-engineer! This is not necessary, backup your modified XML file and let it simply be restored, it'll overwrite and hence all ok
[Moto G Android Development] Skyfly19:
Hello,

I have done a clean flash of your rom version B (20200917), everything is working fine except one thing:

A modification about the networking (I think the "Cloudflare as default DNS") totaly broke the noroot firewall app (v4.0.2) filtering.

In noroot firewall, all connection was etablished by the system app and not the individual apps so I can't make custom rules for each app.

It is possible to fix this issue in the B version ?

Thanks in advance
[Moto G Android Development] MSe1969:
I am almost sure it is the SELinux rule to prevent apps from accessing /proc/net - as done in other cases, I could add an exception for such an app in my ruleset, as this could be a legitimate reason.

But I do that only, if it is a FOSS app not having Google play dependencies.

Can you post details about this app? I found one (probably closed source?) ref on play store, but not sure you refer to that one.

Right now, an exception is granted to NetGuard and tracker control. I think NetGuard (available also via F-Droid) might be a working alternative for you?
[Moto G Android Development] Skyfly19:
You are right the problem come from the "Access to /proc/net blocked for user apps' restriction.

I had move my firewall app to system app with link2sd and now the filtering work perfectly ! :)
[Moto G Android Development] derfraenk:
Regarding the loss of WiFi:

I flashed the test build variant A a few days ago. Today I'm having the effect on my falcon again. WiFi is enabled but not connected. When I search for networks, none can be found.

So I tried to collect logs with Matlog and attached them to this post. I'm not that experienced with that, so I hope there's nothing missing. What I did during the log recording:

* Go to Settings -> WiFi to make the system search for networks - wait ~10s

* Switch off WiFi -> Switch WiFi back on - wait ~10s

Some more infos which may or may not be useful:

* The falcon's system time is correct when I compare it to a computer with NTP and my other phone

* I currently have a theme with Substratum enabled on the falcon. I'm only mentioning this because a longer time ago I had strange problems with SIM card detection when a theme was applied. How or why, I don't know. Granted, this was a whole different problem, but since then I'm never sure whether Substratum can mess with other, unrelated things.

Edit: Some more info:

* OpenGapps pico is installed (Edit 2: pico, not nano)

* Magisk 20.4 is installed with Magisk Manager hidden and renamed

/Edit

For now I will not reboot my falcon to leave it in this state, in case I can provide more info. That also means I won't remove the Substratum theme, unless you tell me to, because I'd have to reboot for that. Please let me know if I can provide or test anything else.
[Moto G Android Development] Skyfly19:
Also, in the feature your say "OTA Support", while I go to lineageOS build it updater:

The connection pass but it don't find any update (I see the 20200927 version on sourceforge and I am on 20200917).

The OTA update will be available later ?

Or the only way to update it, is to flash to the new rom zip manualy ?
[Moto G Android Development] MSe1969:
Thanks for the log and the feedback! I can however only look later (maybe even only on Sunday or even next week). What should work immediately, if times are properly synched, is to enable flight mode and immediately disable it. You can try, and if that helps, it is at least a workaround.

The TimeService.apk for sure improves the situation (so it'll be part of the next build), but if it's not the 100% solution, I/we have to look further...

I can't (so I won't) exclude the possibility of a substratum theme causing issues, but so far I haven't considered it, because I can't connect the style overlays with WiFi issues (well, SystemUI.apk is affected and that one is deeply integrated, so a valid thought...) But your comment and the fact, that I have two falcons, one in variant A, without Gapps and almost "naked" and one in variant B having the FOSS default dark theme from F-Droid active makes me wonder, as the issue has only ever happened on the 2nd one . . .
[Moto G Android Development] MSe1969:
The updater will only find updates, if I update the static .json resource here (for variant A, look in branch cm-14.1-oms, for variant B in cm-14.1-mG-oms):

https://github.com/lin14-mGoms/OTA

I haven't done that on purpose, because the build from the 27th is explicitly a test build for those voluntarily testing (and not a build pushed out to everybody), so it has to be manually flashed.

But when I push the next build with October ASB, the updater will find the October build, irrespective of whether you are on the build from 27th, 17th or earlier (because I will update the .json resource)
[Moto G Android Development] derfraenk:
Thanks for your reply. I'm not sure if we should put too much emphasis on Substratum. It's really far fetched. The issue I used to have was on a different phone with a different ROM. But I wanted to bring it up.

Since you mention that it'll take some time for you to look at the logs, I'll go ahead and remove Substratum as well as the theme from my falcon. That way, if the issue still happens on my phone after that, then we can rule Substratum out.
[Moto G Android Development] MSe1969:
Yes, this approach works as well ;)

All user apps, different from system apps and priv-apps, are part of the SELinux domain "untrusted_app", and my SELinux rules disallow untrusted_app objects to access /proc/net
[Moto G Android Development] Scranalot:
Okey dokey - probably do this then ;)

See what you mean - I'll remove the removal then:

pre-restore)
rm /system/etc/permissions/privapp-permissions-com.google.android.gms.xml

thanks again for the advice :good:

Yes can recommend Netguard - been using it for over 2 years now - suits my purposes, perhaps yours too @Skyfly19? Also AFWall+ if you're willing to root your phone - have dabbled with it & seems too work well - more of a learning curve & can get involved - depends how far down the rabbit hole you want to go.

Having posted this I see you appear to have rectified your issue though:

Finally:

I have used Wi-Fi on my XT1033 extensively without any real noticeable issue for about a year now - no Magisk or Gapps - though is currently rooted (addonsu-14.1-arm-signed.zip) with AFWall+. Substratum is still installed but is unused - just my input FWIW :D
[Moto G Android Development] Skyfly19:
The original bromite system webview v85.0.4183.86 use only 52ko (52ko data and 0ko app size) if I upgrade it with the v86.0.4240.70 (40,5mb) from Fdroid repo :

The application size pass to 0kb => 96,88 Mo after the update.

Also the dev. settings => webview show only the AOSP webView and not the bromite webview.

It is normal ?
[Moto G Android Development] MSe1969:
Bromite uses the same package name as the AOSP webview: com.android.webview - that is why Lineage 14.1 shows this as AOSP webview. Newer relases of android look up the app name from the apk file itself.

In regards to the size info: System apps are located on the /system partition. This partition is mounted read-only and it does not matter, how much space is unused there, it is not available for any purpose.

If a system app is updated, the new apk is stored on the /data partition (and every further update replaces it). Space used on /data however definitely matters and is therefore shown as space usage.

In the case of webview, the apk in fact is only a container to the lib libwebviewchromium.so - and I think in case of an update into /data, this lib needs to be explicitly unpacked, too - this explains the double size.

Therefore, in the case of the falcon device, where space on /data is a precious good, I would only update webview, if suffering from a malfunction - and I'd uninstall the update again, when my next build with a newer webview version is shipped, to release that space on /data again.
[Moto G Android Development] MSe1969:
New builds with October ASB

Hi all,

new builds are available for download and will soon be offered as well via OTA update:

A. Default LineageOS 14.1 with substratum and microG patch

https://sourceforge.net/projects/li...1-20201010-UNOFFICIAL-oms-falcon.zip/download

ASB Security string 2020-10-05

Updated TimeService.apk (explanation below)

B. Hardened build with pre-installed microG and F-Droid, patched for substratum

https://sourceforge.net/projects/li...0201009-UNOFFICIAL-mG-oms-falcon.zip/download

ASB Security string 2020-10-05

Updated TimeService.apk (explanation below)

Bromite Webview on 86.0.4240.73

updated microG with included Exposure notification API (for Covid tracing apps - see below)

Updated TimeService.apk

System time is now also synchronized via WiFi network (if no SIM card is present).

This helps also to improve the situation, if idle WiFi connections drop after a while

microG with included Exposure notification API

microG now contains an open-source implementation of Google's Exposure notification API, which is used by many Covid tracing apps.

Please make sure to re-enable your configured coarse location providers in the microG settings as a one-time activity after the upgrade.

Happy flashing!

Regards, M.
[Moto G Android Development] ChrisRM:
Good as ever...

Just downloaded, updated and all works. The track&trace app locally is a pile of schrott, and doesn't want to use the camera for checking-in at places with the QR codes, but I can do that on my work phone as needed. Not your problem.

[Edit] That's why, I RTFM'd and it's Oreo or higher. Still schrott, though...

I'll keep an eye on the WiFi management and comment if I think I can add any value. Otherwise, another excellent job and thanks!
[Moto G Android Development] ChrisRM:
Nope, the wifi glitch is back again.

What logs should I collect and how best to collect them?
[Moto G Android Development] derfraenk:
I also have it again on the test build (this time without Substratum and themes installed), I haven't had time to flash the new release build or collect logs yet. Will do when I get time and if it happens again.

When I collected logs I used the app MatLog. It's on F-Droid but may also be on play store.
[Moto G Android Development] billthefarmer:
I've just installed the OTA update and the email widget still works, so either the older email version set it up correctly or the email widget bug is fixed in the latest build (20201010).
[Moto G Android Development] MSe1969:
The widget bug is not fixed, so seems your old version did the proper job and after the widget is installed, the widget works fine - so must be somewhere in the setup routine...

EDIT: Have found the bug and pushed a fix to the LineageOS gerrit:

https://review.lineageos.org/c/LineageOS/android_packages_apps_Email/+/289682

I'll include the fix into my next build anyhow.
[Moto G Android Development] Scranalot:
Further Update (for those that may be interested)

First of all thanks MSe1969 for the latest update - much appreciated ;)

Now regarding:

Well I implemented this script with the October OTA update & it failed :(

Micro-G UnifiedNlp (NetworkLocation.apk) & the modified privapp-permissions-com.google.android.gms.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.CHANGE_DEVICE_IDLE_TEMP_WHITELIST"/>
<permission name="android.permission.UPDATE_APP_OPS_STATS"/>
</privapp-permissions>
</permissions>

Were not installed when the phone rebooted :confused:

So I had a bit of a think & looked back over my previous dealings with /system/addon.d/ scripts & amended mine by:

Moving all the removal apps/scripts from post-restore) to pre-restore). This was so the MicroG related installation especially would be removed before the backedup items are restored & so not to 'interfere' with matters especially as the UnifiedNlp (NetworkLocation.apk) package still goes under the installed name of com.google.android.gms - which is the same when it is installed by GmsCore.apk

Amend the backup of the files from being within the system directory already (see amended script below)

#!/sbin/sh
#
# /system/addon.d/71-microg_changes.sh
# During a LineageOS 14.1 upgrade, this script backs up NetworkLocation.apk and amended privapp-permissions-com.google.android.gms.xml
# /system is formatted and reinstalled, then the files are restored.
#

. /tmp/backuptool.functions

list_files() {
cat <<EOF
priv-app/NetworkLocation/NetworkLocation.apk
etc/permissions/privapp-permissions-com.google.android.gms.xml
EOF
}

case "$1" in
backup)
list_files | while read FILE DUMMY; do
backup_file $S/"$FILE"
done
;;
restore)
list_files | while read FILE REPLACEMENT; do
R=""
[ -n "$REPLACEMENT" ] && R="$S/$REPLACEMENT"
[ -f "$C/$S/$FILE" ] && restore_file $S/"$FILE" "$R"
done
;;
pre-backup)
# Stub
;;
post-backup)
# Stub
;;
pre-restore)
rm -rf /system/app/AuroraStore
rm -rf /system/app/Calendar
rm -rf /system/app/Email
rm -rf /system/app/Exchange2
rm -rf /system/app/GsfProxy
rm -rf /system/app/MozillaNlpBackend
rm -rf /system/priv-app/AuroraServices
rm -rf /system/priv-app/FakeStore
rm -rf /system/priv-app/GmsCore
rm /system/etc/permissions/privapp-permissions-AuroraServices.xml
rm /system/etc/permissions/privapp-permissions-com.android.vending.xml
# rm /system/etc/permissions/com.google.android.maps.xml
# rm /system/framework/com.google.android.maps.jar
;;
post-restore)
# Stub
;;
esac

I replaced the old script with this new one (ensuring the permissions on the script are 755), reinstalled the OTA update & all seems to be good :good:

Well HTH - if it is of any interest :)
[Moto G Android Development] MSe1969:
Update of EMail app (fix widget issue)

Hi all,

for those of you interested, who do not want for the next build (maybe you, [MENTION=8385935]billthefarmer[/MENTION] ?):

I have created a flashable zip with the update of the AOSP E-Mail app to fix the widget issue described in this post

Happy flashing - regards, M.
[Moto G Android Development] MSe1969:
Hi all,

the below applies only to users of the build variant B:

An interim update of microG GmsCore is available for download here as flashable ZIP:

https://sourceforge.net/projects/li...s/microG-Update-20201017-testkey.zip/download

The apk has been built from the microG source.

Please only use for the build variant B of this ROM (falcon) or the peregrine ROM from this thread

This update contains the following fixes:

GCM sign-in issues

Mapbox issues

Various improvements of the exposure notification API

There is currently no official new version of microG, but due to some issues, which I have experienced myself in regards to the Covid tracing app and GCM sign-in and which were fully solved after applying the update, I wanted to offer it for those of you, who are interested. To update, simply download the linked ZIP file and flash via TWRP (disable ZIP signature verification).

Important hints:

One of the possible issues with the EN API is an incredible growth of the database and thus, the space used by the microG app (the respective Covid tracing app may also start to behave weird due to that). If you get the system message, that memory is becoming short, don't delete the app data of microG - the EN-DB will properly reorganize after flashing the update

The UI has been re-shaped internally. If you start the microG UI and what you see looks "weird" (e.g. Exposure notifications API not shown, or device registration and GCM looking "disabled"), don't panic and DON'T change any settings. Instead, please go to Settings - apps, pick the microG GMS Core app and purge the app's cache (only the cache,

and not the app data

!) - Afterwards, all will be fine.

Regards, M.
[Moto G Android Development] ChrisRM:
OK, done that, and the Falcon is still working, which is good. Haven't noticed anything else untoward, and will report back if I do...
[Moto G Android Development] ChrisRM:
WiFi still working...

This is the longest I've not had to go to airplane mode to recover WiFi. At this rate, I may switch mobile data back on again..
[Moto G Android Development] ChrisRM:
WiFi *still* working

I appreciate that this shouldn't be a thing but on an old phone like the Falcon, it is. This last piece of work from [MENTION=7929484]MSe1969[/MENTION] has sorted my Falcon back to being every-day-usable; excellent work!
[Moto G Android Development] billthefarmer:
The titan build (lineage-14.1-20200808-UNOFFICIAL-titan) has the same bug and your update has fixed that as well.
[Moto G Android Development] MSe1969:
Yes, you can in fact use that ZIP on any 14.1 build, which hasn't been signed with a specific key.
[Moto G Android Development] Cephalophinae:
Thanks!

[MENTION=7929484]MSe1969[/MENTION]: I just wan't to say: Thank you!

What an awful project for such an old phone. And the documentation is also very accurate! Keep up the good work.

Thanks!
[Moto G Android Development] VovoKrall:
I've been using RR 5.8.5 for 3 years now, but it's unbearably laggy even after a factory reset.

I haven't installed a new ROM since them. I hope the installation goes fine. ??
[Moto G Android Development] VovoKrall:
How do I install Play Store?

I installed variant A but I have no idea what to do now.

EDIT: Is microg installed? There's not microg settings
[Moto G Android Development] MSe1969:
It's all described in the installation instructions in the OP.

Variant A comes without Gapps and without microG. If you need Gapps, you need to flash them together with the ROM, so in that case, go back to TWRP, make a factory reset and flash the Gapps. If you would like to use microG, you can simply download and install the apps via F-Droid or directly as Apk files from microg.org - but in that case I strongly recommend to consider Variant B instead.
[Moto G Android Development] VovoKrall:
Even reading carefully, this info passed me by.

I installed Variant B, but I didn't trust microg and Aurora to manage my apps, so I installed A + gapps.

It's now restoring my apps.

Thank you for the ROM!