FORUMS
Remove All Ads from XDA
Honor 7x
Win an Honor 7X!

[APP][TOOL][4.2+][OFFICIAL]The SELinux Switch

3,774 posts
Thanks Meter: 2,481
 
Post Reply Email Thread
The SELinux Switch



What's The SELinux Switch & What Makes It Different from The SELinux Toggler?

I'll outline this in brief since it would take too much time and space in explaining everything in detail.

Primarily, The SELinux Switch was built from scratch. It had taken me approx. 6 +/- months on building, testing, editing, etc...

The SELinux Toggler was still using the old Package Namp (com.mrbmic.selinux) and, by continuing to use that same Package Name, it also forced me to have to continue its Open Source as specified by the SELinuxModeChanger.

Though, The SELinux Toggler was my developement, it still had some underlying ties to the SelinuxModeChanger. In order to make this "My App", i had to build it up and give it a more apropriate Package Name (com.ibuprophen.selinux).

When it came to the user interface, i felt (based on the simplicity of The Selinux Toggler) that the same user interface would be the best thing to do and carried it over.

IMPORTANT INFORMATION FOR USERS OF "THE SELINUX TOGGLER"

Be sure to follow the steps BEFORE installing The SELinux Switch:

1) Download The SELinux Switch and save it somewhere on your device you can remember.

2) Uninstall The SELinux Toggler then reboot your device.

3) Once the device is booted up, install The SELinux Switch and you're done.

4) (OPTIONAL) If you would like to initially test it out, then set The SELinux Switch to Permissive Mode, then reboot your device. Once the device has booted back up, confirm the change.

***PLEASE NOTE FROM STEP ONE: If you plan to install The SELinux Switch using the Flashable Installer via custom recovery. Then instead of fully rebooting your device, just reboot into your devices custom recovery and install via the flashable Installer and reboot your device (Cleaning the Dalvik Cache right after flashing the installer is encouraged but, not required) and your good to go (you may proceed to step 4 if so desired).

What and why is SELinux Mode Important?

Since the release of Android 4.2 (KitKat) a new security enhancement called SELinux was interlaced within the system and then the Mode was defaulted to “Enforcing”.

Weather this new security measure was good or bad, it resulted in allot of challenges with many Apps that required Root access. So from then on, there have been many workarounds that developers were forced to overcome and adapt to this new security measure for their current and future developments.

Since the SELinux security measure was placed, there also have been many tools and utilities had changed the default SELinux Mode “Enforcing” to “Permissive” and one of those noted (and clever) Developers was an individual who is known as MrBIMC had created the “SELinuxModeChanger”. This app allowed the individual to change the SELinux Mode to and from its “Enforcing” and “Permissive” states.

What does The SELinux Switch do?

Basically, this app can change a devices SELinux State without having to permanently modify the boot script files of the device.

What does The SELinux Switch NOT do?

Again… This app will not make permanent changes to the boot script files!

This app will automatically boot as any app will that is part of the boot sequence. So when a device boots up, the device, by default, will be booted in its default SELinux “Enforcing” Mode. Then once the boot sequence begins launching the auto launching of the apps, this app will then automatically launch and change the devices SELinux Mode that the user last selected for the devices SELinux Mode.

What do I do to use this app?

Just as simple as downloading, installing, opening the app and then select which mode you want the devices SELinux Mode to be (Permissive or Enforcing).

And that's it! Now every time you reboot your device, the app will auto launch (just the same as other apps do) and change the SELinux state to the mode in which you've last selected within the app.

Primary Download Links

The SELinux Switch - Apk Installer

The SELinux Switch - Flashable (Zip) Installer (OPTIONAL)

Alternative Download Links

The SELinux Switch - XDA Labs Store

The SELinux Switch - Apk Installer (Android File Host)

The SELinux Switch - Flashable (Zip) Installer (Android File Host) (OPTIONAL)

Some Issues that may/might be present

- This will be populated/updated as i get a better idea on any issues in time.

Special Mentions/Credits
@Droidriven - For Beta Testing & Providing Valuable Feedback.
@Thebear j koss - For Providing The Dark Theme, Beta Testing & Providing Valuable Feedback.
@ahrion - For Providing The Magisk Information & Screenshot(s)
@Dixon Butz - For Providing The Magisk Information & Screenshot(s)

Click Here If You Would Like To Donate To My Developements
~~{Donations Are Appreciated But, Never Necessary...}~~

***The SELinux Switch has just been recognized by The Custom Droid***
The SELinux Switch and I was just recently recognized by the***********.com
Please take a look and i hope you enjoy this highlight!
Set SELinux Permissive on Android using The SELinux Switch By Dhananjay {October 8, 2017}

***The SELinux Switch Recognized by xda-developers***
The SELinux Switch and I was just recently recognized by xda-developers.com
Please take a look and i hope you enjoy this highlight!
The SELinux Switch is a New Tool for Toggling SELinux Between Enforcing and Permissive By Doug Lych {August 15, 2017}

XDA:DevDB Information
The SELinux Switch, Tool/Utility for all devices (see above for details)

Contributors
Ibuprophen

Version Information
Status: Stable
Current Stable Version: 6.0.7
Stable Release Date: 2017-12-15

Created 2017-08-14
Last Updated 2017-12-15
Attached Thumbnails
Click image for larger version

Name:	The SELinux Switch.png
Views:	25404
Size:	61.2 KB
ID:	4243686   Click image for larger version

Name:	For-Magisk-Using-Magisk-BusyBox.png
Views:	25888
Size:	39.5 KB
ID:	4243687   Click image for larger version

Name:	For-Magisk-Using-BusyBox-Stericson_1.png
Views:	25848
Size:	132.5 KB
ID:	4243688   Click image for larger version

Name:	For-Magisk-Using-BusyBox-Stericson_2.png
Views:	25752
Size:	146.7 KB
ID:	4243689   Click image for larger version

Name:	For-Magisk-Using-BusyBox-Stericson_3.png
Views:	25506
Size:	174.4 KB
ID:	4243690   Click image for larger version

Name:	PSA-POPUP.jpg
Views:	25200
Size:	22.4 KB
ID:	4243691   Click image for larger version

Name:	01-App-Drawer.jpg
Views:	24638
Size:	193.0 KB
ID:	4244677   Click image for larger version

Name:	02-First-Launch.jpg
Views:	24458
Size:	103.7 KB
ID:	4244678   Click image for larger version

Name:	03-Setting-SELinux-Permissive.jpg
Views:	24090
Size:	208.3 KB
ID:	4244679   Click image for larger version

Name:	04-Notification-After-Reboot.jpg
Views:	23746
Size:	72.7 KB
ID:	4244680   Click image for larger version

Name:	05-Pull-Down-Permissive-Notification.jpg
Views:	23264
Size:	82.3 KB
ID:	4244682   Click image for larger version

Name:	06-Example-Device-Permissive.jpg
Views:	12442
Size:	70.2 KB
ID:	4244683   Click image for larger version

Name:	07-Setting-SELinux-Enforcing.jpg
Views:	10874
Size:	87.2 KB
ID:	4244684   Click image for larger version

Name:	08-Pull-Down-Enforcing-Notification.jpg
Views:	9916
Size:	237.8 KB
ID:	4244685   Click image for larger version

Name:	09-Notification-After-Reboot.jpg
Views:	9332
Size:	72.7 KB
ID:	4244686   Click image for larger version

Name:	10-Example-Device-Enforcing.jpg
Views:	8900
Size:	203.4 KB
ID:	4244687  
The Following 50 Users Say Thank You to Ibuprophen For This Useful Post: [ View ] Gift Ibuprophen Ad-Free
 
 
14th August 2017, 10:10 PM |#2  
Ibuprophen's Avatar
OP Senior Member
Flag Upstate New York
Thanks Meter: 2,481
 
Donate to Me
More
**********************************
******CHANGELOG******
**********************************


*********************
**DATE: 12-15-2017**
*********************

- The SELinux Switch Version 6.0.7 Build 607
- App Installer & Flashable Zip Uploaded...
- Re-Added Minor Enhancement For Quicker Launch Upon Booting Device.
~~~~~~~~~~~~~~~~~~~~~~~~
~~~SPECIAL ANNOUNCEMENT~~~
~~~~~~~~~~~~~~~~~~~~~~~~
- An issue was found with the Signature File and the new Version may require the member to uninstall and reinstall the app.
- As a personal suggestion, before uninstalling any app, first go to the apps details, force stop, clean/clear up the Data & Cache and then uninstall it. This helps me to make sure that I've done the residual cleaning before the removing of the app itself.
- I apologize for any inconveniences that this may be causing and have taken precautions to help elevate this from happening in the future.

*********************
**DATE: 12-14-2017**
*********************

- The SELinux Switch Version 6.0.6 Build 606
- App Installer & Flashable Zip Uploaded..
- Applied Some Fixes For Android Version Compatibility.
- Fixed Notification Icon For Colored Icon.
- Removed the External Installation Preference to Internal Preference.
- Improved The Background Performance For Even Lower Memory Required.
- A Few Various Other Minor Modifications Were Made...

*********************
**DATE: 10-09-2017**
*********************

- The OP of the thread was just updated for everyone to enjoy a recent article recognizing The SELinux Switch. A special thanks to @DJBhardwaj for such a great article.

*********************
**DATE: 08-29-2017**
*********************

- The SELinux Switch Version 6.0.3 Build 603
- App Installer & Flashable Zip Updated..
- Applied Some Additional Fixes To A Few Translations.
- Fixed A Forgotten Translation Translation That Was Incomplete.
- Applied A Small Functional Modification.

*********************
**DATE: 08-23-2017**
*********************

- The SELinux Switch Version 6.0.2 Build 602
- App Installer & Flashable Zip Updated..
- Applied Some Fixes.
- Applied a Few Modifications for Compatibility.
- A Special Thanks to @Thebear j koss For a Nice Dark Theme.

*********************
**DATE: 08-17-2017**
*********************

- Uploaded App Specific Screenshots On The Thread.
- Uploaded App Specific Screenshots On The XDA Labs Store.

*********************
**DATE: 08-16-2017**
*********************

- Updated Important OP Information.
- Added Important Magisk Information
- Added Important PSA Warning Information.
- Other Minor Changes/Updates Made.

*********************
**DATE: 08-08-2017**
*********************

- Launched New Thread
- App Installer & Flashable Zip Updated..
- Now available in the XDA Labs Store.


The Following 3 Users Say Thank You to Ibuprophen For This Useful Post: [ View ] Gift Ibuprophen Ad-Free
14th August 2017, 10:10 PM |#3  
Ibuprophen's Avatar
OP Senior Member
Flag Upstate New York
Thanks Meter: 2,481
 
Donate to Me
More
~Reserved~
The Following 5 Users Say Thank You to Ibuprophen For This Useful Post: [ View ] Gift Ibuprophen Ad-Free
14th August 2017, 10:10 PM |#4  
Ibuprophen's Avatar
OP Senior Member
Flag Upstate New York
Thanks Meter: 2,481
 
Donate to Me
More
INSTRUCTIONS FOR MAGISK/MAGISK HIDE USERS

When MagiskHide is enabled and selinux is switched to permissive, upon reboot MagiskHide will automatically turn selinux to enforcing, however it will actually be permissive. This is called SELinux "Pseudo" State and keep in mind that this is a Feature NOT a Bug.

You need to ensure that you enable BusyBox within the Magisk app in settings because It's turned off by default. With BusyBox enabled in Magisk and The SELinux Switch set to Permissive Mode, The SELinux Switch will be able to change the SELinux State as designed.

The following screenshot are to aid in the Magisk BusyBox settings:



PLEASE NOTE: If you use the BusyBox app by Stericson, you won't need to enable the Magisk BusyBox. This is because Stericson's BusyBox will be managing the BusyBox Binaries in place of Magisk. Using Stericson's BusyBox is not a requirement nor a recommendation, it's only an option that some Magisk users prefer.

The following screenshots are to aid when using the BusyBox by Stericson settings:








[The information above was compiled from a few different sources and may change just to maintain its accuracy for Magisk users]
The Following 9 Users Say Thank You to Ibuprophen For This Useful Post: [ View ] Gift Ibuprophen Ad-Free
14th August 2017, 10:11 PM |#5  
Ibuprophen's Avatar
OP Senior Member
Flag Upstate New York
Thanks Meter: 2,481
 
Donate to Me
More
INSTRUCTIONS FOR PSA ALERTS


Are you seeing the following after installing or using the The SELinux Switch App?



That is called a PSA (Poisoned System Directories) warning from Google Play that warns users to uninstall various apps, especially, if they're SELinux-related ones.

If you want, the following link has a nice little "how to" for Disabling those pesky "App is harmful" Security Alerts:


How to Disable the Android's ("App is Harmful") Security Alerts

[The information above was compiled from a few different sources and may change just to maintain its accuracy for those who are experiencing PSA warnings]
The Following 8 Users Say Thank You to Ibuprophen For This Useful Post: [ View ] Gift Ibuprophen Ad-Free
15th August 2017, 01:36 AM |#7  
Ibuprophen's Avatar
OP Senior Member
Flag Upstate New York
Thanks Meter: 2,481
 
Donate to Me
More
The SELinux Switch is now up on the XDA Labs Store.
The Following 4 Users Say Thank You to Ibuprophen For This Useful Post: [ View ] Gift Ibuprophen Ad-Free
15th August 2017, 09:38 AM |#8  
Junior Member
Thanks Meter: 4
 
More
So the selinux switch and selinux toggler have the same exact function, right? Or is there a difference on features?
15th August 2017, 12:23 PM |#9  
CHEF-KOCH's Avatar
Senior Member
Thanks Meter: 231
 
Donate to Me
More
It's the same app for years with new icons and names but that's it. You can do the same with terminal without wasting space.
15th August 2017, 06:06 PM |#10  
Ibuprophen's Avatar
OP Senior Member
Flag Upstate New York
Thanks Meter: 2,481
 
Donate to Me
More
Quote:
Originally Posted by Alfa2205

So the selinux switch and selinux toggler have the same exact function, right? Or is there a difference on features?

This app, from the beginning, only had 2 important functions...

The ability to change a device's SELinux State to and from Enforcing/Permissive without making permanent changes to a device.

Please Read the top of the OP for further information...

"What's The SELinux Switch & What Makes It Different from The SELinux Toggler?"

Quote:
Originally Posted by CHEF-KOCH

It's the same app for years with new icons and names but that's it. You can do the same with terminal without wasting space.

Please Read the top of the OP for further information...

"What's The SELinux Switch & What Makes It Different from The SELinux Toggler?"

And, by all means, please use the Terminal Emulator.



If anyone else has any Questions or Concerns, please feel free to ask.

______________
PLEASE NOTE: I welcome any member to help with further valuable information/clarification for any of my posts.
The Following User Says Thank You to Ibuprophen For This Useful Post: [ View ] Gift Ibuprophen Ad-Free
15th August 2017, 09:00 PM |#11  
dgadelha's Avatar
Senior Member
Flag Bahia
Thanks Meter: 2,154
 
Donate to Me
More
Can you add a feature to hide the launcher icon/entry?

EDIT:
Managed to do it.
Code:
su
pm disable com.ibuprophen.selinux/.MainActivity
Post Reply Subscribe to Thread

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

Advanced Search
Display Modes