Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use the package name as the domain name in Android SELinux?

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.

like image 359
alec.tu Avatar asked Mar 07 '15 11:03

alec.tu


People also ask

Do we need domain name for Android app?

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.

Does Android use SELinux?

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.

What is domain name in Android Studio?

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.

Where are SELinux policies stored Android?

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.


1 Answers

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

like image 54
alec.tu Avatar answered Sep 19 '22 21:09

alec.tu