slim2none4u

Changing SeLinux from enforcing to permissive

Recommended Posts

Been looking around for most the day and can't find a conclusive answer so I bring the question here.

Does anyone know how to change the selinux policy from enforcing to permissive on stock TouchWiz?

Sent from my SM-G900R4 using Tapatalk

Share this post


Link to post
Share on other sites

Hmm I just went looking and found this:

http://forum.xda-developers.com/showpost.php?p=65850842&postcount=170

"On Samsung TouchWiz ROMs, you need to compile a kernel from Samsung source with disabled flag or this trick won't work."

Seems the kernel is hard coded to enforce. Another user suggested hexediting the kernel command line... (not what im going to try :)

Share this post


Link to post
Share on other sites

So I guess I need to learn how to make a kernel.

If anyone else wants to give it a shot, I'll flash it for em!

Sent from my SM-G900R4 using Tapatalk

Share this post


Link to post
Share on other sites

if you REALLY want to:

http://forum.xda-developers.com/showpost.php?p=59160364&postcount=23

 

not a really safe thing to do? I guess you could always just Odin back... does this seem like something you can do? I have a bit of Linux exper. if you want, I could try it. I just dont want to flash it. I work nights so maybe in 6-8 hours I can give it a shot.

 

I see a file called boot.emmc.win in my latest twrp backup folder. easy to hexedit. just edit that file and restore your backup including the boot (or just boot). don't see why that wouldn't work?

 

if it's a checksum problem, just disable md5 checking for that one flash...

 

Please let us know how it goes! AND why you want this? :)

here is mine (6.0.1) set to permissive?

oops - see below...

Edited by brianinmaine

Share this post


Link to post
Share on other sites

6971b9e7bffd3f07acd20f7999ed078f.jpg

Twrp manager doesn't see my currently installed recovery.

That's what got this little venture started.

Sent from my SM-G900R4 using Tapatalk

Share this post


Link to post
Share on other sites

Ahhh. Yeah mine is like that too. I don't think that one issue would be enough to set the kernel permissive from what I've read. Seems like a big fix for a minor detail.

TWRP still works, right? you can still reboot into it? Or you could try the whole hex edit thing if you want anyway. Good luck!

Share this post


Link to post
Share on other sites

Well that's not the only issue. That's where it started. Mobile Odin and flashfire also affected. I think it goes deeper still. Thinking it's a supersu issue to be honest. Or maybe the kernel used in the root process.

So I'm going to try the kernel first. Found a kernel kitchen tool and wiki explains the steps. So if I get some time I'm going to try to build a selinux permissive kernel. Fingers crossed

Sent from my SM-G900R4 using Tapatalk

Share this post


Link to post
Share on other sites

Don't use Moblie Odin is my advice.  

 

Swtiching SELinux to permissive can be done by flashing a kernel.  Find a compatible kernel for your device and Android version to flash that is SELinux Permissive and it will work.  

I don't know where to find such a thing, looked around on this site and didn't come up with anything.  Good luck!

Share this post


Link to post
Share on other sites

Just to add to what bornx said, mobile Odin USED to be the got-to amazing tool - but after Knox it has been pretty much crippled.

Sent from my Nexus 6P using Tapatalk

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now