yashsingh1/xdaforums huggingface dataset:
[Moto G 4G Android Development] xyel:
Can confirm with twrp-3.7.0_9-0 worked fine. So twrp 3.1.1.0 it's a no.

What I'll try now is flash and setup everything with latest twrp, backup and revert to twrp 3.1.1.0, then encrypt.

UPDATE about ENCRYPTION on LineageOS v16.0 : I was able to flash the latest november update 'clean install' with twrp-3.7.0_9-0 ( installed rom+gapps - NO magisk yet!). Then, to make encryption work, I downgraded twrp image to 3.1.1.0 and let lineageos encrypt the device. Once that done, I updated twrp image back to the latest version twrp-3.7.0_9-0 and THEN I installed MAGISK via twrp zip, and manually installed twrp apk on Lineageos. ( because I tested the encryption process having magisk aready installed, and it failed every time)

Now when I enter twrp, I'm not able to access/mount the DATA partition, twrp doesn't 'notice' it's encrypted or tries to ask for decryption password. so that's the only negative point when I need to BACKUP the whole phone, but not a big deal to me.

- I notice that if I disable lineageOS security password/pattern (to Secreen Lock: None), the phone still shows up as 'encrypted' on the OS, in twrp can't access data partition, and when I boot I'm not asked for passwords. ( so... how is it 'encrypted' still !? or was it never encrypted at all... and all it asked was for an 'unlock screen pass' at boot ? )

thank you!
[Moto G 4G Android Development] xyel:
sorry, duplicate post
[Moto G 4G Android Development] nikobadboy:
The only problem with this rom, so far, is randomly soft restart. I installed latest build with latest twrp using format all (cache,art,data,system,internal st. and format data/yes) and make data ext4 then restart to recovery. I installed open_gapps-arm-9.0-pico-20210610 immediatly after rom install then reboot to system. After usual configuration steps and updates from google play, do nothing on the phone, i have randomly soft restarts. In LineageOS 14.1 i have no problems, the phone runs perfect.
[Moto G 4G Android Development] xyel:
I agree, I couldn't find the source of 'soft restarts' .. but when I force close some google apps (especially those that run at boot) I get fewer(or zero) restarts. Obviously kind of useless since I need most of those apps running in background
[Moto G 4G Android Development] sdembiske:
Check out this article:

https://www.droidwin.com/remove-data-encryption-decrypt-data-twrp/
[Moto G 4G Android Development] sdembiske:
@xyel

LineageOS 14.1 is still based on the original 'official' Lineage uploads - LineageOS 16.1 is not and required a lot of modification by the original developer and a couple of contributing members. I believe one of the 'soft restart' issues is simply a lack of 'system' space and this has proven to be somewhat insurmountable. I.e., Running less than 10% system space can lead to this instability as can some troublesome apps (trouble shoot with a 'safe' boot).

After installing the rom (full clean) and Open GApps, also try rebooting to recovery again before installing Magisk.
[Moto G 4G Android Development] nikobadboy:
I'm sorry, it's a beautiful rom with a lot of customization available, but that system soft restart/reboot problem ruins everything and make me fuming. It's happening random once at 20/30 minutes or at couple of hours and it is frustrating. I will install the best rom, by far, for now: lineage-14.1-20221114-UNOFFICIAL-mG-oms-peregrine, and enjoy it. This rom is flawless and not plagued with that random soft reboot/restart. I know it isn't developer fault but it can't be used like a daily rom by me anyway; soft restarting 24/7 even when i make a call or using an app. :(
[Moto G 4G Android Development] sdembiske:
Understood - I personally run 14.1 on this backup phone (used mostly for streaming to flatscreen)- I find it smoother with fewer issues - if a way to expand the system partition could be found without hard bricking the phone (which I ended up doing ... fortunately using a blankflash file I was able to recover it), it might help but remains to be seen with 16.0
[Moto G 4G Android Development] nikobadboy:
Anyway, thanks for supporting this phone with new updates every month. It's a very old phone( a relic ) now and i think it's time to retire him and replace with other model with custom rom support and a not so big screen (5" screen is the best). I have a Poco X 3 Pro but for calls i still use moto g because it's small and does what i want: making/reciving calls. With poco in the pocket is like i have a brick, it's a big and heavy phone and i don't want to carry him just to use it for calls. Maybe you can update with december patch this rom: [ROM][LineageOS 14.1][substratum] for Moto G LTE [peregrine], microG version, if you can.

Thanks again for support.
[Moto G 4G Android Development] MobiRob:
Great, keeping this 10 year old phone alive, remarkably on the original battery.

Thanks for this.

However, I notice the filename lineage-16.0-2023-01-08 UNOFFICIAL-peregrine.zip does not match the one on the Mega link: lineage-16.0-20230108-UNOFFICIAL-h812_usu.zip .

So I'd like to be sure: is this right?
[Moto G 4G Android Development] sdembiske:
@NAZY1983 @IronTechmonkey @MobiRob

My apologies to you and the other members that may have downloaded it and tried to install it - I mistakenly uploaded the rom for my LG G4 in my rush - appreciate you spotting it. The link has been corrected in the original post.

Correct Link: https://mega.nz/file/1WwjyJbI#89KnFjwJYlJvamNkAC9cKYon6B2-agpzr1nAzjms7fI
[Moto G 4G Android Development] IronTechmonkey:
No worries on my account. Although the Moto G (4g) Peregrine is arguably the most complete small phone I've ever used (especially when it runs LOS) I've switched to the G Power series for daily use and have not been flashing Peregrine lately... although it's awesome to have the option to do so. Thanks!
[Moto G 4G Android Development] sdembiske:
Yes, makes for a great little back up phone. Picked up a Moto G Power (2021) - a lot of members seem to have shifted off to other phones.
[Moto G 4G Android Development] gingerlee:
*EDIT* - All the download and install problems below mysteriously seem to have disappeared! The USB stick I was using to do the flashing has stopped working, being now permanently corrupted. I have re-downloaded previously trojan flagged builds and they are fine. It really didn't occur to me that a dodgy stick would cause such an array of weird outcomes, sorry about that!

Good and bad news ...

I have not attempted to use the March build as I did all this before it was released.

I downloaded and installed the Feb build (lineage-16.0-20230219-UNOFFICIAL-peregrine.zip) took maybe 5 minutes for first boot then said something like 'factory reset' then rebooted to TWRP every time.

When I tried copying the January build to a usb stick on a Win 10 PC I was told 'Trojan:Script/Wacatac.B!ml detected'.

Then I tried LOS14 (lineage-14.1-20230314-UNOFFICIAL-peregrine.zip) and got the same 'Trojan:Script/Wacatac.B!ml detected' message.

I downloaded and installed the Dec build (lineage-16.0-20221212-UNOFFICIAL-peregrine.zip) there was no room with the latest GAPPS pico (no surprise, thanks for the warning) so I used the previously mentioned open_gapps-arm-9.0-pico-20210610.zip (thanks!) and it booted.

Android setup kept crashing at the same place so I removed the SIM and didn't let it connect to wifi and that then worked.

I inserted a 32GB SD card, set it as internal and in developer settings told it that apps manifest should be ignored so that all apps could be installed to external.

I installed about 20 apps that I use daily, some of them pretty big.

It crashed a couple of times in the first couple of hours of use but now it works really well!

I've been using lineage-14.1-20210930-UNOFFICIAL-peregrine.zip on my every day phone for the last 18 months and it has been great but it's getting really slow and running out of storage space.

If this build continues to stay fast (ish) and stable I'll be using it every day.

Thanks for your hard work but you may wish to look into the above issues.
[Moto G 4G Android Development] sdembiske:
If you did not do a Full clean flash (including 'format data > yes'), coming from 14.1 as indicated in the install instructions, that may be the reason for some of the issues you experienced. The other suggestion would be to make sure you have the latest TWRP from the TeamWin device's link ...

As no other member has commented on these issues to the same extent, I suspect the problem may reside on your installation method and perhaps your TWRP version.

While I appreciate your 'Thanks', I would appreciate it more if you use the 'Like' button, when logged in, to express it.
[Moto G 4G Android Development] gingerlee:
Thanks for your quick reply. Sorry, I didn't know how well tested your builds are and I thought (wrongly) that it would be useful for you to know my experience. Also, if there's a trojan in your build system I'm sure you'd really want to know about it. (there isn't I now believe!)

When installing, I'm pretty sure I did everything right including a Full clean and getting the latest TWRP but things just kept going wrong. The stick I was using has now stopped working so I have started using a different one and since then everything has been great! I Have re-downloaded builds without any issues. I have done virus scans of my system, my stick, the re-downloaded files and found nothing. I find it hard to believe that a failing USB stick caused such a range of weird issues but I have no other explanation. I have edited my original post so it doesn't give any false information and I have liked the Dec 22 build because, in contrast to other reports, it runs flawlessly for me.

Thanks again for making these builds available. My hobby time is taken up with the innards of OpenWRT, Enigma2, Raspberry Pis and gstreamer pipelines, so I'm really not keen on the learning curve needed to make my own build. I really am extremely grateful that I don't have to because of your builds.
[Moto G 4G Android Development] sdembiske:
As I just did a complete format & re-install of my Linux Mint OS (newest 'Vera') and re-did all my build packages before I did current build, I doubt very much that there is any 'Trojan' or any other malware that could affect the build process to cause the issues you experienced. A lot of members think wiping Data is the same as formatting the data partition - i.e., they don't really know what a Full clean install means which is why and where a lot of issues arise.

FYI: The latest MARCH build has been posted and I don't see why you would have only installed the Dec. version.
[Moto G 4G Android Development] jiriw:
Does the latest update contain the Firefox IP route call causes OS to reboot bug? I installed the October 2023 update over a 2019 version without wiping the data partition (did wipe the other 3: Dalvik, Cache and System). Unfortunately Firefox still crashed the OS (with it rebooting) after ~10 seconds when starting up the app.

I found several forum posts which talk about this bug related to recent versions of Firefox, where it calls IP route in the kernel, which then crashes Android OS on many devices and usually the answer is: update to the latest versions. Lineage OS 15 seems a popular target for this problem but I've also found some mentions of Lineage OS 16 having it and various updates for devices that would fix the problem (usually in the form of a kernel patch). Unfortunately it seems not to be the case with this version... (also, the bug is not mentioned in this thread a.f.a.i.k.).
[Moto G 4G Android Development] sdembiske:
There is no new development for 16.0 and I'm building only 14.1 now for my personal use only. Suggest you install an older version of Firefox as the newer versions don't seem to be supported.

Link: https://www.apkmirror.com/apk/mozil...ers-nightly-190701-1246-android-apk-download/
[Moto G 4G Android Development] jiriw:
I'll be stuck with Lineage OS 16 because for now I have a custom APK that requires a minimum of Android 9 to run (SDR++ for Android). I'm looking into compiling that project for a lower version of Android but currently I haven't have that working. So I'll be searching for an old APK of firefox ;)

Thank you for the confirmation.
[Moto G 4G Android Development] Allstargaurav:
There are patches needed in dt in order for them to work
[Moto G 4G Android Development] lucastracq:
thank you man, i've found this, it doesn't solve the problem but i'm pretty sure it's related because i tested tethering and hotspot after switching off data connection and they work flawlessly.

do you know what else is needed?
[Moto G 4G Android Development] sevenrock:
Still needed on P? https://review.lineageos.org/230797
[Moto G 4G Android Development] lucastracq:
probably not, i tested it and nothing changed. anyway in the commit message it says that having data connection always active breaks hotspot and this is what (as far as i can tell) is happening to us.

bear in mind that i'm a newbie so don't take seriously everything i say :p
[Moto G 4G Android Development] sdembiske:
[MENTION=4977500]sevenrock[/MENTION]

First up - thank you for all the work you put into this and for sharing it - very much appreciated

Couple of issues I ran into - thought I'd let you know.

Re: your local_manifest.xml file ...

<project path="packages/apps/Snap" name="LineageOS/android_packages_apps_Snap" />

Error: - returns repository not found - I deleted it in the local manifest.xml file and cloned it in from android_packages_apps_Snap in the Lineage 16.1 path. Did you mean to reference a different package?

<project path="system/qcom" name="LineageOS/android_system_qcom" groups="qcom" revision="lineage-15.1" />

<project path="vendor/qcom/opensource/cryptfs_hw" name="LineageOS/android_vendor_qcom_opensource_cryptfs_hw" />

Error: - returns duplicate path in manifest.xml - I deleted both in the local_manifest.xml file. Did you mean to reference to another path or version ... ?

Thanks again,

S.
[Moto G 4G Android Development] sevenrock:
Hi,

no, it should have cloned https://github.com/LineageOS/android_packages_apps_Snap/commits/lineage-16.0

Again no, both repos are disabled in https://github.com/LineageOS/android

system/qcom is not present at all upstream and cryptfs_hw is disabled:

https://github.com/LineageOS/android/blob/lineage-16.0/snippets/lineage.xml#L107

Did you patch files locally in .repo/manifests? Please check with

$ cd .repo/manifests
$ LC_ALL=C git status
On branch default
Your branch is up to date with 'origin/lineage-16.0'.

nothing to commit, working tree clean
[Moto G 4G Android Development] sdembiske:
Turns out it was a conflict with SnapCamera from another repo synced in. No problem - apologies.

Turns out they were already installed from another repo synced in - No problem - apologies.

Branch was up-to-date and nothing to commit with the working tree clean - Left the SnapdragonCamera in and removed the Snap from the local_manifest.xml

Don't think it will create any issues when building ...

Thanks,

Steve
[Moto G 4G Android Development] sdembiske:
I have had real issues installing these patches (no fault of yours, solely my lack of knowledge and experience in building), in particular, the python vendor/lineage/build/tools/repopick.py \ patch.

Would appreciate it if you could lay out the steps/commands you used to apply these patches. I'm new to building and would appreciate it very much. I've searched and read everything I can but haven't been able to solve fully. If not, could you provide a link to the raw versions with the patches incorporated? Not my preference as I want to learn but it would get me over this hump.

Thanks again,

Steve
[Moto G 4G Android Development] lucastracq:
i can tell you what i do, don't know if it's the best way.

just create a script like this

#!/bin/bash

python vendor/lineage/build/tools/repopick.py \
224813 \
225213 \
226148 226154 226236 226343 \
227108 227120 227260 227261 227821 \
229401 229612 \
230099 230610 230642 230755 \
231201 231599 \
233911 \
234020 234021 234168 234190 234351 234353

for i in \
pie-mode-bits \
pie-powermenu \
pie-su \
pie-trust-interface \
lineagehw-hidl \
pie-hw-fde \
pie-privacy-guard \
pie-hide-night-display \
torch-colorz \
pie-qcom-legacy-sepolicy \
pie-qcom-sepolicy \
fbe-wrapped-key \
pie-gallery2 \
pie-expanded-desktop \
pie-battery-styles \
wifi-dual-interface \
pie-fde-crash-fix \
pie-qc-telephony-ext \
pie-lineage-iosched-sepolicies \
; \
do
python vendor/lineage/build/tools/repopick.py -t $i
done

python vendor/lineage/build/tools/repopick.py -p -t \
pie-snap

save it with a .sh extension in the same directory where your source is and then execute it from terminal with

. [I]nameyoulike[/I].sh

if you need the other patch for qcom errors you can do it manually since it's small or create another file, copy and paste everything, save it in the same directory with a .patch extension and then from terminal

patch -p1 < [I]nameyoulike[/I].patch

remember that if it's the first time you are patching the source there is much to download and takes time, also the lineage devs are actively working on those patches so sometimes you can get errors.

have fun! :P
[Moto G 4G Android Development] sdembiske:
The bash script generates: cannot open the file - errno 2 - No such file or directory.

No fun just yet.
[Moto G 4G Android Development] lucastracq:
if you are following step by step sevenrock's guide and you haven't made changes to the source it MUST work. post the whole terminal output and give more infos if you want help.
[Moto G 4G Android Development] sdembiske:
Turns out it was a simple error on my part. I had put the script in the same folder as the repopick.py file instead up putting it at the top it in the general repository folder, so it was creating the error as a result of the path in the patch when trying to run it.

Script ran like a charm when I made the change.

Thanks for all the help - it's much appreciated.
[Moto G 4G Android Development] Allstargaurav:
New LineageOS 16.0 update is out!

Changelog:

Fixed Whatsapp and Instagram Issue

Enforcing Build

Many ROM side changes (Most of the features from 15.1 are back, although some switches won't work)

Added Snap Cam

Zram working again

Many other minor improvements

Lot more stuff which I am lazy to list flash and find yourself

Download: https://www.androidfilehost.com/?fid=11410963190603869829

Special thanks to [MENTION=4977500]sevenrock[/MENTION] it would not have been possible without him

Also thanks to [MENTION=9506906]RohanHasabe8[/MENTION] for server
[Moto G 4G Android Development] Allstargaurav:
Deleted [

Duplicate Post

]
[Moto G 4G Android Development] key-ancel:
Oh my god! Thanks! THANKS!!!!!!! Downloading... <3
[Moto G 4G Android Development] sevenrock:
FTR: This fix was found by [MENTION=8276284]Claymore1297[/MENTION]

https://xdaforums.com/showpost.php?p=78316884&postcount=19
[Moto G 4G Android Development] ThePiGuy:
What's your build environment (Linux distro and also CPU model)?

I have heard some AMD processors can't build Pie and error out somewhere
[Moto G 4G Android Development] sdembiske:
I'm building with Linux Mint 19 Xfce - the processor is an older Intel. Hasn't been an issue up to this point.
[Moto G 4G Android Development] ThePiGuy:
Hm strange...should be fine. Is this the first Pie build you have done or just the first build that has failed?
[Moto G 4G Android Development] sdembiske:
First for both - had build fail errors arise in this one but usually have disappeared when further commits have been made. In this case I'd like to know why the error is arising and how it might be addressed in order to solve it.
[Moto G 4G Android Development] sevenrock:
Which CPU do you have exactly? Please post /proc/cpuinfo

Please check https://github.com/sonyxperiadev/bug_tracker/issues/207#issuecomment-430704101

Maybe we can find out which cpu features are needed to build pie.
[Moto G 4G Android Development] sdembiske:
processor : 0

vendor_id : GenuineIntel

cpu family : 15

model : 6

model name : Intel(R) Pentium(R) D CPU 3.00GHz stepping : 4 microcode : 0x4 cpu MHz : 2400.000 cache size : 2048 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 2 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 6 wp : yes
[Moto G 4G Android Development] lucastracq:
so it should be a Pentium D 925, is that right?
[Moto G 4G Android Development] sevenrock:
Hiddenapi is build from source:

https://github.com/LineageOS/android_art/tree/lineage-16.0/tools/hiddenapi

According to

https://stackoverflow.com/questions/8556447/linux-core-dump-about-signal-4?rq=1

signal 4 can mean "You might have compiled code for a different processor model".

Is your toolchain compatible with your CPU or does it assume more CPU features

than your hardware provides?
[Moto G 4G Android Development] sdembiske:
Thank you for your input. I'm not sure how to assess if my toolchain is compatible with the CPU or what CPU features it's assuming. I saw the warning about the Java toolchain being outdated but have not been able to find out how to update it to overcome or solve it.

---------- Post added at 09:13 PM ---------- Previous post was at 08:16 PM ----------

It's a Pentium D 930 according to the Intel Processor Identification Utility.
[Moto G 4G Android Development] 197:
Thanks so much for all the work that's gone into this ROM, It's brilliant!

However, I have found that long pressing app icons and widgets doesn't do anything most of the time.
[Moto G 4G Android Development] akillenb:
Tried this build on my XT1045, two times - once doing a clean flash, and 2nd time doing a dirty flash from lineage 14.1. It would not connect to my wifi either time, though 14.1 works fine. Checked as many settings as I could think of, or find, but could not connect. I don't have a sim card in the phone, so wifi is the only way to connect.
[Moto G 4G Android Development] Oddb411:
Many thanks to Allstargaurav and sevenrock for their continued development of this ROM. The first build would cause constant crash notifications about apps and services being stopped, but this latest build has been incredibly smooth. I use a 2016 Pixel Sailfish as my primary phone, but have kept the Peregrine around for custom ROMs and as a Snapchat device. It's remarkable seeing the Moto G 4G run the same Android version alongside the Pixel 1.

As user 197 mentioned, the only hiccup I've had is when long-pressing apps will stop working. A reboot seems to fix it and I haven't had the issue since the day I flashed.
[Moto G 4G Android Development] Orchal48:
Hi,

Thank you for the hard work! Everything works pretty well except one thing. I don't know if you guys have the same issue.

I'm not able to add a "dun" apn type. It says my carrier does not allow it, except it's not true and it was working before with official lineageos 14.1.

I also can't edit some default APN or remove them like before.

I red that it could be an Android Pie issue. I already tried almost everything so I just wanted to let you know, and see if you have the same issue.

I red that using an old working telephony.db could work but I'm just too lazy to flash again my phone. It's not a big deal, I don't often use tethering.

USB tethering does not work too.

I also want to mention that bluetooth works perfectly!

Another issue which I don't use: when I tap Extended Desktop (sorry, I'm french and I don't know if it's the english name) in Settings->Display, it crashes.

I don't necessarily ask for help but if you want the logcat and all the information you request from the OP, I'll give you that.

Thank you again!
[Moto G 4G Android Development] sevenrock:
This issue seems not to be device-specific:

https://xdaforums.com/showpost.php?p=78466796&postcount=90
[Moto G 4G Android Development] Norde:
Hello and thanks for all your work on this Rom !

Works flawlessly (except for reported bugs and some missing graphical customization settings).

I noticed that the kernel is in version 3.4.

Would it be possible to use a kernel > 3.8 or add namespace support to 3.4?

(namespace support is necessary for the Hide function of magisk)