How to change selinux mode? - Sony Xperia M2

As the subject, i would like to ask how to change selinux mode for enforcing to permissive
I would like to install viper4android but it always refuse to install because i got my selinux enforcing mode
Thank in advance

Use the search box and look for a app called selinuxmode changer think I found it in apps+games on here. Install it grant root access set it to permissive at boot. Also if your wanting viperaudio on 5.1 you will also need to select awesome player instead of nu-player in developer options and as above set selinux to permissive with selinuxmode changer app then disable the music fx apk in settings/apps then you'll be good to go I'm using viper audio myself

aidy.lucas said:
Use the search box and look for a app called selinuxmode changer think I found it in apps+games on here. Install it grant root access set it to permissive at boot. Also if your wanting viperaudio on 5.1 you will also need to select awesome player instead of nu-player in developer options and as above set selinux to permissive with selinuxmode changer app then disable the music fx apk in settings/apps then you'll be good to go I'm using viper audio myself
Click to expand...
Click to collapse
There is no such application that you mentioned
I need to change my selinux mode, even i have to change it from application but i want a one time install so i can uninstall after i got my selinux permissive mode

So what's that app installed on my phone. Guessing you looked on the playstore and that was it. The selinuxmode changer app is available on this xda forum in apps and games
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
http://forum.xda-developers.com/showthread.php?t=2524485

aidy.lucas said:
So what's that app installed on my phone. Guessing you looked on the playstore and that was it. The selinuxmode changer app is available on this xda forum in apps and games
http://forum.xda-developers.com/showthread.php?t=2524485
Click to expand...
Click to collapse
I thought that was in play store
But, I'd like to know something. When i remove the app, am i still eligible for permissive mode on selinux? That's all what i want to know

31fahmi said:
I thought that was in play store
But, I'd like to know something. When i remove the app, am i still eligible for permissive mode on selinux? That's all what i want to know
Click to expand...
Click to collapse
No you'll not...
If you don't want to use an app, I recommend you doing the following:
Install MultiRecovery on your device. Once installed, open a Terminal and type in:
Code:
su
insmod /system/lib/modules/selinux_mod.ko
Now you'll have permissive SElinux... But as you know, all modules get unloaded in every reboot. To load it from the very beggining, create a init.d script (in /system/etc/init.d/), called 02whatever_you_want, with a content like this:
Code:
#!/system/bin/sh
insmod /system/lib/modules/selinux_mod.ko
That's the easiest way I know to get it. Good luck!

linuxct said:
No you'll not...
If you don't want to use an app, I recommend you doing the following:
Install MultiRecovery on your device. Once installed, open a Terminal and type in:
Code:
su
insmod /system/lib/modules/selinux_mod.ko
Now you'll have permissive SElinux... But as you know, all modules get unloaded in every reboot. To load it from the very beggining, create a init.d script (in /system/etc/init.d/), called 02whatever_you_want, with a content like this:
Code:
#!/system/bin/sh
insmod /system/lib/modules/selinux_mod.ko
That's the easiest way I know to get it. Good luck!
Click to expand...
Click to collapse
Okay i will try
Thanks mate
But wait, for today i have been enough for messing my phone and now i got a very important schedule to do. Is there anyway to install selinux_mod.ko without installing such recovery? @linuxct

Related

[TIP] - Make *ViPER4Android* Work on *ANY* Marshmallow Device EASILY !!

Make ViPER4Android work on any marshmallow device : SELinux Permissive Fix
This is the easiest method I found so far, to make Viper4Android work on my V10 H960A running MM
Thanks to Sidharth Pk Here’s how you can install ViPER4Android on your Android phone running on Marshmallow or above. Change the SELinux policy from Enforcing to Permissive and enable ViPER4Android on your device. Also, fix the common errors while installing V4A like abnormal driver status, no processing etc.
I will copy/paste here his short instructions and for further details I will post a link to his page at the end of this post
Change SELinux to Permissive & Make ViPER4Android Work on any Marshmallow Device (By Sidharth Pk) :
ViPER4Android itself needs root access. So there’s no point of saying that your device must have root privileges.
.
Get ViPER4Android’s latest APK from here and install it on your Marshmallow device.
.
Now open it and let it install the driver for your device.
.
Once you get the install complete message, simply reboot the phone.
.
After bootup, Install Terminal Emulator App from here and install it on your phone.
.
Open it and perform the following commands one after one
Click to expand...
Click to collapse
Code:
[COLOR="Navy"][SIZE="4"][SIZE="5"]su
setenforce[/SIZE][/SIZE][/COLOR]
Close the terminal and check the driver status on ViPER4Android app, it should display like this:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
The Enable & Processing status will automatically change to Yes once you activate the master power option and start playing music on your headphone/speaker. If this method doesn’t work for you, you can flash the ViPER4Android Marshmallow ZIP file. It changes the SELinux from Enforcing to Permissive.
For more info have a look at the original thread/page:
http://www.techbii.com/install-viper4android-marshmallow/
Enjoy !
We can discuss here afterwards, why install Viper4Android in a phone with already such a great sound out of the box, such as the LG V10...
Cheers
.
.
Reserved

[TIP] - Make *ViPER4Android* Work on *ANY* Marshmallow Device EASILY !!

FIRST OF ALL :
For rooted devices, busybox properly installed , etc. etc.!
Works on MM, should work on Nougat to...
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Make ViPER4Android work on any marshmallow device : SELinux Permissive Fix
This is the easiest method I found so far, to make Viper4Android work on my V10 H960A running MM
Thanks to Sidharth Pk Here’s how you can install ViPER4Android on your Android phone running on Marshmallow or above. Change the SELinux policy from Enforcing to Permissive and enable ViPER4Android on your device. Also, fix the common errors while installing V4A like abnormal driver status, no processing etc.
I will copy/paste here his short instructions and for further details I will post a link to his page at the end of this post
Change SELinux to Permissive & Make ViPER4Android Work on any Marshmallow Device (By Sidharth Pk) :
ViPER4Android itself needs root access. So there’s no point of saying that your device must have root privileges.
.
Get ViPER4Android’s latest APK from here and install it on your Marshmallow device.
.
Now open it and let it install the driver for your device.
.
Once you get the install complete message, simply reboot the phone.
.
After bootup, Install Terminal Emulator App from here and install it on your phone.
.
Open it and perform the following commands one after one
Click to expand...
Click to collapse
Code:
[COLOR="Navy"][SIZE="4"][SIZE="5"]su
setenforce[/SIZE][/SIZE][/COLOR]
Close the terminal and check the driver status on ViPER4Android app, it should display like this:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
The Enable & Processing status will automatically change to Yes once you activate the master power option and start playing music on your headphone/speaker. If this method doesn’t work for you, you can flash the ViPER4Android Marshmallow ZIP file. It changes the SELinux from Enforcing to Permissive.
For more info have a look at the original thread/page:
http://www.techbii.com/install-viper4android-marshmallow/
Cheers
Didn't work for me.
didn't worked for me either !!

Complete uninstall system app or Install app with conflicting package

Hey guys, excuse my ignorance before I begin.
I am trying to install a modded Spotify apk on my Samsung GS7 Nougat [Rooted]. Spotify already comes pre-installed as a system app on my phone so installation fails due to "conflicting package".
Is there a way to complete uninstall a system app? I've tried titanium backup but it simply disables it, giving me the same installation error.
Alternatively is there a foolproof way of install the modded apk side by side with the "disabled" system app?
Enable Secure Startup from Lock screen / security settings > reboot phone > try installing the APK again
*Detection* said:
Enable Secure Startup from Lock screen / security settings > reboot phone > try installing the APK again
Click to expand...
Click to collapse
No such option/feature exists in "Lock screen and security".
x3malex said:
No such option/feature exists in "Lock screen and security".
Click to expand...
Click to collapse
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
*Detection* said:
Click to expand...
Click to collapse
I'm afraid that selection literally does not exist in my options. Is it possible it disappeared after root or something? I'm running 7.0 G930W8VLU2BQG4
x3malex said:
I'm afraid that selection literally does not exist in my options. Is it possible it disappeared after root or something? I'm running 7.0 G930W8VLU2BQG4
Click to expand...
Click to collapse
Yea that's possible, maybe a security thing, certain KNOX related apps won't run once you've rooted and tripped knox either
EDIT - It seems without encryption you can not use secure startup, you must have wiped and removed encryption
https://forum.xda-developers.com/s7-edge/help/secure-startup-missing-t3480008
*Detection* said:
Yea that's possible, maybe a security thing, certain KNOX related apps won't run once you've rooted and tripped knox either
EDIT - It seems without encryption you can not use secure startup, you must have wiped and removed encryption
https://forum.xda-developers.com/s7-edge/help/secure-startup-missing-t3480008
Click to expand...
Click to collapse
That's the only reason why I rooted my phone in the first place , to install this dreaded spotify app.
x3malex said:
That's the only reason why I rooted my phone in the first place , to install this dreaded spotify app.
Click to expand...
Click to collapse
Try this
https://play.google.com/store/apps/details?id=com.jumobile.manager.systemapp&hl=en_GB
Or add Spotify to a debloat script and flash from TWRP
*Detection* said:
Try this
https://play.google.com/store/apps/details?id=com.jumobile.manager.systemapp&hl=en_GB
Or add Spotify to a debloat script and flash from TWRP
Click to expand...
Click to collapse
So I tried system app uninstaller earlier and it failed on all the apps, but it actually seemed to work this time. I finally managed to uninstall it and install the modded apk. Thank you very much for your help!
Great :good:

How to move Magisk from a system app to a user app?

I'm trying this LG Spirit Resurrection Remix ROM and it has Magisk as system app which is bad apparently.
How to fully delete Magisk as a system app, so I can reinstall it later? I'm guessing I'll have to install a different root solution, but... which, and how?
Any help appreciated.
Remark: Android is rooted as soon as the SU-binary ( ~ 100 KB ) is present in Android's /system partition.
As long as Android is rooted you can try to convert Magisk app into an user-app by means of Link2SD app, what means it will get moved from /system to /data - where the other stuff Magisk installs is already located. Take note that system apps are granted the ability to request certain system-only permissions that are never available to user apps. This is not the same as su permissions
IMO the easiest way to get Magisk completely off your Android device is to simply uninstall it from within the Magisk manager app:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
for the record: what I needed to remove was Magisk Manager, not Magisk, and the only way was to uninstall/disable it then manually delete the .apk in system/app after rooting with SuperSU.
Thanks for helping jwoegerbauer
jwoegerbauer said:
As long as Android is rooted you can try to convert Magisk app into an user-app by means of Link2SD app, what means it will get moved from /system to /data - where the other stuff Magisk installs is already located. Take note that system apps are granted the ability to request certain system-only permissions that are never available to user apps. This is not the same as su permissions
IMO the easiest way to get Magisk completely off your Android device is to simply uninstall it from within the Magisk manager app:
Click to expand...
Click to collapse
Is it possible to convert a system app to a user app and then uninstall it?
Stephanie_Sy said:
Is it possible to convert a system app to a user app and then uninstall it?
Click to expand...
Click to collapse
One have to distinguish between apps located in /system/apps and those located in /system-priv-apps:
Apps located in /system/apps are essential apps to make Android work: they basically are not granted system privileges.
Apps located in /system/priv-apps are 3rd-party apps typically installed by OEM ( e.g. launcher ) what are granted system privileges.
Knowing this it's obvious that uninstalling apps what are located in /system/apps at 99% will brick Android whereas uninstalling apps located in /system/priv-apps mostly will not harm Android.
Long story short: You can directly uninstall apps located in /system/priv-apps, they must NOT be converted into user-app before.

Tried modifying contents of a dev file in root condition, yet failed!

Hello guys, iam trying to control the brightness of camera LED in my Letv Le X509 phone (Android 6 Marshmellow version), and it is rooted. I used adb shell to interact with my device in "su"(root) mode. within the sys/class/leds folder there is no led_torch folder, only the folders blue,green,red which are notifcation leds folders . I tried searching for the led_torch folder and i only got a flashlightdrv folder, so thought this must be it, but within it these are the contents,
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
no brightness file found where i can modify the brightness level, i tried modifying the dev file and this is the result i got! permission denied, when iam accessing as root
What am i missing? My ultimate aim is to write a pwm script to control the torch_led, plzz help me if you can and help me figure out what is that stuff that is blocking me out
you forgot the android framework. whatever you are trying to do on linux runtime kernel parameters - android can do, too. android is on top of linux, so it will override you sooner or later.
regarding permissions, you're learning it the hard way like me... uid 0 (root) doesn't mean you have actually root access. android kitkat introduced (NSA) SELinux which was enforced with lollipop. besides this android uses fancy stuff like separated mount namespaces and launches every app with its own uid in a sandboxed virtual machine forked from zygote.
so if you're going to mess with permissions you have to do it from own init.rc service and exec with proper seclabel (u:r:magisk:s0, u:r:supersu:s0 or whatever)
https://forum.xda-developers.com/t/dev-guide-2016-12-22-how-to-su.1962550
Oh , weird! iam just a novice in this android field , iam just using it for a project to blink my smartphone LED at a particular frequency(using android studio), problem is above 40 Hz is not achievable, so my requirement is to access the torchLED driver through Kernel and control it so that i can achieve a higher frequency and i need to root to access that.
The Weird thing is root checker indicated me that the root is properly installed on this device and i was able to control the notification LEDs like green , blue and red(under sys/class/leds) properly through my so called "root" access. Iam just taken aback why iam not able to modify that kernel file..
I will go through your posted link and find some way to get through it! Thanks !
Oh i think i get it, the SE Linux is acting as the security layer that is preventing my root to modify the contents of the driver file of torchLED, but iam suprised on why it did allow me to modify the contents of notification leds? (under sys/class/leds)
look for avc denied in dmesg/logcat
https://gist.github.com/msfjarvis/sepolicy.md
Will do ! Thanks!
you can shortcut if kernel allows permissive
Code:
setenforce 0
getenforce
there is also an app for (v11 on github.com)
[APP][Root][4.2+]SELinuxModeChanger v10.0 :: [24.07.2017]
Now opensourced under gplv3! GITHUB Get it in f-droid F-DROID page (v10 probably won't be there until release of stable gradle 4.0 and buildtools 26) Now available on the XDA Labs! XDA Labs page (UPD: somebody released a fork without changing...
forum.xda-developers.com

Categories

Resources