FORUMS
Remove All Ads from XDA

iSu [V5.1][5.1+] Simple app to deactivate activate CyanogenMod/LineageOS SU at will

2,361 posts
Thanks Meter: 5,238
 
Post Reply Email Thread
iSu by bhb27

I know that there is many tools apps etc to disable or hide SU.
I decide to make this just because those don't work on my device and or CyanogenMod/LineageOS ROM that I use, so I assume this happens to other in CyanogenMod/LineageOS users too.


Click image for larger version

Name:	0001.png
Views:	3328
Size:	31.2 KB
ID:	4107228
Click image for larger version

Name:	A01.png
Views:	1848
Size:	166.3 KB
ID:	4130656 Click image for larger version

Name:	A02.png
Views:	1834
Size:	188.6 KB
ID:	4130657

This is only to CyanogenMod/LineageOS SU binary
No ti doesn't work with SUPERSU or any other SU today, btw I have try but the system/su that works with this app is only CM-SU
No it doesn't support Xposed

What is iSu?

A simple app to deactivate SU at will on CyanogenMod/LineageOS and CyanogenMod/LineageOS base ROM's.

I test this on Marshmallow and Nougat CM base ROM's, also Supports Lollipop, Kit Kat and older not supported.

How it works?

A simple apk with some instructions and one main switch, to activate or deactivate SU, to pass safety net or wherever app you use that doesn't like ROOT, the app has a builtin app monitor that can be used to automatic activate or deactivate SU when the selected app starts or stops be used.

There is no change need to be made to the system or kernel to use the app.

But be aware ! on Marshmallow or older is need to be made one simple change to kernel services (add a iSu service) to be able to reboot with SU deactivated and be able to have it enable after...
Without the kernel change you can use the app enable disable SU but if you reboot with SU deactivate or a random reboot happens the app will no be able to enable SU after.
The service is a normal service is just like SU service but works only with iSu implementation.
On Nougat the app can set the service without any changes to the kernel.

Some CyanogenMod/LineageOS Use different SU version name
I restrict the app to only work with cm-su but some CyanogenMod/LineageOS base ROM like to change everything included su version name like the below, if the ROM you use is CyanogenMod/LineageOS and have a different name post on the thread so I can add that option to the app.

Troubles:
  • If after deactivate SU using the app you can pass safety net check, but can't use this or that app because it detects you have ROOT try this post workaround (Click here), simple explain some apps are using some build.prop flags that exist only on ROOT devices to detect a rooted ROM, changing build.prop is really simple just fallow that post, if that doesn't help post on the thread the affected app.
  • After flashing the kernel reboot support or the cmdline Patch the device may not boot it is not perfect to all devices but was tested in many device and is fully working, if your device doesn't boot after flashing just reverted by re-flashing yours current ROM .zip or by restoring a TWRP backup of system and boot made before had flashing the .zip.
  • If you use iSu to deactivate SU and lost SU support try a reboot if you have iSu kernel support, if you don't have kernel support re-flash yours current ROM .zip or restore a TWRP backup of system and boot from before had used the app to deactivate SU.
Report on the thread if any of this happens...

Download Folder: Click Here
There is four files:
iSu_X_x.apk
Install the apk as a normal app.

iSu_kernel_Reboot_Support_V_X_x_and_up_Enforcing.z ip
iSu_kernel_Reboot_Support_V_X_x_and_up_Permissive. zip

On iSu V2.2 or up is only need reboot support for Marshmallow or older.
The kernel reboot support use only one, this files avoid you losing SU after a reboot with SU deactivated.
Use the one base on yours current Selinux status to check on your device look in settings > About a phone > SELinux Status if is enforcing or permissive, some CM ROM Run with selinux in Permissive so check yours.

The below are obsolete after V3.6 of the app see old_version folder in main download folder for those files

iSu_kernel_cmdline_Patch_V_X_x_and_up.zip
The kernel_cmdline is only need to some devices that after deactivating SU with the app still can't pass the safety check, Google is using kernel and bootloader arguments to determined that the user modify the stock SW(AKA is using custom ROM) and prevent from passing as "safe", this add extra safe arguments to cmline and help to achieve the pass current it only support some device (Nexus and Motorola, maybe other post on the thread device/vendor if the zip help you)

iSu_kernel_defaultprop_Patch_V_X_x_and_up.zip
This is only for those that have apps that use rootbeer SU detection...
explain in this post (Click here).
After flashing defaultprop_Patch zip the user will no longer have access to the option in Settings > Developer options > Root access
But that is not a problem as the same zip will enable root by default so you can use without changing that option.

Warning!!
Updating CM nightly or any ROM update of any CM base ROM will remove any of the zip affects, so is need to flash those .zip with any ROM update, may be need to do it also with some custom kernel from developer that use a boot.img to share the kernel(check yours kernel zip content to know).

If you forget to flash the .zip in a update and have lost ROOT don't worry just go back to recovery and flash it after the reboot all will be good.

XDA:DevDB Information
iSu, App for all CyanogenMod/LineageOS devices (see above for details)

Contributors
All Contributors can be see in github click here
bhb27, I use osm0sis Anykernel2 for the kernel zip
App Source Code: https://github.com/bhb27/isu

Version Information
Status: Stable
Current Stable Version: Check latest version
Changelog

Created 2016-Oct-03
Last Updated Check latest version
XDA Labs
The Following 59 Users Say Thank You to bhb27 For This Useful Post: [ View ]
 
 
11th October 2016, 03:58 PM |#2  
bhb27's Avatar
OP Recognized Developer
Flag Brazil...South of the south
Thanks Meter: 5,238
 
Donate to Me
More
Changelog
The Following 19 Users Say Thank You to bhb27 For This Useful Post: [ View ]
11th October 2016, 03:58 PM |#3  
bhb27's Avatar
OP Recognized Developer
Flag Brazil...South of the south
Thanks Meter: 5,238
 
Donate to Me
More
Last app version Click to Download
Attached Thumbnails
Click image for larger version

Name:	A01.png
Views:	898
Size:	152.1 KB
ID:	4107218   Click image for larger version

Name:	A02.png
Views:	894
Size:	223.5 KB
ID:	4107219  
The Following 16 Users Say Thank You to bhb27 For This Useful Post: [ View ]
3rd November 2016, 01:08 AM |#4  
blastagator's Avatar
Recognized Contributor
Flag Kissimmee
Thanks Meter: 4,383
 
Donate to Me
More
Awesome work! Glad I accidentally stumbled on to this. Magisk stopped working to hide root but this is still good. Woot!


edit: In your isu.sh, shouldn't the end of the script be:

Code:
mount -o ro,remount /system
# instead of
umount /system;
edit 2: For anyone who wants to build their device/kernel with support baked in, so they don't have to patch, I distilled the changes down from your git and created this patch:
https://github.com/blastagator/cm_de...5751c7e6b8fdc5
This should be a good basis for others to manually patch in support. Working well on my custom cm13 builds.
The Following 3 Users Say Thank You to blastagator For This Useful Post: [ View ] Gift blastagator Ad-Free
3rd November 2016, 06:33 AM |#5  
bhb27's Avatar
OP Recognized Developer
Flag Brazil...South of the south
Thanks Meter: 5,238
 
Donate to Me
More
Quote:
Originally Posted by blastagator

Awesome work! Glad I accidentally stumbled on to this. Magisk stopped working to hide root but this is still good. Woot!


edit: In your isu.sh, shouldn't the end of the script be:

Code:
mount -o ro,remount /system
# instead of
umount /system;
edit 2: For anyone who wants to build their device/kernel with support baked in, so they don't have to patch, I distilled the changes down from your git and created this patch:
https://github.com/blastagator/cm_de...5751c7e6b8fdc5
This should be a good basis for others to manually patch in support. Working well on my custom cm13 builds.

Thanks. For me was similar, magisk did not support my device so user complain to me about support as I did not manage to make magisk to work on my device I manage to make this that seems to be 100% for the most none rooted app.

regards the RW/RO
Theoretically yes but things was a little odd when I first start test for this... for simple reason if we don't mount system as RW we can "hide" or "un-hide" SU because is need to move it and system boot in RO, and if leave it mounted as RW safety net check will not be successful even if SU is hide, but after some safety net update on the google side mount it as RO at the end was not working in the .sh and the unmout was, maybe was some other related problem but it work so I did not change...

So I keep the unmount did not test any more after, and in the java code every time the switch is use it start with RW and ends with RO and that does the trick...

I have update the reboot support and the app for Nougat, Selinux is a little more restricted on N and I did not had the time to test a universal .zip to support N as the changes I did in the ROM I build are a little more time demanding to make it right, or not I really only have my build to test on my devices as N is just starting there is no other ROM, I really need another ROM that doesn't have any of my changes to test and really make it fully work with a simple .zip

But every things is also fully working on N CM did not change the SU binary, safety net, pokemon and payment app are all good, at least for know...

The Following User Says Thank You to bhb27 For This Useful Post: [ View ]
3rd November 2016, 06:48 AM |#6  
bhb27's Avatar
OP Recognized Developer
Flag Brazil...South of the south
Thanks Meter: 5,238
 
Donate to Me
More
I update the project for N but I only manage to fully test on my ROM so if any one try and have problem read #3 post and report on the thread.
5th November 2016, 10:19 PM |#7  
Junior Member
Thanks Meter: 3
 
More
Hey guys, just tried out this in my Redmi Note 2 Prime with Bule's (cleaned) MoKee ROM CM12.1, and worked great, until now, because says, when I'm going to "hide" su, that the "su state change fail" Don't know for what it was, but if you can help me solving this, I would be grateful
7th November 2016, 02:16 AM |#8  
mrkhigh's Avatar
Senior Member
Thanks Meter: 544
 
More
Bhb thank you, using on my daughter's xt1254 phone now which runs cm 13.

---------- Post added at 03:16 AM ---------- Previous post was at 03:12 AM ----------

Quote:
Originally Posted by Shadow646

Hey guys, just tried out this in my Redmi Note 2 Prime with Bule's (cleaned) MoKee ROM CM12.1, and worked great, until now, because says, when I'm going to "hide" su, that the "su state change fail" Don't know for what it was, but if you can help me solving this, I would be grateful

This is the reason for the kernel hack.
Without it you can lose root.

Dirty flash your ROM and if the kernel hack won't work
Then just be sure to set everything back to normal before any reboots.

I "THINK" then you would be okay.
The Following User Says Thank You to mrkhigh For This Useful Post: [ View ] Gift mrkhigh Ad-Free
7th November 2016, 02:20 AM |#9  
Junior Member
Thanks Meter: 3
 
More
Quote:
Originally Posted by mrkhigh

Bhb thank you, using on my daughter's xt1254 phone now which runs cm 13.

---------- Post added at 03:16 AM ---------- Previous post was at 03:12 AM ----------



This is the reason for the kernel hack.
Without it you can lose root.

Dirty flash your ROM and if the kernel hack won't work
Then just be sure to set everything back to normal before any reboots.

I "THINK" then you would be okay.

Yeah, I did that, but dunno if was because of that it failed, or not... I'm fine for now, reverting it whenever I close the game, I put su back Maybe it was because I was trying to cheat on PoGO, and didn't work with Fly GPS, and uninstalling the app in a bad way provoked that I will do a nandroid and try again
7th November 2016, 02:22 AM |#10  
mrkhigh's Avatar
Senior Member
Thanks Meter: 544
 
More
Edit
7th November 2016, 09:25 PM |#11  
bhb27's Avatar
OP Recognized Developer
Flag Brazil...South of the south
Thanks Meter: 5,238
 
Donate to Me
More
Quote:
Originally Posted by Shadow646

Yeah, I did that, but dunno if was because of that it failed, or not... I'm fine for now, reverting it whenever I close the game, I put su back Maybe it was because I was trying to cheat on PoGO, and didn't work with Fly GPS, and uninstalling the app in a bad way provoked that I will do a nandroid and try again

Are you using the kernel support, have you flash it in TWRP?

The app work in CM under 13 is ok, but the kernel support I have not tested in older them CM13, so I'm curious to know if it works, the only way to really test is to deactivate SU and then reboot if you have SU active after or if the app can activate SU after then is all good if you don't have and or can't activate in the app there is a problem...

the basic function of the kernel support is to have no problem after a reboot when you had disable SU, just like @mrkhigh point it out

So if you reboot with that off let me know the behavior if you can use and activate SU will be need a dirty flash of the ROM you are using...

When I have some time I will do some proper test in cm12.1 and only cm12.1 because my devices can only run that there is no older OS for me...

The Following User Says Thank You to bhb27 For This Useful Post: [ View ]
Post Reply Subscribe to Thread

Tags
cm su, cyanogenmod, lineageos, safety net, safetynet

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes