Android SELinux( or you can say SEAndroid) defines many domains which include system_app, platform_app, isolated_app, etc.
Each domain has different meanings, for example, system_app includes all the apps which share the system uid, and the platform_app includes all the apps which sign the platform key.
All the SE files are located in external/sepolicy, I can modify the rules from these files.
Is it possible to define a new domain which points to a specified package name (For example, com.google.android.music)?
I do not find any document or example about that, so I am not sure how to do that.
I will appreciate any suggestions or comments.
Thank you.
Moreover, you will have to reserve a domain name for your app first and enter the name or link of the social media pages linked with your app including Facebook, Twitter, etc.
As part of the Android security model, Android uses Security-Enhanced Linux (SELinux) to enforce mandatory access control (MAC) over all processes, even processes running with root/superuser privileges (Linux capabilities). Many companies and organizations have contributed to Android's SELinux implementation.
The domain name is used by Android Studio to generate a package name. Your package name is just a unique identifier for your application in the Google Play Store. It can be anything you want as long as it is unique. Generally, we use reverse domain names like com. something. or org.
By default, Android provides an SELinux policy for the components which are specific to the AOSP platform. You can find these stored in the platform/system/sepolicy repository of AOSP. Downstream vendors modifying AOSP and adding additional functionality must write their own SELinux policies.
After a long research, I find a way to define a new domain for a specified package
Define a new domain in seapp_contexts
like this,
user=_app domain=googlemusic seinfo=platform name=com.google.android.music type=app_data_file
then define the permission of a new domain googlemusic
create a te file called googlemusic.te
type googlemusic_app,domain
app_domain(googlemusic)
#more permissions
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With