[Android General] ivelischt:
I DONT TAKE ANY WARRANTY WHATSOEVER IN ANY DAMAGE THAT MAY RESULT IN FOLLOWING THIS GUIDE OR USING THE SOFTWARE, ROM IN QUESTION, IN ANY WAY, MAY IT BE AS INTENDED OR NOT. IF YOU HAVE ANY FEELING YOU COULD END UP SUING ME FOR RISKS *YOU ALONE* ACCEPTED TO TAKE, YOU SHOULD IMMEDIATELY STEP BACK AND LEAVE THIS POST, ALL THE OTHERS: BE CAREFUL.

YOU WILL LOSE ALL OF THE DATA ON YOUR PHONE'S USERDATA, CACHE AND SYSTEM PARTITION AND THE PHONE WILL BE FACTORY RESET!

STOCK FIRMWARE INSTALLER: https://support.wikomobile.com/maj/Lenny5_OPE_V34.zip <-- if you brick your device.

Hey folks

This is just a brief explanation on how i built this ROM, a complete guide to building the rom may be published at a later point in time. For the Downloads, go to the Links section. The flashing guide will be focused on Lenny 5, but the image may work on other treble-enabled devices, too, so feel free to try and report if your device works with this build.

Build variant: arm-aonly-floss-su-userdebug

If there's interest in other build variants (specifically with microg and floss - fdroid, moz-nlp, openweatherprovider - implemented), ask me, i will do my best.

Build description:

I have an old Wiko Lenny 5 around here and wanted to use it as a Kodi Remote etc. at home, but didn't want to use their stock ROM. Also i wanted some freedom in using my device, specifically a rooted device and microg implementation. After trying to build TWRP with no success and the Wiko Build information being massively outdated i then focused on Generic System Images, as Lenny 5 is Treble-enabled. Big thanks to [MENTION=1915408]phhusson[/MENTION] for the whole lot of effort he put into building AOSP GSI's (and also clues towards building LineageOS GSI's). After having AOSP9 installed on it for some time, i got bored and tried to compile LineageOS using the patch-and-build system provided on phhusson's github. That worked just great on AOSP9, but failed to build a bootable LOS16 in the first place. So after some recherche, i stumbled across [MENTION=4467696]AndyYan[/MENTION]'s thread, containing some LineageOS GSI's prebuilt and ready to use. These worked great on my phone, but as stated above, i wanted to customize my LineageOS even further, so i manually patched my build-tree with AndyYan's Lineage-Treble-Patches by doing what this build script does, tested and it booted (i guess it's mainly related to the SELinux Policies not being correctly built for LOS with only phh's treble-patches). So far so good.

Additionally, i implemented the MicroG services by cloning these prebuilts on github to the respective folder in the build tree and before the build executed

export WITH_SU=true

to include LineageOS's root system in the build. I adapted the treble_arm_afS.mk device config to not use phh's su and the device/lineage/floss.mk file to include

FDroid

FDroidPrivilegedExtension (which is being built from treble sources)

MicroG services (use Play Store Apps)

FakeStore (use Play Store Apps)

MozillaNlpBackend (MicroG Network Location backend)

NominatimNlpBackend (MicroG Network Location backend)

OpenWeatherMapWeatherProvider (for LineageOS Weather Provider)

You are then free to use no Playstore at all or i.e. Yalp Store to download Play Store Apps.

After downloading the Image you may need to Unpack it via 7-zip or another tool.

Flash the device:

To install this custom ROM on the Wiko Lenny 5, in your stock ROM go to Settings->Developer Options->OEM unlock->Enable. Also, in the Developer Options, make sure, ADB Debugging is active and, on prompt, accept debugging connections from your computer.

On your computer, enter Command Prompt and issue the following commands:

adb reboot bootloader
*wait for device reboot*
fastboot oem unlock [COLOR="Red"]<-- this will factory reset the device!!![/COLOR]
*press vol up on the phone to allow unlocking the bootloader, and wait for the phone to return to fastboot mode*
fastboot erase userdata
fastboot format cache
fastboot format system
fastboot flash system <path-to-the-downloaded-gsi>
*wait for each process to finish*
fastboot reboot

now, wait for the phone to reboot, it should, after some time, show you the usual LineageOS startup screen. Take your time to set up your phone. To make MicroG and FakeStore work properly, you will have to Go to Settings->Apps&Notifications->App-Permissions->Spoof package signature->Menu->Show System Apps and allow FakeStore to spoof Signature. Go to Settings->System->Advanced->MicroG Settings and add your Google account. Activate Device Registration. Then activate Google Cloud Messaging and Google SafetyNet, if you want to take advantage of those services. Inside the UnifiedNlp Settings choose MozillaNlp in the first, and NominatimNlp in the second setting.

Go back and choose "Self check", if required, if required, grant MicroG GmsCore the permission to spoof signature, this should make most of the boxes go "checked". If Phonesky shows errors about signature spoofing, this should normally be gone after a reboot of the phone (given you allowed FakeStore sig spoofing). Disable battery optimization and then reboot the phone.

Check back in MicroG Settings->Self check, if all the boxes have been checked. If not, most mandatory points are self-explanatory.

This Lineage ROM will not allow you to update to a newer version. I cannot guarantee continuous updates, but encourage you to try building LineageOS treble with the way explained above, yourselves. If enough interest is around, i will consider doing updated builds from time to time.

Update:

Today i compiled a recent source tree containing the 5th of October patches. I will try to keep up with updating the Image whenever security fixes are released. The download links below have been updated to the newest version. To update your phone without deleting the data on it (make sure you have adb debugging enabled), you can simply do

adb reboot bootloader
fastboot flash system <system-image.img>
fastboot reboot

and then give your phone some time to "update". it should boot normally without erasing your data.

Links:

ROM .7z [~430MB]

ROM .img (~1.1GB)

(version was compiled at 19th of October '19, containing the October 5th security fixes.)

Let me know if this works for you, too!

Cheers

ivelischt