Change SELinux status to Permissive

carl1961

Senior Member
Dec 5, 2010
7,516
6,198
0
Tickfaw
SELinux on Android

Just a good right-up on SELinux For those who don't know what SELinux is.

SELinux on Android

---------- Post added at 10:11 AM ---------- Previous post was at 09:23 AM ----------

@Walter.White

Still enforcing

I opened the script and it says it changes it to the same thing that it starts out with. Unless I'm reading it wrong.
@clothednblack

"SELinux is set to: `getenforce`" means Get the current SELinux status
 
Last edited:
  • Like
Reactions: clothednblack

mikep90

Senior Member
May 24, 2014
568
540
0
@Surge1223 Would you happen to know what the heck is going on? This little hack/script works perfectly on my phone but doesn't seem to work for anyone else. Even though most of us are on same Kernel, same BL, same modem and essentially same ROM.
It works for me perfect. I'm on all the way NC2 everything running dynamic kat 6.1. I try the temporary one where you have to after every boot and it did it the first time I try it.
 
  • Like
Reactions: bri315317

Namelesswonder

Senior Member
Jan 26, 2014
173
204
83
I was able to get it to work! But it was the manual method and not the automatic method. I'll post up some pictures also to show you what I did, but here are some details about my phone:
DK 6.1
GPE Theme
MLG Bootloader
NC2 Modem
NC2 Kernel
Not network unlocked

Edit: Could an init.d script run the sh script to get it working?

---------- Post added at 09:29 PM ---------- Previous post was at 09:17 PM ----------

Sorry for the double post... but I have figured out how to get the automatic script to work!
The rest of the init.d scripts (if you have DK I'm assuming) all have numbers before them (e.g. 00runthis, 04runafterthat, 08sdcardstuff, 99runlast).
You have to rename the script to
Code:
99SE_Status_Change_via_kmem
and set the permissions to 0777.

 
Last edited:

Walter.White

Senior Member
Nov 28, 2013
1,273
2,062
0
I was able to get it to work! But it was the manual method and not the automatic method. I'll post up some pictures also to show you what I did, but here are some details about my phone:
DK 6.1
GPE Theme
MLG Bootloader
NC2 Modem
NC2 Kernel
Not network unlocked

Edit: Could an init.d script run the sh script to get it working?

---------- Post added at 09:29 PM ---------- Previous post was at 09:17 PM ----------

Sorry for the double post... but I have figured out how to get the automatic script to work!
The rest of the init.d scripts (if you have DK I'm assuming) all have numbers before them (e.g. 00runthis, 04runafterthat, 08sdcardstuff, 99runlast).
You have to rename the script to
Code:
99SE_Status_Change_via_kmem
and set the permissions to 0777.

Finally some success story. For me it even works without the number first.
 
Last edited:
  • Like
Reactions: carl1961

mikep90

Senior Member
May 24, 2014
568
540
0
Finally some success story. For me it even works without the number first.
I didn't try the automatic one just the temporary one so it wouldn't apply after I have rebooted the phone until I knew how to change it back after doing the automatic one. But I believe it would work if I would try it.

---------- Post added at 02:42 AM ---------- Previous post was at 02:39 AM ----------

Is there a way to change it back after the automatic one at boot and if so I will try it out to see if that will work.
 

Namelesswonder

Senior Member
Jan 26, 2014
173
204
83
Tried the auto and the manual. Still get enforcing. This is my current settings, do I need to change my baseband and kernel to NC2?
You'll need to update the kernel to NC2, not your bootloader (if it is on MLG). To do so just download the file Walter.White linked in the OP and open up Odin and click AP and then select the downloaded file and flash it. This only changes the kernel, which can be freely changed.

I had got the manual one just like how he said to do it. I never try the automatic one until I know how to change it back.
All you would have to do is remove the init.d script and reboot, the automatic one just does what the manual one does except when your phone boots.
 
Last edited:

clothednblack

Senior Member
Apr 27, 2011
4,436
5,593
0
47
Smith River
Here is a way for us to change the SELinux status to Permissive on our ATT N3.

Prerequisites
1. Busybox must be installed.
2. Have to be on NC2 Kernel. If not then download it from here (http://d-h.st/lBR) and flash it using Odin (select PDA). (You DON'T have to upgrade your BL to NC2. Just the kernel. I'm still on MLG BL, so I can still roll back to 4.3 if I wanted).

Instructions: (only if you plan on applying manually after every reboot)
1. Download http://www78.zippyshare.com/v/1605705/file.html
2. Move the file to /data/local/tmp/
3. Change Permission to 0755 (-rwxr-xr-x)
3. Open up the Terminal Emulator and type the following.
Code:
su -c /data/local/tmp/SE_Status_Change_via_kmem.sh
4. Enjoy.

OR

Instructions: (to apply automatically at reboot)
1. Download http://www78.zippyshare.com/v/1605705/file.html
2. Change its name from "SE_Status_Change_via_kmem.sh" to "SE_Status_Change_via_kmem"
3. Move that file to /system/etc/init.d/
4. Change permission to 0777 (-rwxrwxrwx)
5. Reboot.

Proof.






Here is my proof
Your screenshots show hardware at the bottom, mine doesn't, doubt that has anything to do with it, just noticed is all

---------- Post added at 07:35 PM ---------- Previous post was at 07:32 PM ----------

You'll need to update the kernel to NC2, not your bootloader (if it is on MLG). To do so just download the file Walter.White linked in the OP and open up Odin and click AP and then select the downloaded file and flash it. This only changes the kernel, which can be freely changed.



All you would have to do is remove the init.d script and reboot, the automatic one just does what the manual one does except when your phone boots.
I have that
 

Walter.White

Senior Member
Nov 28, 2013
1,273
2,062
0
Your screenshots show hardware at the bottom, mine doesn't, doubt that has anything to do with it, just noticed is all

---------- Post added at 07:35 PM ---------- Previous post was at 07:32 PM ----------



I have that
You will see the hardware. Just scroll up. Mine shows everything in one screen because I changed the dpi to 400.

@mikep90 you can try the automatic one. Just delete the script from the init.d folder and it will revert back automatically after reboot.

We need to figure out the common thread between mine, @mikep90 and @Namelesswonder phone, so that we can figure out why it only works on this 3 phones.
 
Last edited: