Is there a way to Set SELinux to Permissive on Galaxy S7 Edge, Stock, Rooted? - Samsung Galaxy S7 Edge Questions and Answers

As the title says it all, is there a way to Set SELinux to Permissive on Galaxy S7 Edge, Stock, Rooted?
Any adb shell commands or do I need a modified stock kernel for this?
I have tried the commands SETENFORCE 0 but without success.

Use a terminal emulator or ADB to type these commands:
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
Of course you will need to be Rooted (SuperSU)

@dave7802 I followed the exact steps but after reboot my S7 has become too slow. How can i revert back the changes? please help

Related

[TUTORIAL]How to manual root official 2.3

I always have problems to root official 2.3 with automatic ways, and found that this caused from some adb miscommunication.
So this is how to do it manual, in case automatic ways stacked.
First install adb-sdk and add its path to system variables, so to don't have to go to adb' s path before you can run it.
Then download doomlord' s rooting tool and extract it to drive C:\DoomLordRoot.v3.
http://forum.xda-developers.com/attachment.php?attachmentid=784296&stc=1&d=1321435888
Preparation steps on device:
1) Dial: *#*#2846579#*#*
2) Go to projectmenu > background settings > log settings > log switch > set Log on
3) Reboot Phone
4) Switch USB Debugging ON
5) uncheck fast boot from settings -> applications
Click to expand...
Click to collapse
Open windows command prompt window and do the above:
Code:
adb push c:\DoomLordRoot.v3\files\zergRush /data/local/tmp/
[COLOR="DarkSlateBlue"]adb shell[/COLOR]
chmod 777 /data/local/tmp/zergRush
./data/local/tmp/zergRush
[COLOR="DarkSlateBlue"]Hit CTRL+C to exit from adb shell[/COLOR]
adb push c:\DoomLordRoot.v3\files\busybox /data/local/tmp/
[COLOR="DarkSlateBlue"]adb shell[/COLOR]
su
chmod 755 /data/local/tmp/busybox
/data/local/tmp/busybox mount -o remount,rw /system
dd if=/data/local/tmp/busybox of=/system/xbin/busybox
chown root.shell /system/xbin/busybox
chmod 04755 /system/xbin/busybox
/system/xbin/busybox --install -s /system/xbin
rm -r /data/local/tmp/busybox
[COLOR="DarkSlateBlue"]Hit CTRL+C to exit again from adb shell[/COLOR]
adb push c:\DoomLordRoot.v3\files\su /system/bin/su
[COLOR="DarkSlateBlue"]adb shell[/COLOR]
su
chown root.shell /system/bin/su
chmod 06755 /system/bin/su
rm /system/xbin/su
ln -s /system/bin/su /system/xbin/su
[COLOR="DarkSlateBlue"]Hit CTRL+C to exit once more from adb shell[/COLOR]
adb push c:\DoomLordRoot.v3\files\Superuser.apk /system/app/
[COLOR="DarkSlateBlue"]adb shell[/COLOR]
su
cd /data/local/tmp/
rm *
reboot
This is basic what the runme.bat file does, just some paths corrected to point to the right locations.
I have the latest official gingerbread (I think v3) and have been trying to root with no luck. I've gone through the steps here but when try to get root access (su), it gives me permission denied...
Any ideas?
Oneclickroot v2. 2 did the work for me or something like this
Sent from my U8800
SS said:
I have the latest official gingerbread (I think v3) and have been trying to root with no luck. I've gone through the steps here but when try to get root access (su), it gives me permission denied...
Any ideas?
Click to expand...
Click to collapse
This probably means that rooting failed.
What messages you get when you run zergrush?
dancer_69 said:
This probably means that rooting failed.
What messages you get when you run zergrush?
Click to expand...
Click to collapse
I got messages for sending 149, then 189 zerglings, then messages about not being able to mount, find or write to directories.
It seems like it wasn't able to get root access to be able to run its process.
In any case, I just downgraded to the previous release and then used ZergRush, which worked perfectly
don't work.
try this, it works for my B528 rom!
http://forum.xda-developers.com/showpost.php?p=23565074&postcount=7

directory that survives OTA update?

Is there a known-safe directory that doesn't get clobbered in an OTA update, other than /mnt/sdcard? Maybe /data or something under it?
The reason I ask is that I had a brainstorm. If I just keep a copy of /system/xbin/su (and make sure it's still setuid root), after an update I can always start a shell and run my alternate su to become root, right? Then I could put su back into /system/xbin. Anything else I'd need to do to be actually rooted at that point? Does "rooted" just mean a working su is present, or something in addition (to allow adb root, for example)?
/mnt/sdcard is not suitable because it's vfat and doesn't store the setuid permissions. But /data seems to have stuff that's intended to stay there perpetually. And since it's just a subdir of the root filesystem, I can do the setuid.
$ su
# mkdir /data/mine
# cat /system/xbin/su > /data/mine/salami
# chmod 6755 /data/mine/salami
# exit
$ /data/mine/salami
#

i9506 I9506XXUCNJ1 - SElinux whatever I try, stays Enforcing

Hello, I have a huge problem with this firmware - but just a particular one. I had tried to go to the 5.0.1 (I9506XXUDOE4) where it worked fine, but I didn't like the UI and the OTG functionality didn't work at all.
I have moved back to the older ROM I was using before, running selinux in enforcing mode with a major problem - not able to write on NTFS formatted devices. Actually, a little problem was also on the Lollipop firmware with the CF AutoRoot but DeHAWK kernel solved it. Therefore I tried to move back on I9506XXUCNJ1 and decided to try this kernel out if it helps - but it didn't.
The SElinux status isn´t even showed up in the "About device" section.
What I tried already:
Paragorn SElinux set to Permissive (see screenshots what it does)
init.d 01selinux script
SELinuxModeChanger (changes back to enforcing when I start it again - actually does nothing)
CODE1:
Code:
su
mount -o remount,rw /system
mkdir /system/su.d
echo "#!/system/bin/sh" > /system/su.d/permissive.sh
echo "echo 0 > /sys/fs/selinux/enforce" >> /system/su.d/permissive.sh
chmod 755 > /system/su.d/permissive.sh
CODE2:
Code:
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
Please help
A little bump, please help.

Make Viper4Android 2.4.0.1 work on Android 6.0

I had some trouble trying to make Viper4Android v2.4.0.1 work on my Honor 5C running Android 6.0. This could be helpful…
Viper4Android didn't work after installation and reboot, the driver status showing as "abnormal". It seems related to a change in default SELinux policy.
I read that changing globally the SELlinux policy to "permissive" can solve the problem but it may be an extreme solution (SELinux is a security feature to restrict what an application can do, I don't know the potential edge effects).
I found another solution on the web, which consists in patching the SELinux policies at boot, just enough for Viper4Android to work.
If you did not make a systemless installation of SuperSU, open an adb shell and use these commands (courtesy of androiding.how):
Code:
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
chmod 755 50viper.sh
cd /
mount -o ro,remount /system
And reboot.
If you did make a systemless installation of SuperSU, open an adb shell and use this instead:
Code:
su
mount -o rw,remount /su
cd /su/su.d
echo '#! /system/bin/sh' > 50viper.sh
echo '/su/bin/supolicy --live "allow mediaserver mediaserver_tmpfs:file { read write execute };"' >> 50viper.sh
chmod 755 50viper.sh
cd /
mount -o ro,remount /su
exit
And reboot.
Didn't work for me, tried the 2nd method as the first one gave an error at the 3rd step, completed everything, rebooted, still no luck
imrock said:
Didn't work for me, tried the 2nd method as the first one gave an error at the 3rd step, completed everything, rebooted, still no luck
Click to expand...
Click to collapse
I just noticed that in my 2nd block the characters ’ and ” were used instead of ' and ". I'm not a POSIX shell expert but since these are not the same characters it can make a difference.
I've updated the 2nd method, you can give it a try — you can use it "as it is", it will overwrite the previously created file.
This trick didn't work for me.
I ended up installing SELinuxModeChanger and now Viper is rockin' :good:

Set enforcing to permissive

I have rooted my SM-G935F on stock rom and have been wondering if it's possible to change SE to permissive without installing a different kernel?
I found this post which suggested the following in TE:
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
Someone tried it and said their phone became a bit slow afterwards.
Are there any other solutions or workarounds please?
If flashing a modified kernel is the only option, can anyone recommend one please and would it result in losing any data?
Thanks
just do it ok
I've been using this kernel with latest Samsung stock firmware:
https://forum.xda-developers.com/s7-edge/development/kernel-tgpkernel-t3501571
Anyway, you should always backup your data before flashing you can use Smart Switch for that one click backup.
Kernel is very stable, been running it for some time. With that kernel you can switch the enforcing / permissive thing. And as always keep OEM unlocking on enable and verify it is before flashing. Never disable developer options or OEM unlocking when you have a custom kernel / recovery installed.

Categories

Resources