简体   繁体   中英

How to get the SELinux context of a specified file on Android?

I'm developing a SU-aware app for Android, and found that SELinux context configuration and policies on some devices are slightly different than others.

Is there any public or hidden API of Android SDK to query SELinux context of a specified file, like what "ls -Z" provides in shell?

Look at this.

https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/os/SELinux.java

And maybe You know how to set SELinux scontext for Android Application from store. I want change utrusted_app for my custom domain.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM