[Samsung Galaxy Mega] Superdiv:
LineageOS is a free, community built, aftermarket firmware distribution of Android 7.0 (Nougat), which is designed to increase performance and reliability over stock Android for your device..

#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 is based on the Android Open Source Project with extra contributions from many people within the Android community. It can be used without any need to have any Google application installed. Linked below is a package that has come from another Android project that restore the Google parts. LineageOS does still include various hardware-specific code, which is also slowly being open-sourced anyway.

All the source code for LineageOS is available in the LineageOS Github Repo. And if you would like to contribute to LineageOS, please visit out Gerrit Code Review.

Device-specific source code:

Device tree: https://github.com/42n4/android_device_samsung_i9152/tree/cm-14.1

Kernel source: https://github.com/42n4/android_kernel_samsung_i9152/tree/android-7.1

Compatibilitiy Patches: https://github.com/42n4/build_tools/tree/cm-14.1

WebView: https://github.com/pawitp/android_external_chromium-webview

Special settings: https://github.com/42n4/local_manifests_i9152/tree/cm-14.1

Downloads

ROM: Google Drive and WebDav - login/password 9152

Gapps: http://opengapps.org

What works?

Wi-Fi

Bluetooth

RIL (Calls, SMS, Mobile Data)

Sensors (Accelerometer, Compass, Light, Proximity, etc.)

Camera

Video (playback & recording)

Audio (playback & recording)

GPS

Everything else not listed under "known issues"

Known Issues

Screenshots and Recents App thumbnails are blank

Disable second SIM card

Runtime storage permission does not work properly (setns patches are not applied, see PermissionsHostTest CTS test)

Additionally, Dual SIM has the following limitations (once they work):

Both SIMs are always enabled (no way to disable one SIM)

"Receive incoming call while data is enabled" is always enabled

Installation Instructions

Make a backup!

Install a custom recovery with SELinux support (TWRP for Odin WebDav - login/password 9152)

Download the latest build

Wipe data/factory reset if coming from stock or another ROM (You may get a "staus 7" error if you fail to wipe.)

Flash the ROM and then GApps

Reboot your phone

Enjoy!

To upgrade to a newer build, simply flash the zip. There's no need for data wipe or flashing Google Apps again. (However, if you are experiencing strange issues, you may want to try a wipe.)

Changelog

20181504: Upstream merge, bugfix added SELinuxModeChanger v10 app
20180408: Upstream merge, update Kernel Auditor to version 0.9.10.6
20180306: Upstream merge, update Kernel Auditor to version 0.9.74.3
20182501: Upstream merge, [STRIKE]added SELinuxModeChanger v10 app[/STRIKE], update Kernel Auditor to version 0.9.73.4
20171111: Upstream merge, fix WPA2 Key Reinstallation Attacks (KRACK), update SuperSU to version 2.82
20171010: Upstream merge, update Kernel Auditor to version 0.9.73.1, fix import contacts with SIM-card.
20170909: Upstream merge, update Kernel Auditor to version 0.9.72
20170808: Upstream merge, update Kernel Auditor to version 0.9.71.1
20170718: Upstream merge, return of Gello browser
20170612: Upstream merge
20170505: Update to Android 7.1.2, upstream merge
20170411: Upstream merge, update Kernel Auditor to version 0.9.6.11
20170321: Upstream merge, preinstalled apps Screenshot, Kernel Auditor 0.9.6.9 and YahooWeatherProvider
20170307: Upstream merge, Launch SuperSU in Settings
20170224: Upstream merge
20170205: Initial release, flash SuperSU with ROM

FAQ

F2FS

This Rom supports f2fs since the latest build. Don't ask me, what it is. Just google it.

Instructions for f2fs:

Download the modified twrp recovery for f2fs based from here and flash it

Save your data, your whole internal storage will be formatted soon.

Put the latest rom build and gapps on your EXTERNAL sdcard

Format data and cache to f2fs using twrp recovery

Flash the rom and gapps

DO NOT FLASH A KERNEL, WHICH DOES NOT SUPPORT F2FS

If you want to revert back to the usual ext4 partitions, format data and cache with twrp recovery to ext4.

Reporting Bugs

You are allowed to report bugs only in this thread.

Grab a logcat right after the problem has occurred. (Please include at least a few pages of the log, not just the last few lines, unless you know what you're doing.)

If it is a random reboot, grab /proc/last_kmsg. (Do not bother getting a logcat unless you can get it just before the reboot. A logcat after a reboot is useless)

If the problem disappears after running "setenforce 0" from a root shell, grab /data/misc/audit/audit.log

Remember to provide as much info as possible. The more info you provide, the more likely that the bug will be solved. Please also do not report known issues. The following is a useful format to follow.

What is your--
Radio (baseband):
CM version:
CM Download url:
Gapps version:

Did you--
wipe:
restore with titanium backup:
reboot after having the issue:

Are you using--
a task killer:
a non-stock kernel:
CMSettings/Performance settings (other than stock):
Dual SIM:
other modifications:

Provide any additional information (observations/frequency of problem/last version it worked on/etc) as needed:

Credits

LineageOS team

@pawitp

@xenon92

@LuK1337

@andixlm

@KINGbabasula

@CoolDevelopment

@GHsR

XDA:DevDB Information

LineageOS 14, ROM for the Samsung Galaxy Mega 5.8

Contributors

GHsR, Superdiv

Source Code: https://github.com/LineageOS

ROM OS Version: 7.1.x Nougat

ROM Kernel: Linux 3.0.x

Version Information

Status: Stable

Created 05-02-2017

Last Updated 15-04-2018