Related
Hello,
I'm running CyanogenMod 12 on a Nexus 7 (2013, flo, 2015-02-03 nightly).
I messed with SELinux contexts while on recovery (MultiROM TWRP) and now none of the applications work. I temporarily fixed it by editing the kernel's command line and setting SELinux policy to permissive and flashing the updated kernel, but this is obviously not a permanent fix as it lowers security and needs to be reset after every update. How can I restore all the contexts for all the apps without wiping data (I have important stuff)?
I tried "restorecon -FR /data/*" but it didn't help.
Thank you very much, have a nice day!
Sorry to bring this back, but this issue is likely to be shared by others (beyond me right now), so did you ever find a solution?
Well for those interested, I found a solution. To restore the SELinux context for an app whose data is in "/data/data/org.app.app", run (as root):
Code:
restorecon -Rv /data/data/org.app.app
You can run
Code:
ls -Z
before and after to see the changes made to the files.
Once SELinux context is restored, should be able to use your app normally and check that SELinux is still being enforced with getenforce:
Code:
[email protected]:/data/data/org.app.app # getenforce
Enforcing
Hope this helps.
Please help
thisisabore said:
Well for those interested, I found a solution. To restore the SELinux context for an app whose data is in "/data/data/org.app.app", run (as root):
Code:
restorecon -Rv /data/data/org.app.app
You can run
Code:
ls -Z
before and after to see the changes made to the files.
Once SELinux context is restored, should be able to use your app normally and check that SELinux is still being enforced with getenforce:
Code:
[email protected]:/data/data/org.app.app # getenforce
Enforcing
Hope this helps.
Click to expand...
Click to collapse
I'm very inexperienced with all this, and I don't understand how to do the given solution. I need step by step instructions ?. I don't know if the type of os matters, but I'm running kitkat on a rooted Samsung Galaxy s4
Mikey6God said:
I'm very inexperienced with all this, and I don't understand how to do the given solution. I need step by step instructions ?. I don't know if the type of os matters, but I'm running kitkat on a rooted Samsung Galaxy s4
Click to expand...
Click to collapse
Hi. Just to be sure, if you are very inexperienced, why do you think you are having SELinux-related issues?
Otherwise, to answer your question, you need to run these commands in a terminal emulator. So either using adb shell on your computer or directly on the device with a terminal emulator such as Termux. If you don't know how to run commands, then look into that before, as there is a real possibility to mess things up badly when using a shell as root.
thisisabore said:
Well for those interested, I found a solution. To restore the SELinux context for an app whose data is in "/data/data/org.app.app", run (as root):
Hope this helps.
Click to expand...
Click to collapse
Thank you very much. It solves all my problems !!!
I really had alot problems with selinux.
After two years, I have the solution, because of you.
Thank you very much again
Hi guys.
Selinux mode changer can't get root access, so i can't use ViperFX. On lolipop it was working properly, but not on Marshmallow. Does anyone know maybe some solution to change the Selinux to permissive? There is some command through ADB, and it's working, but after hard restart, it goes back to enforce. I need a permanent solution, if there is any, or if there is any other way to run ViperFX without changing to permissive... Thanks.
Use kernel adiutor app and download plugin.
Help
Sent from my Redmi Note 3 using XDA-Developers mobile app
Do you mean by change SElinux to premsive or enforcing
Changer is working with both for me....
android_smater said:
Do you mean by change SElinux to premsive or enforcing
Changer is working with both for me....
Click to expand...
Click to collapse
It's not working for me. I am using a system less root using magisk
Sent from my Redmi Note 3 using XDA-Developers mobile app
Download terminal emulator from google play and then enter code "su" grant root access after that enter code "getenforce" click ok you will see either enforcing or permissive if there is enforcing then enter code "setenforce 0" linux mode will be changed to permissive if you want to change to enforcing then enter "setenforce 1" and again check your linux mode via entering "getenforce". Hoping its may help
maxpaynebeck said:
It's not working for me. I am using a system less root using magisk
Sent from my Redmi Note 3 using XDA-Developers mobile app
Click to expand...
Click to collapse
Well, there is your reason. Selinux mode changer doesn't wait for root access, and system less root always takes a bit more time to receive a root request from application. That's why Selinux mode changer will never have root request granted.
You can try using some scripts etc (I never tried it) or you can perform normal root.
Sent from Note 3, Xiaomi Redmi Note 3.
muklshakya123 said:
Download terminal emulator from google play and then enter code "su" grant root access after that enter code "getenforce" click ok you will see either enforcing or permissive if there is enforcing then enter code "setenforce 0" linux mode will be changed to permissive if you want to change to enforcing then enter "setenforce 1" and again check your linux mode via entering "getenforce". Hoping its may help
Click to expand...
Click to collapse
How about using magisk... Any tips
I'm using the Chinese Find X, and when I try to give permission to an app to use WRITE_SECURE_SETTINGS via ADB.
I enter this:
adb shell pm grant it.simonesestito.ntiles android.permission.WRITE_SECURE_SETTING
and am met with:
Operation not allowed: java.lang.SecurityException: grantRuntimePermission: Neither user 2000 nor current process has android.permission.GRANT_RUNTIME_PERMISSIONS.
I have never had this problem with a phone, Chinese ROM or not.
I also tried enabling immersive mode, and received:
Security exception: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS
I couldn't find anything on Google. Can anybody help me out?
tyia
The more you dig into Chinese rom, the sooner you will find that Chinese android sys is not android, it's AnZhuo......
Apparently, the permission is removed for this operation.
You have to turn off the last security option in dev mode on your X. Did not remeber the name.
dragon-tmd said:
You have to turn off the last security option in dev mode on your X. Did not remeber the name.
Click to expand...
Click to collapse
hi, same problem here. Where can I find the "last security option" - what does it mean? Don´t have any idea to solve it
In developer options, enable "USB Debugging (Security settings). If you do not know how to enable developer options in android, search google.
last option in dev mode : Disable permission monitoring
abidalishakir.khan said:
In developer options, enable "USB Debugging (Security settings). If you do not know how to enable developer options in android, search google.
Click to expand...
Click to collapse
Thank you, sir. Spot on!
Worked on realme 3 pro too.!!
stutoni said:
last option in dev mode : Disable permission monitoring
Click to expand...
Click to collapse
Thanks sir/ma'am ??
stutoni said:
last option in dev mode : Disable permission monitoring
Click to expand...
Click to collapse
Thanks! Worked on my Reno 10x Zoom.
stutoni said:
last option in dev mode : Disable permission monitoring
Click to expand...
Click to collapse
Thanks, you save my day
Thanks
abidalishakir.khan said:
In developer options, enable "USB Debugging (Security settings). If you do not know how to enable developer options in android, search google.
Click to expand...
Click to collapse
This has helped all the devices running ColourOS like my Realme U1. Thanks anyway
stutoni said:
last option in dev mode : Disable permission monitoring
Click to expand...
Click to collapse
cheers man i was wondering why i kept having issues with battery_stats for my reno z and this fixed it.
abidalishakir.khan said:
In developer options, enable "USB Debugging (Security settings). If you do not know how to enable developer options in android, search google.
Click to expand...
Click to collapse
thanks. It worked on a Mi Note 10 lite
erase & format....
Good morning/noon/afternoon and evening... Just asking if there is a easy way to activate the oppo find x PAFM00 version after erasing data and reformat then the device lock and forgot the oppo id to activate? thanks...
thanks from oppo F9 users
stutoni said:
last option in dev mode : Disable permission monitoring
Click to expand...
Click to collapse
Thank you so much.
stutoni said:
last option in dev mode : Disable permission monitoring
Click to expand...
Click to collapse
Thank you. Spot on!
I kept getting this error, despite enabling USB debugging, and able to connect with adb shell. And by disabling the permission monitoring setting, I can change the Android settings now, and this is for Realme C2.
adityakar said:
Thanks! Worked on my Reno 10x Zoom.
Click to expand...
Click to collapse
Didn't work for my oppo f9 pro ,COLORos ,also have disable permission monitoring but still same issue I don't know why I tried to grant permission once before after enabling that disable permission monitoring option and it worked but am doing that again after a couple of days but idk why it doesn't work even after enabling that option now,btw I am trying to use root tiles in quick settings and through adb I wanna grant the permissions to use root needing tiled to be enabled
Kang saab6 said:
Didn't work for my oppo f9 pro ,COLORos ,also have disable permission monitoring but still same issue I don't know why I tried to grant permission once before after enabling that disable permission monitoring option and it worked but am doing that again after a couple of days but idk why it doesn't work even after enabling that option now,btw I am trying to use root tiles in quick settings and through adb I wanna grant the permissions to use root needing tiled to be enabled
Click to expand...
Click to collapse
did you find a solution?
Finally i found a method to record call on realme gt 2 pro global gdpr version, who is persistent at boot. No root, no bootloader unlock.
Step one : install setedit from play store and add op_voice_recording_supported_by_mcc with 1 value to global settings. You have to give Setedit write secure rights with adb
Step two : install phone apk below.
That's it. Start Google dialer and make a call. Still works after reboot.
Not working : automatic call recorder, you have to press record button when you're in call.
Notice: if you don't see record button in Google dialer , is normal, just press back button to see realme dialer.
This should work on all color os 3 device.
Recorded call are in internal memory / music/ recordings/ call recordings folder.
ENJOY !!
No working... No see
Which apk needs to be installed for step two?
NVM I figured it out
Not working, it has changed the dialer but instead of recording button I have a "contacts" button and when I press it nothing happens.
Please uninstall phone from installed apps and install again.
criszz said:
Please uninstall phone from installed apps and install again.
Click to expand...
Click to collapse
Same, tried also to reboot but nothing
No permission to add a new line in Global Table
RazvanelTM said:
No permission to add a new line in Global Table
Click to expand...
Click to collapse
Same here, I've added the option in the system table maybe that's why it is not working
Yes, you must provide write secure rights for setedit with adb to edit in global.
Updated first post with that.
criszz said:
Yes, you must provide write secure rights for setedit with adb to edit in global.
Updated first post with that.
Click to expand...
Click to collapse
How can do? Have any tutorials?
manu81cba said:
How can do? Have any tutorials?
Click to expand...
Click to collapse
By default, for your protection, Android prevents you from modifying the SECURE and GLOBAL tables. If you have Android Jellybean or later, you can remove this protection from an ADB shell using the command "pm grant by4a.setedit22 android.permission.WRITE_SECURE_SETTINGS". On earlier versions, you can only remove this protection on a rooted device by installing SetEdit to the system partition.
All working flawless now I can confirm that
Not working when giving the permission in adb
RazvanelTM said:
Not working when giving the permission in adb
Click to expand...
Click to collapse
Try to activate first in the developers options this one: "Disable permission monitoring"
shootemdown371 said:
Try to activate first in the developers options this one: "Disable permission monitoring"
Click to expand...
Click to collapse
It worked, thanks!
Now it's confirmed to work and we must think how to enable automatically record for all calls. People who said not working without knowing, please edit your post.
In setedit ...you know what need change for active the volte ?
Thank you very much it's working for me!
PS for those unfamiliar with SetEdit can also use this in adb after disabling permission monitoring:
adb shell settings put global op_voice_recording_supported_by_mcc 1
Just must be applied after every restart ( that is what i read )
Nice post, thanks for sharing. Any solution for Xiaomi Redmi Note 10S, Global ROM MI?
Also working on the regular gt2