• If you are experiencing issues logging in, we moved to a new and more secure software and older account passwords were not able to be migrated. We recommend trying to reset your password, then contacting us if there are issues.
  • Nearly done! Migration cleanup is mostly done. There are a small number of issues left that we continue to work on, but all the heavy lifting is done. We still would love to hear feedback over at this thread and also check out the new XDA app! Thanks and we hope you enjoy the new forums, and thanks for your support of XDA <3

[ROM][UNOFFICIAL][7.1.2][oxygen] LineageOS 14.1 with Enforcing SELinux

bneo99

Senior Member
Sep 24, 2014
72
115
0
Kuching
Code:
/*
 * I'm not responsible for bricked devices, dead SD cards, thermonuclear war, or you getting fired because the alarm app failed (like it did for me...). 
 * Please do some research if you have any concerns about features included in the products you find here 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. 
 * Your warranty will be void if you tamper with any part of your device / software.
 */

LineageOS is a free, community built, aftermarket firmware distribution of Android 7.1.2 (Nougat), which is designed to increase performance and reliability over stock Android for your device.

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 the Gerrit Code Review. You can also view the Changelog for a full list of changes & features.

Special thanks to ashwin007 for developing most of the code for this device. I've only added the SELinux policy for this device and rebuild it with the latest monthly security patch.

What's working :
  • Boots
  • Wifi
  • Bluetooth
  • Camera ( Videos And Photos )
  • Video Playback
  • Audio ( Record and Playback )
  • Audio Jack
  • Sensors
  • GPS
  • VoLTE
  • IR Blaster
  • Fingerprint Sensor
  • Tap To Wake
  • On-screen keys <-> hw keys toggle
  • Notification LED
  • No more weird colour profile issue
  • Enforcing SELinux

Known Issues :
  • You tell me

Instructions :
  • Download the latest build and Gapps.
  • Make sure you are on the latest TWRP build.
  • Reboot to recovery
  • Format Data and System
  • Flash the latest build and Gapps (optional)
  • Reboot

Downloads :

Source Code :

Reporting Bugs
  • DO NOT Report bugs if you're running a custom kernel or you installed Xposed
  • 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. Any bug not reported in the bug report format below may be ignored.

Code:
What is your--
LineageOS version:
LineageOS 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:
other modifications:
 
Provide any additional information (observations/frequency of problem/last version it worked on/etc) as needed:
XDA:DevDB Information
LineageOS 14.1 by bneo99, ROM for the Xiaomi Mi Max 2

Contributors
bneo99, ashwin007
ROM OS Version: 7.x Nougat
ROM Kernel: Linux 3.x
Based On: LineageOS

Version Information
Status: Beta

Created 2018-07-26
Last Updated 2018-07-29
 

Attachments

Last edited:

bneo99

Senior Member
Sep 24, 2014
72
115
0
Kuching
Last edited:

Litendria

Senior Member
Mar 18, 2015
73
28
0
Dortmund
What is your--
LineageOS version: 14.1
LineageOS Download url: https://androidfilehost.com/?fid=5862345805528058621
Gapps version: open_gapps-arm64-8.1-aroma-20180705

Did you--
wipe: format data
restore with titanium backup: yes
reboot after having the issue: ?

Are you using--
a task killer: no
a non-stock kernel: no
other modifications: none

Provide any additional information (observations/frequency of problem/last version it worked on/etc) as needed:
I flashed latest firmware before flashing rom but fingerprint doesn't work. I tried another versions of firmware but It didnt fix.
There is no Fingerprint option in Security settings.

My flash order: firmware > rom > gapps > magisk
 

hizhnjakov

New member
Sep 12, 2015
1
0
0
What is your--
LineageOS version: 14.1
LineageOS Download url: lineage-14.1-20180718-UNOFFICIAL-oxygen-enforcing.zip
Gapps version: open_gapps-arm64-7.1-micro-20180606

Did you--
wipe: format all
restore with titanium backup: no
reboot after having the issue: ?

Are you using--
a task killer: no
a non-stock kernel: no
other modifications: magisk

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

Excellent build! Thank you for making it on android 7!

For me:
The fingerprint scanner does not work, it is solved by goodix in the boot.
No backlight brightness adjustment for the navigation keys
The volume of the handset speaker on miui varies from very quiet to very loud, on all custom roms (including this rom) from medium to very loud (I do not like this especially when talking in a quiet room)
Instagram in the market writes that the device is not supported
Youtube behaves strangely (still testing it)
I use Russian and for me there are places in the settings that are written in English

I will test further and describe, I hope my feedback will help in the development of this rom!
 
Last edited:

bneo99

Senior Member
Sep 24, 2014
72
115
0
Kuching
What is your--
LineageOS version: 14.1
LineageOS Download url: https://androidfilehost.com/?fid=5862345805528058621
Gapps version: open_gapps-arm64-8.1-aroma-20180705

Did you--
wipe: format data
restore with titanium backup: yes
reboot after having the issue: ?

Are you using--
a task killer: no
a non-stock kernel: no
other modifications: none

Provide any additional information (observations/frequency of problem/last version it worked on/etc) as needed:
I flashed latest firmware before flashing rom but fingerprint doesn't work. I tried another versions of firmware but It didnt fix.
There is no Fingerprint option in Security settings.

My flash order: firmware > rom > gapps > magisk
I believe this is due to some of the devices using fingerprint sensors from Goodix while I've only written the sepolicy rules for the FPC variant.
Can you get the selinux denials and send it to me?

You will need to switch to permissive mode though. Use the SELinux manager module from magisk to switch to permissive mode.
Reboot the device, touch the fingerprint sensor a few times and run the following command
Code:
adb shell (not needed if you're using the terminal app)
su
dmesg | grep audit
 
  • Like
Reactions: Litendria

bneo99

Senior Member
Sep 24, 2014
72
115
0
Kuching
What is your--
LineageOS version: 14.1
LineageOS Download url: lineage-14.1-20180718-UNOFFICIAL-oxygen-enforcing.zip
Gapps version: open_gapps-arm64-7.1-micro-20180606

Did you--
wipe: format all
restore with titanium backup: no
reboot after having the issue: ?

Are you using--
a task killer: no
a non-stock kernel: no
other modifications: magisk

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

Excellent build! Thank you for making it on android 7!

For me:
The fingerprint scanner does not work, it is solved by goodix in the boot.
No backlight brightness adjustment for the navigation keys
The volume of the handset speaker on miui varies from very quiet to very loud, on all custom roms (including this rom) from medium to very loud (I do not like this especially when talking in a quiet room)
Instagram in the market writes that the device is not supported
Youtube behaves strangely (still testing it)
I use Russian and for me there are places in the settings that are written in English

I will test further and describe, I hope my feedback will help in the development of this rom!
The fingerprint scanner should be a Goodix variant, I don't have the sepolicy rules for it yet so it so will need the SELinux denials from dmesg to fix.
As for the navigation buttons backlight, I don't think LineageOS supports it natively so I won't be adding support for it.
As for the handset speakers, they both (earpiece, loudspeaker) sounds quiet enough. So I'm not sure how much softer we can go.
Instagram works fine for me in the Play Store, same for YouTube too.
The language thing should be a LineageOS thing, perhaps it's because the translation for Russian is still WIP?

My build fully relies on Ashwin's previous efforts with only the Selinux policy added by me. I have pretty much no experience in porting yet so hopefully we can get the rom to be better.

Thanks for the feedback!
 
  • Like
Reactions: Alvaro Recoba

Litendria

Senior Member
Mar 18, 2015
73
28
0
Dortmund
I believe this is due to some of the devices using fingerprint sensors from Goodix while I've only written the sepolicy rules for the FPC variant.
Can you get the selinux denials and send it to me?

You will need to switch to permissive mode though. Use the SELinux manager module from magisk to switch to permissive mode.
Reboot the device, touch the fingerprint sensor a few times and run the following command
https://pastebin.com/raw/UVJNYvYa
 

Litendria

Senior Member
Mar 18, 2015
73
28
0
Dortmund
Don't see any denials related to the fingerprint sensor. When you set it to permissive, does the fingerprint sensor work? Could be something else entirely.
But your logs did help me realize that I missed a policy rule with the bluetooth service.
No, it didn't fixed but I flashed patched boot.img and fingerprint works now.
By the way safetynet doesn't pass.
ctsProfile: false

Rom is good and fast and since it's nougat rom, no issues in incall volume or quickcharging. Thanks
 
Last edited:

bneo99

Senior Member
Sep 24, 2014
72
115
0
Kuching
No, it didn't fixed but I flashed patched boot.img and fingerprint works now.
By the way safetynet doesn't pass.
ctsProfile: false

Rom is good and fast and since it's nougat rom, no issues in incall volume or quickcharging. Thanks
What is this patched boot.img that you are referring to?
 

evoGage

Senior Member
Mar 5, 2011
210
37
28
So far everything seems fine but the CPU doesn't seem to go below 1600mhz causing a slight battery drain. Also the bluetooth mac address is not correct.
 
Last edited:

jbmc83

Elite Member
Oct 12, 2011
3,741
1,838
113
Singapore
So far everything seems fine but the CPU doesn't seem to go below 1600mhz causing a slight battery drain. Also the bluetooth mac address is not correct.
check via kernel adiutor in thermal settings and make sure only "core control" is ticked. if one of the other two is also enabled, this causes the CPU not to downclock properly.
 
Last edited:

evoGage

Senior Member
Mar 5, 2011
210
37
28
check via kernel adiutor in thermal settings and make sure only "core control" is ticked. if one of the other two is also enabled, this causes the CPU not to downclock properly.
Nah its nothing to do with that. I flashed the permissive version and it was downqclocking fine. The enforcing version seems to stay at 1.6ghz for some reason. Could be just myself.