Course contentsShow
← Security
Lesson 2713 of 3,05251. Mobile SecurityFree lesson

Android Application Sandboxing

How each app runs in its own sandbox with unique UID, preventing unauthorized access to other apps' data and resources.

Android Application Sandboxing

What you'll learn: How Android isolates each app in its own sandbox with a unique UID to prevent unauthorized access to other apps' data and resources.

The Core Security Boundary

Android application sandboxing is a fundamental security mechanism where each app runs in its own isolated environment—a "sandbox"—that prevents it from accessing other apps' data or system resources without explicit permission.

Think of it like apartment buildings: each app gets its own apartment (sandbox) with a unique key (UID). You can't just walk into your neighbor's apartment and access their belongings—the lock prevents it. Similarly, apps can't peek into each other's sandboxes by default.

How Sandboxing Works

When you install an Android app:

  1. Unique User ID (UID): The system assigns the app a unique Linux user ID—different from every other app
  2. Private Directory: The app gets its own private storage directory (/data/data/com.example.app) owned by that UID
  3. Process Isolation: The app runs in its own process with its own instance of the Dalvik/ART virtual machine
  4. File Permissions: Linux file permissions ensure that files owned by UID 10042 cannot be read by processes running as UID 10043

What This Prevents

  • Data theft: App A cannot read App B's saved passwords, tokens, or user data
  • Code manipulation: Malicious apps cannot modify another app's code or behavior
  • Resource abuse: One app cannot directly interfere with another's memory or CPU usage
  • Privilege escalation: Apps start with minimal privileges and must request more through the permission system (which you learned in the previous lesson)

Key Takeaway: Android's application sandboxing assigns each app a unique UID and runs it in an isolated process, creating strong security boundaries that prevent unauthorized inter-app access and contain potential security breaches to individual apps.