FORUMS
Remove All Ads from XDA

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

9,194 posts
Thanks Meter: 6,150
 
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 & Flashable Zip Installers via this DevDB Thread (Downloads)

Alternative Download Links

The SELinux Switch - Apk Installer via the Android File Host Server

The SELinux Switch - Flashable Zip Installer via the Android File Host Server

XDA Labs Store Download Link

The SELinux Switch - Apk Installer via the XDA Labs Store

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)
All the Girls I've Loved Before... LOL!

***The SELinux Switch has just been recognized by The Custom Droid***
The SELinux Switch and I was just recently recognized by The Custom Droid
Please take a look and i hope you enjoy this highlight!
Set SELinux Permissive on Android using The SELinux Switch By @DJBhardwaj {01 February 2019}

***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}

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

XDA:DevDB Information
[APP][TOOL][2.3+][OFFICIAL]The SELinux Switch, Tool/Utility for all devices (see above for details)

Contributors
Ibuprophen

Version Information
Status: Stable
Current Stable Version: 7.0.0
Stable Release Date: 2019-03-21

Created 2017-08-14
Last Updated 2019-06-20
Attached Thumbnails
Click image for larger version

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


*********************
**DATE: 03-21-2019**
*********************

- The SELinux Switch Version 7.0.0 Build 700.
- Apk Installer & Flashable Zip Uploaded to DevDB Downloads, Labs Store & AFH.
- Android Pie Fixes/Modifications Made.
- A Version bump made to mark/reflect the next Generation for continued development on Android P.
- Minor correction made on threads title to reflect "Android 2.3+".
- Various other corrections made to Icon Image as well.

SELECT BELOW FOR
PREVIOUS CHANGELOG ENTRIES

*********************
**DATE: 03-05-2019**
*********************

- The SELinux Switch Version 6.2.8 Build 628
- Apk Installer & Flashable Zip Uploaded to DevDB Downloads, Labs Store & AFH.
- Minor Fix Applied.
- Brief info added within the "ABOUT/INFO" screen of the App.

*********************
**DATE: 01-25-2019**
*********************

- The SELinux Switch Version 6.2.7 Build 627
- Apk Installer & Flashable Zip Uploaded to DevDB Downloads, Labs Store & AFH.
- Correction made to Icon Image Quality Previously Overlooked.
- Minor Fix Applied.
- Minor Cleanup made.

*********************
**DATE: 01-19-2019**
*********************

- The SELinux Switch Version 6.2.6 Build 626
- Apk Installer & Flashable Zip Uploaded to DevDB Downloads, Labs Store & AFH.
- Applied NEW 3D (Button Style) Icon.
- Minor Fix Applied.
- New App Signature Has NOT been applied yet. Appropriate Announcement will be made beforehand.

*********************
**DATE: 11-19-2018**
*********************

- The SELinux Switch Version 6.2.5 Build 625
- Apk Installer & Flashable Zip Uploaded to DevDB Downloads, Labs Store & AFH.
- Applied NEW Christmas Icon.
- Added Holiday Cheer within the Info Area.
- Minor compatibility change .
- Slight improvement in launching with device startup.

*********************
**DATE: 10-31-2018**
*********************

- The SELinux Switch Version 6.2.4 Build 624
- Apk Installer & Flashable Zip Uploaded to DevDB Downloads, Labs Store & AFH.
- Applied NEW Halloween Icon (I Had Almost Forgotten About).

*********************
**DATE: 10-11-2018**
*********************

- The SELinux Switch Version 6.2.3 Build 623
- Apk Installer & Flashable Zip Uploaded to DevDB Downloads, Labs Store & AFH.
- ** This is Part of an "Undetermined" Series Release Updates. **
- A small modification Implemented to help with a quicker launch on some devices.
- Cleaned up a few unnecessary items found.
- Various other minor Fixes and such made.
- Threads OP and Screenshots have been updated with more being planned over time.

*********************
**DATE: 09-11-2018**
*********************

- The SELinux Switch Version 6.2.2 Build 622
- Apk Installer & Flashable Zip Uploaded to DevDB Downloads, Labs Store & AFH.
- ** This is Part of an "Undetermined" Series Release Updates. **
- Improved (v3) Icon Implemented.
- Verbiage Re-Wording/Adding in Progress.

*********************
**DATE: 07-31-2018**
*********************

- The SELinux Switch Version 6.2.1 Build 621
- Apk Installer & Flashable Zip Uploaded to DevDB Downloads, Labs Store & AFH.
- ** This is Part of an "Undetermined" Series Release Updates. **
- Applied a Minor Functional Change.
- Reverted a Minor Past Change.
- Began Work on Verbiage Re-Wording/Adding.

*********************
**DATE: 04-04-2018**
*********************

- The SELinux Switch Version 6.2.0 Build 620
- Apk Installer & Flashable Zip Uploaded to DevDB Downloads, Labs Store & AFH.
- Applied Changes from v6.1.3 [RC1] was determined to be Stable for Release.

*********************
**DATE: 04-02-2018**
*********************

- The SELinux Switch Version 6.1.3 [Release Candidate 1] Build 613
- Apk Installer & Flashable Zip Uploaded to DevDB Downloads, Labs Store & AFH.
- Made a (forgotten) minor change/fix.
- NEW ALPHA/BETA/RC Option Added to the Developements {OPTIONAL AND MAY BE UNSTABLE!!!}

*********************
**DATE: 03-28-2018**
*********************

- The SELinux Switch Version 6.1.2 Build 612
- Apk Installer & Flashable Zip Uploaded to DevDB Downloads, Labs Store & AFH.
- Made a very minor fix to help with launch speed.

*********************
**DATE: 03-21-2018**
*********************

- The SELinux Switch Version 6.1.1 Build 611
- Apk Installer & Flashable Zip Uploaded to DevDB Downloads, Labs Store & AFH.
- Cleaned/Removed unnecessary files/folders.
- Modified/Optimized the "ABOUT" screen verbiage.
- Added Version/Build Information within the "ABOUT" screen.

*********************
**DATE: 03-20-2018**
*********************

- The SELinux Switch Version 6.1.0 Build 610
- Apk Installer & Flashable Zip Uploaded to DevDB Downloads, Labs Store & AFH.
- Minor Change/Fix/Update for some Oreo Firmwares/Devices.
- Modified/Optimized the "ABOUT" screen by removing the Support link (temporarily) and added the Special Mentions/Credits.
- Another attempt at fixing the BusyBox Binary Directories: Keeping the default directory and adding the 2 alternative directories if binaries are not present within the default directory.
- Slightly altered various verbiage information to aid with user understanding.
- Changelog Information added to the Labs Store

*********************
**DATE: 03-07-2018**
*********************

- The SELinux Switch Version 6.0.9 Build 09
- Apk Installer & Flashable Zip Uploaded to DevDB Downloads, Labs Store & AFH.
- Minor Change/Fix/Update.
- Restored Original App Icon.

*********************
**DATE: 02-16-2018**
*********************

- Quick Correction/Update/Clarification on various pertinent information within the OP.

*********************
**DATE: 01-25-2018**
*********************

- The "Reviews" portion of this thread was disabled due to it being broken while navigating AND i feel that Feedback/Reviews should be posted as a thread post anyways.
- PLEASE NOTE: The "Star Ratings" were not affected.

*********************
**DATE: 12-18-2017**
*********************

- The SELinux Switch Version 6.0.8 Build 608
- Apk Installer & Flashable Zip Uploaded to DevDB Downloads, Labs Store & AFH.
- Minor Correction For Cleanup Commands Within The Flashable Installer.
- Added NEW Holiday Globe Icon To App & Thread's OP.

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

- The SELinux Switch Version 6.0.7 Build 607
- Apk Installer & Flashable Zip Uploaded to DevDB Downloads, Labs Store & AFH.
- 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
- Apk Installer & Flashable Zip Uploaded to DevDB Downloads, Labs Store & AFH.
- 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
- Apk Installer & Flashable Zip Uploaded to DevDB Downloads, Labs Store & AFH.
- 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
- Apk Installer & Flashable Zip Uploaded to DevDB Downloads, Labs Store & AFH.
- 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
- Apk Installer & Flashable Zip Uploaded to DevDB Downloads, Labs Store & AFH.
- Now available in the XDA Labs Store.


The Following 12 Users Say Thank You to Ibuprophen For This Useful Post: [ View ] Gift Ibuprophen Ad-Free
14th August 2017, 09:10 PM |#3  
Ibuprophen's Avatar
OP Recognized Contributor
Flag Upstate New York
Thanks Meter: 6,150
 
Donate to Me
More
THE SELINUX STATE COMPARISONS

I've been asked questions that relate to what is reflected within a device when its SELinux State has been changed regarding the Android Pie as opposed to its predecessors.

If you've got an Android Pie device and had been thrown off a bit, with the Verbiage used regarding the devices SELinux State, then your not alone. I was actually (and honestly) a bit perplexed myself for about a day or so.

I did figure it out and wanted to provide you with a quick comparison...

The following, side by side comparison, screenshots reflects that "familiar way" we've seen this using Android versions up to Android Oreo.




The following, side by side comparison, screenshots reflects what the Android Pie version will show you.




The Following 10 Users Say Thank You to Ibuprophen For This Useful Post: [ View ] Gift Ibuprophen Ad-Free
14th August 2017, 09:10 PM |#4  
Ibuprophen's Avatar
OP Recognized Contributor
Flag Upstate New York
Thanks Meter: 6,150
 
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 16 Users Say Thank You to Ibuprophen For This Useful Post: [ View ] Gift Ibuprophen Ad-Free
14th August 2017, 09:11 PM |#5  
Ibuprophen's Avatar
OP Recognized Contributor
Flag Upstate New York
Thanks Meter: 6,150
 
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 13 Users Say Thank You to Ibuprophen For This Useful Post: [ View ] Gift Ibuprophen Ad-Free
14th August 2017, 11:24 PM |#6  
Thebear j koss's Avatar
Senior Member
Flag NYC
Thanks Meter: 19,770
 
More
Sweet. Thank you @Ibuprophen
The Following User Says Thank You to Thebear j koss For This Useful Post: [ View ] Gift Thebear j koss Ad-Free
15th August 2017, 12:36 AM |#7  
Ibuprophen's Avatar
OP Recognized Contributor
Flag Upstate New York
Thanks Meter: 6,150
 
Donate to Me
More
The SELinux Switch is now up on the XDA Labs Store.
The Following 6 Users Say Thank You to Ibuprophen For This Useful Post: [ View ] Gift Ibuprophen Ad-Free
15th August 2017, 08:38 AM |#8  
Member
Thanks Meter: 7
 
More
So the selinux switch and selinux toggler have the same exact function, right? Or is there a difference on features?
15th August 2017, 11:23 AM |#9  
CHEF-KOCH's Avatar
Senior Member
Thanks Meter: 234
 
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, 05:06 PM |#10  
Ibuprophen's Avatar
OP Recognized Contributor
Flag Upstate New York
Thanks Meter: 6,150
 
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, 08:00 PM |#11  
dgadelha's Avatar
Senior Member
Flag Bahia
Thanks Meter: 2,207
 
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

Tags
selinux, selinuxmodechanger, switch, toggle

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

Advanced Search
Display Modes