[G2 Android Development] jb881122:
#include
/*
* Your warranty is now void.
*
* I am not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at me for messing up your device, I will laugh at you.
*/

LineageOS 19.1 for the LG G2 - An attempt to get a more recent version of Android onto this dinosaur of a device.

Over the past few months, I have been attempting to port LineageOS 19 to my LG G2 as my first taste of ROM development. I have since managed to yield a functioning ROM (albeit, still with minor issues).

Status

Working:

WiFi

Sound

USB Connectivity

Infrared

Accelerometer

Widgets

Flashlight

Bluetooth

RIL

Offline Charging

GPS

SELinux Enforcing

NFC

Lineage Recovery

Partially Working:

Chrome

Newer versions (109 and later) will give a white screen with the default settings. To work around this, you can install Chrome 108 first, disable the "enable-drdc-vulkan" flag, and finally install the newer version.

Display

On some occasions, the soft buttons become glitched with horizontal lines. Not a 19.1-specific problem, I noticed this on a LineageOS 16.0 ROM as well.

When there are notifications, the top portion of the lock screen sometimes appears black.

Camera

Mostly working, but there have been reports that forcing the flash to be on can crash the app.

Screen Recording

Same glitches as on 18.1.

Not Working:

FM Radio

As far as I can tell, this was never really a feature for LineageOS on this device, but it might not be impossible to add (on D802 & LS980 only; it's broken in hardware on other models).

I myself can only test for the D800, as that is the model I have. ROMs for other models are untested by me, so your mileage may vary. The D802 ones have worked for others before, but the rest of them are untested.

Screenshot

View attachment 5833529

(more screenshots attached to this post)

Downloads

Binaries: Sourceforge

Source Code: GitHub

How to Use?

The binaries above can be flashed using blastagator's TWRP in the same way as prior versions of LineageOS. You will also need a compatible bootloader version, which a Lollipop-based stock ROM can provide. Alternatively, you can install a bootstack (like the Lollipop bootstack for D800-D801 & *S980 or a hybrid bootstack for other devices), at the risk of accelerometer, NFC, and/or RIL not functioning.

Note: The Lollipop bootstack for the D802 contains an incompatible bootloader, so don't install that if you want to install this ROM.

This video by channel48 also goes over installing this ROM and various aspects of using it:

As for the sources, compile them the same way as 18.1 would be compiled, except use the lineage-19.1 branch of the LineageOS-UL repo instead, and between running "repo init" and "repo sync", download the local_manifest.xml file from the repository and place it in the .repo/local_manifests folder (which may need to be created). There may also be additional packages needed for your Linux distro, but I don't remember exactly what they are.

While I highly recommend sticking with LineageOS 18.1 if the G2 is still (somehow) your daily driver, hopefully, having this ROM out in the public will allow people to test it, find other bugs not listed above, and help to improve it (since my discretionary time for this will be limited). This also serves as proof that old grandpa isn't dead just yet! 🤣

Credits

@aleasto and LineageOS contributors (for supporting this device all the way to LineageOS 18.1)

@MetoIsTaken (for preliminary work on the g2-common repository)

Contributors to LineageOS 19 for HTC and Samsung MSM8974 devices, as well as the G4 (for providing ports to similar devices from which I could reference)

LineageOS-UL team (for also having fixed many of the problems I have ran into)

@rlawoehd187 for continued work, especially on the Korean f320 model

@Concept48 for making a video of this ROM

Likely others not listed here, let me know if I forgot someone who should be listed