yashsingh1/xdaforums huggingface dataset:
[Xposed General] ShinraTensei04:
How do I check if it worked in getting SELinux to permissive? I don't have the "SELinux status" shown in the system settings...

---------- Post added at 03:07 PM ---------- Previous post was at 03:06 PM ----------

What I did was delete the contents of the file, and then replace it with the stuff OP mentioned.
[Xposed General] krasCGQ:
Run this on terminal or ADB shell:

$ getenforce

It should outcome "Enforcing", "Permissive", or "Disabled".
[Xposed General] ShinraTensei04:
Nope, no reply comes back. Also, the "$" already there by default, I can remove it from any of the commands I try into the emulator....
[Xposed General] mrrocketdog:
not trying to butt-in. but for me , i type su (hit enter) ; then getenforce (enter).

"err on the side of kindness"
[Xposed General] krasCGQ:
Try with BusyBox.

I don't need SU access at all to run 'getenforce'...

​
[Xposed General] ShinraTensei04:
It's still showing enforcing even though I did all the steps. Only difference was, I already had a 08setperm file, which I had to delete the contents of, and then put in the new commands OP gave.

And that 08setperm file was created due to the init.d script from the app.
[Xposed General] krasCGQ:
What device are you using?
[Xposed General] ShinraTensei04:
Asus Zenfone 5, Android 5.0.
[Xposed General] ShinraTensei04:
How did you get permissive? I have a 08setperm file already, and it doesn't let me create another one...
[Xposed General] krasCGQ:
I'm on RR and the RR settings set the SELinux to Permissive after boot.
[Xposed General] *sigh*:
Tried it.. still doenst work
[Xposed General] ShinraTensei04:
Yeah, didn't work for me either. Sorry, forgot to update. =(
[Xposed General] *sigh*:
Still

Still dosent work
[Xposed General] Thor™:
Check this post, it worked for me ? my stock kernel doesn't have inid.d support.

https://xdaforums.com/g2-mini/general/guide-how-to-set-selinux-to-permissive-t3329439/page4
[Xposed General] Kevin Ismail:
Thanks, Dude.

It works for me but on my side I had to modify the first line,

from "#!/system/sh" to "#!/system/sh/bin"

Save the file somwhere, so that I can put it in every after updating the ROM. :o
[Xposed General] ThommmF:
Just a small typo:

#!/system/bin/sh
[Xposed General] Kevin Ismail:
You got it.. :p

Thanks.
[Xposed General] ManikandanGuru:
Not working in OnePlus 3T Resurrection Remix 7.1.1

even after edited this line.

#!/system/bin/sh

Help needed please.
[Xposed General] Kevin Ismail:
Hi.

On my side, if supersu and busybox are in place it should've worked properly.

Earlier before making mod I tried simulating it using terminal emulator. As usual I typed:

su

Setenforce 0

(Then checked selinux status, it was permissive)

Alternately then I typed:

Setenforce 1

(The selinux status switched to enforcing)

Exit

Exit

It worth trying.
[Xposed General] eexez01:
Fdroid ::::::>Selinux mode changer

Envoyé de mon FIND7 en utilisant Tapatalk
[Xposed General] Ibuprophen:
Though, the SELinuxModeChanger has not been updated nor supported for years and the New SELinuxToggler taken over for the SELinuxModeChanger, neither of them make permanent changes to the boot script.

This thread is dedicated for those who are looking to have SELinux Mode set within the Boot Scripts which is not offered on the SELinuxToggler nor its predecessor (SELinuxModeChanger).

I'm sure that the members here are aware of those options.

Sent on my Communicator [SCH-I535] from the Bridge of the U.S.S. Enterprise...
[Xposed General] FireAngel303:
SELiux Disabled

Hello

When i type in Terminal su and setenforce 0 it shows me SELinux is disabled

In TWRP Terminal setenforce 0 returns with command unknown.

How to enable SELinux?

Device : Samsung Galaxy trend Lite GT-S 7390 with CM11 - Beta2

Kernel : 3.4.5-Phoenix

TWRP : 3.1.0-0
[Xposed General] Didgeridoohan:
Uhm... Have you tried setenforce 1?
[Xposed General] FireAngel303:
Yes and it returns with the same Message : SELinux is disabled
[Xposed General] Didgeridoohan:
Ah... Might be that your kernel have SELinux disabled. Ask in your kernel thread.
[Xposed General] tpx00:
Works on Moto Z Play Nougat. Nicely done.
[Xposed General] Kap_Tutan:
Bro how did you manage to successfully work it? I have moto z play custom rom. Care to share? Thanks
[Xposed General] tpx00:
I use Xplore as my file explorer. Went to system/etc/init.d/ opened it there was one other file in there and created a new file called 08setperm once u opened that type in commands

#!/system/sh

setenforce 0

Save and reboot
[Xposed General] godkingofcanada:
Find the app on here called ISU. It hides super user, but it also gives the option to set enforcing or non enforcing. It works with cm or lineage root. I just stumbled across it earlier tonite.
[Xposed General] godkingofcanada:
It looks like this
[Xposed General] mrrocketdog:
http://xdaforums.com/showthread.php?t=3478348
[Xposed General] Sivabalan:
Nothing is working in OnePlus 3 open beta 25 Oreo.

Both the init.d script and placing a script inside bin folder. Anybody please tell me how make selinux permanently to permissive mode??
[Xposed General] baskaflyfer:
Edit boot.img in hex editor

add

androidboot.selinux=permissive

like on screen in attachment
[Xposed General] 123omari123:
I changed value in enforce file from 1 to 0 and system UI/phone stopped , what can I do? phone do not restart, screen do not works, don't do anything, the phone is like "powered off phone"...

I edited this file /sys/fs/selinux/ enforce, i wanted to disable selinux

s7 edge, exynos, rooted (magisk), android oreo.
[Xposed General] 123omari123:
fortunately,I force restarted phone and everything works, I have one question, how to disable Selinux (if it do not do any damage apps/anything in phone beside security)?
[Xposed General] voroxda:
As far as I know Selinux state is hard-coded in kernel. So you have to change the kernel. A lot of custom kernels make your system permissive.
[Xposed General] 123omari123:
if you can please tell me how to change or turn off/disable (best way) Selinux, or where to find full instruction of it?

I tried million things from google and youtube.
[Xposed General] voroxda:
Sorry I cannot fulfill your expectations, to give you a checklist or instruction set. You have to install a custom kernel for your device, maybe it's also necessary to install a custom ROM.

Google it, there is a lot of documentation also in the XDA specific for your device.
[Xposed General] 123omari123:
ok thanks
[Xposed General] mrrocketdog:
would this https://xdaforums.com/showthread.php?t=3881164

"kernel sepolicy" be of help?
[Xposed General] kevintm78:
If you're building the kernel from source you could try this:

https://github.com/kevintm78/Flashpoint-F_3/commit/ff894de7b8cfd0c0ce5a1201075056be2ed1a4af

It worked for my device.
[Xposed General] Vij4k:
You forgotten about init.d, because when i wrote in terminal "mkdir ..." i get error.

I install init.d enabler from GP and i get info "Your kernel is not support init.d". What the ..?

I have CM12 ofcourse.
[Xposed General] Gundabolu SC:
Can you please elaborate?
[Xposed General] DualJoe:
On nightly roms (AOSP, CM..) you can take the boot.img directly from the zip file. If you want to change the current running kernel you would have to dump it with dd. For my device its something like this:

busybox dd if=/dev/block/platform/msm_sdcc.1/by-name/boot of=/sdcard/boot.img bs=1M

Edit the kernel command line in boot.img correspondingly (with a hex editor) and flash the kernel back. Its right at the beginning and is not covered by any checksum. I use a nightly CM12 zip image, delete the rom stuff (/system) and change the updater-script (META-INF/com/google/android/updater-script) so it only flashes the kernel. Alternatively, it can be reflashed with dd as well.

Just append this to kernel command line (marked in blue below). Don't forget the leading space.

androidboot.selinux=permissive
[Xposed General] Gundabolu SC:
Sadly i own a Moto Maxx which has got no cm12 but when i used the same hex editor as yours on STOCK boot.img, this is what i get, and the rest of it is some jibber jabber.... Not even a mention of selinux in the understandable stuff! :(
[Xposed General] DualJoe:
You have to paste it there yourself. The blue marked part is the new stuff. Just append it with copy&paste (Edit/Clipboard data/Write) or write it by hand.

androidboot.selinux=permissive

Don't forget the 'space' delimiter in front of it.
[Xposed General] Gundabolu SC:
Adding those lines is making the boot.img larger than my device's partition size so its failing... i even tried removing few lines and adding these but fails on me cuz partition size is 16,384 and the modified boot.img size is 16,385!! :(

Edit:- Just used another Hex editor and it works perfectly!!! This was one of the easiest method so far!! :D :D

Can i put my the edited boot.img in my device forum and credit to you of course?
[Xposed General] DualJoe:
You maybe used Edit/Clipboard data/paste on Winhex. That definitely increases file sizes and cannot work. That's why i explicitly wrote (Edit/Clipboard data/Write). That simply overwrites data. It shouldn't tamper with size or any other data at all.

Not sure if i understand that correctly but you have to flash it back to the same device, yes. There is nothing else to change. Just make sure you know how to flash that properly and it lands in BOOT partition where it comes from and nowhere else. Maybe keep a backup or rom images available on sdcard in case it doesn't work for you (for whatever reason).
[Xposed General] Gundabolu SC:
I know a little bit about android as well! :D I already had the boot.img dumped from my phone... Edited the boot.img with your instructions... Now flashed back the boot.img using fastboot! Everything is set!! :D Gonna share the modified boot.img on my Device's FORUM! :)
[Xposed General] DualJoe:
Now it makes sense. 'device forum' not 'device from'. :)

Sure, post as you like and thanks for testing that method.
[Xposed General] Gundabolu SC:
Pardon me for that typo! :D

Its 3 A.M from where i am from, i am half asleep! ;)
[Xposed General] hiratafabio:
I have just tried the method in the OP and it works like a charm! Running CM12.
[Xposed General] Vij4k:
Please help me. How you wrote this script in Terminal? How enable init.d? ;//
[Xposed General] Klaus N.:
@ DualJoe

Thanks for your helpful posting. Editing the boot.img is the solution also for my Xperia Z3. Now Xposed works, and I can finally use Xprivacy :D
[Xposed General] kabalah89:
Woow its working perfect on my lg g3 - resurrection remix rom :good:
[Xposed General] ilmec:
Awesome! Its working on my LG G3 D855 - CM12 20150308

Great job!
[Xposed General] Maddinuser:
I'm in z3 also, it would be great if you could share your Boot.IMG :)
[Xposed General] Klaus N.:
Ok, I'll share it in the evening, because I'm at work atm (10:50 h am).

@ Maddinuser

So, here's the modified boot.img for Xperia Z3 (D6603); I took the boot.img from cm-12-20150304-NIGHTLY-z3.zip

You've to flash it via fastboot command, indeed.

Thanks again @DualJoe

Alternatively take a look here: http://xdaforums.com/showthread.php?t=3045319
[Xposed General] miki.antena:
Hello, fellow from the future.

Thanks for the heads up. I'm glead to hear that March 8th build is going to work with this! :)
[Xposed General] Vij4k:
Method from http://xdaforums.com/showpost.php?p=59199354&postcount=34 #34 post i good for me on CM12 Sony Xperia Z1. ;) Thank's bro!
[Xposed General] manu44:
U r the man .. Worked like a charm on Xperia Z2 CM12
[Xposed General] rovo89:
Xposed should work even with enforcing SELinux. If you have troubles with that, could you please describe in more detail what doesn't work and post a logcat taken while the device is starting up?
[Xposed General] ares.:
even the selinux already permissive, but still, every time start the tablet, need to soft reboot again.

Then After soft reboot, everything work.

192414 is the one after reboot.

Trying the new version from Here

Then After first boot, got this.

194313

First boot, with permissive selinux, work fine so far.
[Xposed General] SpaceCadetWilliam:
rovo, I flashed the latest version you posted on your github, xposed-arm-20150308-1.zip, and it works perfect after reboot with both permissive and enforcing SELinux. I no longer have to soft reboot and change to permissive.
[Xposed General] avilash87:
Thanks
[Xposed General] NitrogenX2:
Note 4 permissive

hi my friends

I have A note4 exynos version and kernel stock. i want change selinux to permissive to run xmode app for android 5

i test selinux changer and not working

test terminal and setenforce 0 code and not workking

init universal say your kernel not support init and not working

please help me... tnx dudes
[Xposed General] Thaodan:
Another method is install abootimg (https://github.com/coruus/abootimg, https://aur.archlinux.org/packages/abootimg-git)

and rebuilt boot.img via: abootimg -c 'cmdline='<origcmdline> androidboot.selinux=permissive'' boot.img, then apply it by using dd or replacing boot.img in your rom and apply via recovery
[Xposed General] javiertech:
Solution:

su

mount -o remount,rw /system

mkdir /system/su.d

echo "#!/system/bin/sh" > /system/su.d/permissive.sh

echo "setenforce 0" > /system/su.d/permissive.sh

echo "0" > /sys/fs/selinux/enforce

chmod 755 /system/su.d/permissive.sh

This metod work on s4 i9500 on lollipop 5.0.1? Only i need is set the selinux to permissive and for now i can´t , i want install viper4android. Thanks.
[Xposed General] ldeveraux:
So install viper, it's irrespective of se permission status
[Xposed General] javiertech:
I tried and viper is not working, i have knox disabled and read in the forums that in lollipop is necesary set selinux in permissive mode, if not viper4android not work.

I install the last version of viper4android, but the driver fail install, and ask every time of open viper the install the driver.
[Xposed General] ldeveraux:
But you didn't read what Rovo wrote 3 weeks ago a few posts up:

"Xposed should work even with enforcing SELinux"

So you don't need to set permissive, what others wrote was incorrect.
[Xposed General] javiertech:
But .... i have and s4 i9500 lollipop stock 5.0.1, and for now xposed not work because touchwiz , so for now i can´t install viper4android or xposed, only changing the kernel, or other rom.
[Xposed General] NitrogenX2:
Any body help me ????

I need permissive mode to install and work with xmode on lollipop !!

All way test and not working

I need a developer !!

Pleaaaaaaaàse ......
[Xposed General] tzzeri:
Use a custom kernel
[Xposed General] smohanv:
Works perfectly. Thanks.
[Xposed General] ratosluaf:
It doesn't work on CM12.1. I do not know what I am doing wrong
[Xposed General] IaKnightHawke:
I found an app in the Play Store called SELinux Mode Changer. Give it a try and Thank me if I helped you.? Gary
[Xposed General] Borfas:
View attachment 3284764

how download ? or how can I disable this **** ??
[Xposed General] wizel:
Works as well on oneplusone running CM12.1 (5.1)
[Xposed General] HassanM:
Hi friends,

I recently got a Galaxy s5 (900F)... Ive rooted it and Im on 4.4.2 ...... Under the phone info, it says:

SE for Android Status

Enforcing

Can it be set to Permissive???

Thanks in advance
[Xposed General] ldeveraux:
Does it have a locked bootloader?
[Xposed General] HassanM:
Mate not sure... How can I find out if its locked or unlocked???
[Xposed General] ldeveraux:
https://play.google.com/store/apps/details?id=org.freeandroidtools.root_checker&hl=en
[Xposed General] HassanM:
Thanks for replying.... Heres the screenshot but not sure if its locked or unlocked:

It says:

BOOTLOADER G900FXXU1ANG9

Plz advise
[Xposed General] ldeveraux:
I'm not familiar with your phone, but if you can dig up a copy of SElinux mode changer, that should work
[Xposed General] HassanM:
It doesn't work on Samsung phones.... Atleast this is what ive read....
[Xposed General] ldeveraux:
Did you at least try it?
[Xposed General] Darrell07:
This does not work for galaxy s6. Am I doing something wrong?
[Xposed General] Adywizard:
You don't have root access.
[Xposed General] Darrell07:
I do have root access, though.
[Xposed General] Adywizard:
I mean, you didn't gain root access through terminal. After typing su you should see # instead $
[Xposed General] ldeveraux:
it's like you didn't give terminal superuser permissions when it popped up...

And for the love of god, change your font!
[Xposed General] Darrell07:
I don't know how I didn't catch that. Anyhow, even with root access, I'm still unable to gain permissive.
[Xposed General] Adywizard:
http://xdaforums.com/showthread.php?p=47397991

Use this one. With Knox you want be able to set permissive mod.
[Xposed General] Darrell07:
I'm assuming KNOX is not allowing the setenforce 0 command, and I can't get KNOX disabled. I've tried that app before and didn't work for me.
[Xposed General] Adywizard:
Uninstall knox.
[Xposed General] Darrell07:
How would one go about doing that? I'm a noob
[Xposed General] Adywizard:
You can freeze it with titanium backup or similar app. Also did you read whole thread? On second page there's a guide how to set permissive mode through kernel. It's quite simple.
[Xposed General] ldeveraux:
I didn't even notice, but it's not going to work on your phone. Doesn't work on stock S5 rooted, won't work on stock S6 rooted. You gave us no info regarding the ROM, so just give it up. You don't need permissive to run Xposed anyway, just let it go.
[Xposed General] sac02:
Hi all, I am (unsuccessfully) trying to disable a few specific services using an app such as "DisableService" or "MyAndroidTools" and wondering if my SELinux mode = "enforcing" could potentially be the issue. When I attempt to disable a service, those apps show the service, but won't disable them. (I tap, but the checkmark remains, and the service still runs)

I have an AT&T GS4 and I'm running Goldeneye53 custom ROM.

I'm wondering if it could be related to my seLinux settings? I currently show SELinux as "enable" in the About My Device screen. I have tried the app SELinuxModeChanger, and using terminal emulator to run:

su

setenforce 0

Neither has resulted in SELinus = permissive.

Any thoughts?
[Xposed General] ldeveraux:
No, I can disable all the services I want using DisableServices and I'm enforcing.
[Xposed General] sac02:
Hmm, thanks for that confirmation to rule that out.

So do I really need to continue on this quest to get SELinux=permissive?

Can you help fix my inability to disableServices too, while you're at it? lol.
[Xposed General] ldeveraux:
It's been said many times that Xposed runs with enforcing security, you don't need it permissive. As for the app, if they have a thread on XDA, check it out there and ask for help. Mine just works...
[Xposed General] sigudster:
Thanks

Nice bro, it works on my xiaomi redmi 1S :D:D:D:D
[Xposed General] donzzy:
So what happens if I set my kernel to permissive and I have Xposed already working. Will this stop the modules to work, and will it create bootloop?
[Xposed General] ldeveraux:
doubtful, but backup before doing it just in case.
[Xposed General] Nikhilgeek:
Help :'(

How can i paste all lines on Terminal Emulator ?
[Xposed General] yeyintthu:
I work in my S3 Neo [4.4.4]..

Thz a lot brother.

I also hit thanks button..

Please share useful thread again bro..

:good::good::good::good::o:o:o:o:angel::angel::angel:
[Xposed General] que_phin:
Thank you, this is really helpful.

now I can make it permissive automatically after reboot.
[Xposed General] honki24:
I get "mkdir failed for /system/su.d, File exists" when I type in the third line above. I'm on Alliance ROM 5.0 on ATT Note 3.
[Xposed General] chichino84:
Hi guys, I'm having a strange issue:

after following this method I lost almost any access to my ext4 16 gb sd card: es explorer doesn't even display sdcard1 path anymore and my phone won't boot into recovery. I can't mount it through rom's settings menu too. Only AirDroid still shows the card and its contents all there. I tried to manually delete init.d folder but it is the same. Do you please have any hint?

I'm on Sony Z3 Compact - 5.1.1 debloated strock rom - Stock Kernel - XDualRecovery

Thx!
[Xposed General] mikhnal:
Could anyone make the zip pack that be can install by recovery or CM Downloader?

[edit]

OK, Boeffla Kernel for my Galaxy S5 klte have this option - set Permissive mode on boot.
[Xposed General] maherran:
Great!

Thanks!
[Xposed General] paolo200:
I think I'm getting confused here.

From what I understand the whole point of this thread was to learn how to set SElinux to permissive so that we could use Xposed but some posts say that it is not necessary because Xposed works anyway.

So I'm asking is there some other reason why we should set to permissive other than being able to perform OTA updates? And won't the phone become more vulnerable by doing so?
[Xposed General] ldeveraux:
can you read the thread responses rather than asking the question for the 74757844th time?
[Xposed General] Beakhole:
Recovery Flashable Zip

This worked perfectly. I made it into a flashable zip below for anyone that wants it. :D
[Xposed General] javiertech:
I tried in the terminal, no errors, but not working, maybe i miss something http://cdn3.xda-developers.com/images/smilies/confused.gif
[Xposed General] Beakhole:
Well flashing the zip I created worked perfectly for me. It's permissive on every boot. :D

I'm running Pure Nexus on my Nexus 6 with other Rom info per my signature below.
[Xposed General] javiertech:
I think the samsung is different, for touchwiz, but i found another script for viper4audio:

su

mount -o rw,remount /system

cd /system/su.d

echo '#! /system/bin/sh' > 50viper.sh

echo '/system/xbin/supolicy --live "allow mediaserver mediaserver_tmpfs:file { read write execute };"' >> 50viper.sh

chown root.root 50viper.sh

chmod 755 50viper.sh

cd /

mount -o ro,remount /system

exit

this works for me, it is not necessary set selinux in permissive, search in xda for "ViPER4Android-supolicy.zip" http://cdn3.xda-developers.com/images/smilies/smile.gif
[Xposed General] kmelikov:
Revert to original settings

Now say I want SELinux to be enforcing upon every boot. How do I revert to enforcing status from permissive status?
[Xposed General] Beakhole:
Well I'd assume you would delete this:

/system/su.d/permissive.sh

Then run this in the Terminal:

su
echo "1" > /sys/fs/selinux/enforce
[Xposed General] kmelikov:
Thanks for the reply.

Now when you say you'd assume, does that mean you know for sure?
[Xposed General] Beakhole:
Well you would do those steps to reverse the SELinux Permissive if you had flashed my zip I'm a previous comment.
[Xposed General] kmelikov:
Say I did not flash your zip, but just followed the directions. Are the steps the same as in your flash script? If that's a stupid question, forgive me, it's 3 am here.
[Xposed General] Beakhole:
Well then you'd just delete

/system/etc/init.d/08setperm

and reboot.
[Xposed General] kmelikov:
This is what I did to set SELinus in permissive mode:

su

mount -o remount,rw /system

mkdir /system/su.d

echo "#!/system/bin/sh" > /system/su.d/permissive.sh

echo "setenforce 0" > /system/su.d/permissive.sh

echo "0" > /sys/fs/selinux/enforce

chmod 755 /system/su.d/permissive.sh

Do I do anything with su.d and permissive.sh?
[Xposed General] Beakhole:
So then delete

/system/su.d/permissive.sh

and run these three commands in the terminal:

su
mount -o remount,rw /system
echo "1" > /sys/fs/selinux/enforce

I forgot and left out the system mount command from my previous comment. And I guess you could get rid of /system/su.d if it wasn't created prior to you doing this script. And don't forget to reboot when you're done.
[Xposed General] kmelikov:
Thanks.

One more thing: instead of utilizing the terminal, I could just use Root Explorer to modify the necessary files accordingly (such as set setenforce to 1, for instance) using the GUI, right? I think I know the answer to this question, but I just would like to make sure I'm understanding things right.
[Xposed General] Beakhole:
Yes. That would have the same end result.