[SELINUX] How to recompile kernel to change selinux policy - Huawei P20 Lite Guides, News, & Discussion

Hey guys,
I noticed that I can't change my SELinux to Permissive through whatever (Magisk Scripts, APPS, direct terminal command, flashing with TWRP...).
So I've done some research and it seems to be my kernel.
So my question is how do I correctly recompile my Huawei P20 Lite (ANE-LX1 8.0.0.126(C432)) to change that selinux force policy?
Thank you all in advance,
Aaron.

dump

Bump ! PL Not dump.... any luck with ur Q @TheSaltyOne2 & others . Can you PL point me to some online guide of how to compile new SeLinux Policy rules ? I used fbind in Permissive Selinux. With enforcing I cant bind mount even after using bindfs . I need to change SePolicy Rules. I am trying to understand how it can be done .

Related

switch selinuxmode to permissive?

Hey guys i have a little question. How can i switch to selinux permissive mode? I ask because of the xposed framework. Selinuxchanger app works but is too slow for xposed. Xposed recognizes the enforcing mode... Init.d doesnt work too.My device is lgg3 and i run the actual darkobas build with Johns 777 kernel. Is there another way? Which files i have to change?
Thanks!

[CLOSED][Overlay] Dil3mm4's Overlays for Prague Series devices (all variants)

This overlay APK it's "born" because of the necessity to overcome missing overlays (thanks Huawei, love ya xoxo) under /vendor/overlay .
What it does exactly?
Nothing more than adding AOSP overlay matching our device capabilities and also, inherits Prague power profile.
Do I need it?
Well, better having than don't.
This will conisderably enhance your experience on every GSI ROM giving better functionality overall.
Why you did that?
Because I'm sick of inheriting stuff that belongs to /vendor, in system.
Project Treble it's all about separating vendor implementation from system.
So why we should keep adding OEM stuff in there, if it doesn't belong no more in /system?
I have XYZ device with ZYX firmware can I use it?
As long as you're on a PRA-*** device (with a non-EMUI firmware), you're good to go.
Otherwise DO NOT USE IT FOR THE LOVE OF MANKIND.
I don't have PRA, but I want it on my Huawei device !
Well, that's fine, join the Telegram group @GSI_HI6250, so that you could help me with stock files grabbing to make an overlay for your device.
Overlay configs (aka "what does dis do, ser tell pl0x"):
Allows all rotations;
Configs autobrightness levels;
Configs autobrightness Lcd values;
Configs BLE;
Sets Doze Component;
Sets Doze After screen off;
Configs autopowermodes (doze related);
Configs power management on:
screen off due to proximity sensor interaction;
decouple on suspend state;​
Configs brightness doze value;
Configs Intrusive led;
Configs dual band wifi support (where available);
Configs hotswap (where available);
Configs Color Transform on HWC;
Configs VoLTE available (even tho it needs support on GSI side);
Configs WFC over IMS;
Configs wifi background scanning support.
Installation Instructions
Download the overlay from the Downloads session.
With root, push the overlay to /vendor/overlay. Create the folder if it doesn't exist.
Run the following command in a rooted terminal or ADB shell:
Code:
chcon u:object_r:vendor_overlay_file:s0 /vendor/overlay;chcon u:object_r:vendor_overlay_file:s0 /vendor/overlay/dil3mm4-overlay-PRA.apk
XDA:DevDB Information
[Overlay] Dil3mm4's Overlays for Prague Series devices (all variants), Device Specific App for the Huawei P8lite/P8 Lite
Contributors
Dil3mm4
Version Information
Status: Stable
Created 2018-06-26
Last Updated 2018-06-26
Definitely will be useful. Thanks a lot, Dil3mm4!
Hi Dil3mm4,
Thanks for your work, but I'm not sure what this app does exactly, will it help me for example with substratum themes? Thanks
Hi @Dil3mm4 let me understand correctly:
- i'm under LineageOS 14.1 (Haky86 version). Am i concerned with your fixes ?
- i plan to go to LOS 15.1. Should i flash LOS 15.1 before, then install your fixes ?
- if i can go to LOS15.1 from Prject Treble, what device should i choose ? A or A/B ? I assume this is ARM64.
Thank you VM back in the ROM selection after 1 year, and i have things to understand
Graveen said:
Hi @Dil3mm4 let me understand correctly:
- i'm under LineageOS 14.1 (Haky86 version). Am i concerned with your fixes ?
- i plan to go to LOS 15.1. Should i flash LOS 15.1 before, then install your fixes ?
- if i can go to LOS15.1 from Prject Treble, what device should i choose ? A or A/B ? I assume this is ARM64.
Thank you VM back in the ROM selection after 1 year, and i have things to understand
Click to expand...
Click to collapse
Our device is arm64 A only (PRA-LX1 is my device)
If the APK is included in the rom u want to flash just run the command below, if not, after flashing just install the overlay according to the instructions. Have a nice day!
I will probably make a question that doesn't make sense since it's probably hardware related. But will this overlay add 5ghz support to our devices?
mannas said:
I will probably make a question that doesn't make sense since it's probably hardware related. But will this overlay add 5ghz support to our devices?
Click to expand...
Click to collapse
Nope
UPDATE
-P compatibility
-Improved brightness levels
DOWNLOAD
Hey Dilemma! I have an issue with all the Treble Roms. After listening to music for a while, the playback stops and I have to restart it, or when I plug a headphone in and then out, sound usually doesnt come out of the speaker. Will this overlay fix the issues I have with treble Roms? Thanks in advance
Please help with a little overlay
Dil3mm4 said:
This overlay APK it's "born" because of the necessity to overcome missing overlays (thanks Huawei, love ya xoxo) under /vendor/overlay .
I don't have PRA, but I want it on my Huawei device !
Well, that's fine, join the Telegram group @GSI_HI6250, so that you could help me with stock files grabbing to make an overlay for your device.
Click to expand...
Click to collapse
Hello Dil3mm4.
Sorry to send you PM, i see after sending that's not ok. I really want to solve Overlay issue for my Huawei Fig-LX1.
I try to join Telegram group indicated by you but could not find it. Maybe is not existing anymore. So - my last chance is you to respond here.
I just want you to make an overlay for my phone to work better with Phusson Treble 8.1. Just tell me what files do you need and i will do it.
Maybe you answer me.
Thanks!
Hi, by fixing BLE, you mean bluetooth low energy, like huawei band, fossil Q ?
thanks
Thanks! U did great!
Hi
I've tried to install this file but after I've enter the code, it says system is readable only.
I've tried with adb shell and terminal(booth of them rooted) and it didn't work
I've even tried to mount system as rewritable but it didn't work.
I'm on Aex 6.6 latest version(and I was on PRA-LA1 8.0.0.370 C185 before i flashed this custom rom)
What should I do to fix this error?
Traceur017 said:
Hi
I've tried to install this file but after I've enter the code, it says system is readable only.
I've tried with adb shell and terminal(booth of them rooted) and it didn't work
I've even tried to mount system as rewritable but it didn't work.
I'm on Aex 6.6 latest version(and I was on PRA-LA1 8.0.0.370 C185 before i flashed this custom rom)
What should I do to fix this error?
Click to expand...
Click to collapse
install terminal emulator , put the .APK (be sure to rename the last build taking the -P ) in the mencioned directory but first run the following command:
su
mount -o remount,rw /vendor
after this you can run the command for the apk.
It worked for me. or at least.. didnt gave an error... so.. lolol
I think I've installed it correctly but How can I see changes? Nothing added!
Hello, I have a PAR-AL00 device. Can you make an overlay for me.and Telegram group @GSI_HI6250, I can't find it.Thank you verymuch.
I don't understand, where is the overlay link?
Edit : Sorry, I didn't know it was in the download tab.
I can't find it where is it?
artus777 said:
I don't understand, where is the overlay link?
Edit : Sorry, I didn't know it was in the download tab.
Click to expand...
Click to collapse
Is this overlay necessary under Lineage 18.1 (PRAGUE device and EMUI 8.0.0.390)?
@Dil3mm4 Thread closed! Please advise the moderators team (best via the report function) to re-open the thread when ready to provide a download link for this former DevDB thread.
Regards
Oswald Boelcke
Senior Moderator

Lineage OS Build Error: The following domains violate the Treble ban

Hi there,
I've been trying to build Lineage OS 16 for my Zenfone 4 Max and I've been running into a problem. The build went fine for a while but it ended up failing with the error:
Code:
SELinux: The following domains violate the Treble ban against use of the binder_in_vendor_violators attribute: gx_fpd hal_fingerprint_msm8937 mm-qcamerad
. I have searched on google and on this forum for what the error means and I can't find anything. Can anyone tell me what it means and how to fix it?
Thanks in advance
ThatWeirdAndrew said:
Hi there,
I've been trying to build Lineage OS 16 for my Zenfone 4 Max and I've been running into a problem. The build went fine for a while but it ended up failing with the error:
Code:
SELinux: The following domains violate the Treble ban against use of the binder_in_vendor_violators attribute: gx_fpd hal_fingerprint_msm8937 mm-qcamerad
. I have searched on google and on this forum for what the error means and I can't find anything. Can anyone tell me what it means and how to fix it?
Thanks in advance
Click to expand...
Click to collapse
Is SELinux set to permissive on this particular build?
Sent from my moto g(6) play using Tapatalk
Sands207 said:
Is SELinux set to permissive on this particular build?
Sent from my moto g(6) play using Tapatalk
Click to expand...
Click to collapse
Yes, it is.
ThatWeirdAndrew said:
Yes, it is.
Click to expand...
Click to collapse
I would try setting it to enforcing and trying again, changing after the build is done may be your only option. The reason it fails is because running permissive causes safety net to fail, which is a violation to build and distribute. I don't know much more than that but hopefully it helps. You also could try recompiling without that binder or removing the binder in question and see if the build finishes.
Sands207 said:
I would try setting it to enforcing and trying again, changing after the build is done may be your only option. The reason it fails is because running permissive causes safety net to fail, which is a violation to build and distribute. I don't know much more than that but hopefully it helps. You also could try recompiling without that binder or removing the binder in question and see if the build finishes.
Click to expand...
Click to collapse
So I changed
Code:
BOARD_KERNEL_CMDLINE
in my device's BoardConfig.mk file from
Code:
androidboot.selinux=permissive
to
Code:
androidboot.selinux=enforcing
and it still gives me the same error. Is there somewhere else that I need to change a setting?
ThatWeirdAndrew said:
So I changed in my device's BoardConfig.mk file from to and it still gives me the same error. Is there somewhere else that I need to change a setting?
Click to expand...
Click to collapse
This shows the bigger picture of SELinux policy and how it is implemented https://source.android.com/security/selinux/implement#key_files
In addition to BoardConfig.mk i believe other changes will need to be made.

How to set SELinux to permissive in android 11?

Hello, I've rooted my device, but I can't set onto magisk setenforce=0... what can I do in order to have a permissive linux? It looks like this issue is present on all samsung devices...
robi101012981 said:
Hello, I've rooted my device, but I can't set onto magisk setenforce=0... what can I do in order to have a permissive linux? It looks like this issue is present on all samsung devices...
Click to expand...
Click to collapse
Have you tried this app:
[APP][TOOL][2.0+][OFFICIAL]The SELinux Switch
The SELinux Switch . What's The SELinux Switch & What Makes It Different from The SELinux Toggler? I'll outline this in brief since it would take too much time and space in explaining everything in detail. Primarily, The SELinux Switch was...
forum.xda-developers.com
It_ler said:
Have you tried this app:
[APP][TOOL][2.0+][OFFICIAL]The SELinux Switch
The SELinux Switch . What's The SELinux Switch & What Makes It Different from The SELinux Toggler? I'll outline this in brief since it would take too much time and space in explaining everything in detail. Primarily, The SELinux Switch was...
forum.xda-developers.com
Click to expand...
Click to collapse
Solve it by flashing a custom kernel that allows SELinux to be Permissive.
robi101012981 said:
Solve it by flashing a custom kernel that allows SELinux to be Permissive.
Click to expand...
Click to collapse
Hi I'm using a Samsung Galaxy A03s, android 12
please what Kernel could I use to get selinux permissive
I'm on Samsung a127f using custom ROM CrDroid 9.2 but still setenforce 0 doesn't seem to work. Selinux mode changer doesn't work also. Any help on how to switch selinux to permissive would be greatly appreciated

V4A presets

I have been trying to install v4a presets on my Oneplus but I cant seem to get them to work. I tried a method from another post on here which said to just make a presets folder (/internalstorage/viper4android/presets) and to copy the xml files into there, but then v4a didn't recognize them.
I also installed a folder of like 1600 presets from here too and looking through them I noticed they all have similar names like "headset.xml" or "bt_a2dp.xml" so I was wondering if that has a meaning or if I can change them since I want multiple files from the collection.
I am running lineage o and I am rooted on my oneplus 7t.
Needs to be selinux permissive for V4A to work
HueyT said:
Needs to be selinux permissive for V4A to work
Click to expand...
Click to collapse
Uhm can you elaborate
Use selinuxchanger.apk to switch to permissive and then V4A will work
Releases · MrBIMC/SELinuxModeChanger
Simple android app that sets SELinux into desired mode on each boot. I opensourced it because google banned such apps from Google Play. Licence is GPLv3. Enjoy! - MrBIMC/SELinuxModeChanger
github.com
HueyT said:
Use selinuxchanger.apk to switch to permissive and then V4A will work
Click to expand...
Click to collapse
Thanks for the suggestion, but I looked into it and apparently the version I'm using works with enforcing mode on. Also my problem was just with the presets which I managed to fix by just reinstalling the magisk module while keeping my presets folder in the v4a folder.
I still have not figured out what the filenames mean but I think it's just the type of output device while the folder gives it the name.
Still don't really know what SELinux is so I'm going to keep that on default for now. Seems to be a security protocol so I don't know if I want to turn that of.
Anyway thanks again for your help
Hey man maybe you can help me
I need a magisk flashable batch script for changing / replacing a value in many xml files per batch i wont to help the guys from viper4android maybe you know the tool following operations : open file - jump to row / string - read value - calculate new value - write value - save file - jump to next xml and so on.
Description : The values for surround section changed from 120 - 0 130 - 1 140 - 2 150 -3 160 - 4 170 -5 and so on until 8 old values : 120- 200 new values 0- 8
Maybe you can help me with this many people would be happy to solve the wrong conversion issue of viper4 Android presets or maybevyou know somebody

Categories

Resources