Android Security
Android’s layers
| Layer | Role |
|---|---|
| Applications | Provide interfaces and features, and use framework APIs to request system services. |
| Application framework | Manages component lifecycles, windows, resources, and system services. |
| Runtime and native libraries | The runtime executes bytecode stored in APK DEX files. Native libraries provide graphics, media, and other low-level capabilities. |
| Linux kernel | Manages processes, memory, filesystems, and device drivers. |
Component and process boundaries
Activities provide interfaces, services can be started or bound, broadcast receivers handle events, and content providers expose structured data. A service runs on the application's main thread by default, so long-running work needs a suitable execution context.
The app sandbox and permissions
Android generally assigns each app a distinct Linux UID. File permissions and process isolation establish the basic app sandbox. A permission-controlled content provider can share only the required resources. Normal, dangerous, and signature permissions have different grant conditions. Android version and target SDK affect how dangerous permissions are granted.
Intents and WebView
Intents can carry data across apps. Send sensitive values only to the intended recipient. A PendingIntent delegates a future action, so constrain its scope. A WebView that accepts external links should define which origins, schemes, and local files it permits.
Reviewing an app
Start with the manifest declarations and compare them with the system services, IPC, and data-sharing interfaces the app actually uses. Check logs from an app you control for sensitive data accidentally written to files or logs. USB debugging, Bluetooth, Wi-Fi, and NFC each have distinct connection and authorization boundaries.