go back...

The Mystical Android Sandbox and IPC (Inter-process communication)

Android

Android inherits many UNIX security features such as process isolation, UID and GID paradigm, and so on. The idea of Android sandbox is to basically assign each installed application a UID and its user space will conform to the principle of least privilege. Below is a great illustration to visualize Android sandboxing by assigning different UID to every application. This is a well-thought-out security mechanism that really mitigates and simplifies many permission problems that can exist in Android.

Photo

Details of user matrix can be found in /data/system/packages.list. The order of the packages.list format is package name, UID, debuggable flag, data directory, seinfo label and GIDs.

root@hermes:/ # cat /data/system/packages.list
com.miui.gallery 10018 0 /data/data/com.miui.gallery platform 3003,1028,1015,1023
com.android.calendar 10003 0 /data/data/com.android.calendar default 3003,1028,1015
com.android.backupconfirm 10001 0 /data/data/com.android.backupconfirm platform none

As we have discussed, a new UID will be assigned to every newly installed application and GIDs will be assigned depending on what hardware components the application requested. It is obvious that it would be a design fault if the system only relied on the user as the sole mechanism for granting permissions like send SMS, read SMS, and so on. Hence, a privilege metric for permissions is implemented - Protection Level. Every android permission are categorised into 4 different kinds of flags. The system default permissions are described here. Applications may declare their own permissions for other application to use.

source

Inter-Process Communication

As illustrated earlier every process on android has its own sandbox and it uses IPC to enable apps to exchange information and data in a secure way. Instead of relying on the Unix IPC, Android is using Binder, a custom implementation of OpenBinder.

Intent messaging is a framework for asynchronous communication built on top of binder. This framework enable to messaging between application. Intent is a messaging object that you can use to request an action from another app component. There are three fundamental use cases:

There are two types of Intents:

An intent filter is an expression in an app’s manifest file that specifies the type of intents that the component would like to receive. For instance, by declaring an intent filter for an activity, you make it possible for other apps to directly start your activity with a certain kind of intent. Likewise, if you do not declare any intent filters for an activity, then it can be started only with an explicit intent.

References:

© 2026 ryantzj • Theme Moonwalk