Android Security Model
Android security is built on two layers:- The OS, which keeps installed applications isolated from one another via UID separation and sandboxing
- The application itself, which allows developers to expose certain functionalities and configure capabilities
UID Separation & Sandboxing
UID Separation & Sandboxing
Each application is assigned a unique User ID at install time and can only access files owned by that UID or shared files. From Android 5.0, SELinux is enforced, denying all process interactions except those explicitly allowed by policy.Two apps can share a UID by defining the same
android:sharedUserId in their manifests — but if one is compromised, both apps’ data is at risk.Permissions
Permissions
Permissions are declared in
AndroidManifest.xml via uses-permission elements. The four protection levels are:- Normal — granted automatically, no user prompt
- Dangerous — requires explicit user approval
- Signature — only granted to apps signed by the same certificate
- SignatureOrSystem — signature or system-level access
APK Format
APK Format
An APK is essentially a ZIP file containing:
AndroidManifest.xml— component declarations and permissionsclasses.dex— Dalvik bytecode (compiled Java/Kotlin)lib/— native libraries per CPU architecture (armeabi-v7a,arm64-v8a,x86)assets/— miscellaneous files (sometimes used to hide extra DEX files)res/— resources not compiled intoresources.arscMETA-INF/— certificate and signature data
ADB — Android Debug Bridge
ADB is the primary tool for communicating with Android devices (physical or emulated).Static Analysis
APK Decompilers
jadx
Best-in-class decompiler with GUI and CLI.
jadx app.apk decompiles to Java; jadx-gui opens the GUI.Bytecode-Viewer
Analyze APKs using multiple decompilers simultaneously for cross-verification.
GDA
Windows-only tool with extensive reverse engineering features for Android apps.
frida-DEXdump
Dumps DEX from a running application — bypasses static obfuscation that’s stripped at runtime.
Manifest Analysis
Key vulnerabilities to look for inAndroidManifest.xml:
- Debuggable apps (
debuggable="true") allow connections that can lead to exploitation - Backup settings —
android:allowBackup="false"should be explicit for sensitive apps - Network Security Config — check for
cleartextTrafficPermitted="true" - Exported Activities/Services/Providers — may allow unauthorized access
- SDK versions —
minSdkVersionbelow 21 supports vulnerable Android versions
Looking for Sensitive Information
Tapjacking
Tapjacking places a malicious transparent overlay above a victim app, causing the user to interact with the victim app unknowingly. Test forFLAG_SECURE window protection and proper touch filtering.
Insecure Data Storage
- Internal Storage
- External Storage
Files stored internally are app-private by default, but
MODE_WORLD_READABLE and MODE_WORLD_WRITABLE can expose them to other apps.Check files at /data/data/<packagename>/shared_prefs/ and /data/data/<packagename>/databases/.Broken TLS
Dynamic Analysis
A rooted device (physical or emulated) is strongly recommended. Magisk on Pixel devices provides the best compatibility with Frida.
Emulators
- Android Studio AVD — supports x86 images with ARM library translation
- Genymotion — free personal edition; supports Frida and Drozer
- Online: Appetize.io for quick APK testing with ADB access
Unintended Data Leakage
- Clipboard caching — sensitive fields should disable copy/paste
- Crash logs — avoid logging sensitive info; check
/data/data/<package>/ - SQLite databases — enumerate with
.tablesand.schema <table>
Exploiting Exported Components
SSL Pinning Bypass
Frida Instrumentation
Dump Memory with Fridump3
Automated Analysis Tools
MobSF
Mobile Security Framework. Static + dynamic analysis via Docker:
Drozer
Assumes the role of an Android app to interact with other apps via IPC — exploits exported activities, services, and content providers.
QARK
LinkedIn’s static analyzer. Finds exported activities, intent issues, tapjacking, and generates PoC APKs.
mariana-trench
Facebook’s static analysis tool that tracks data flows from sources to dangerous sinks.
AIDL / Binder Service Enumeration
Stub.onTransact() to map transaction codes to method names. Absence of permission checks (enforceCallingPermission, checkCallingOrSelfPermission) is a vulnerability indicator.
Intent Injection
Proxy components that accept Intents and pass them tostartActivity() or sendBroadcast() without validation can be abused. A notable vector is WebView converting URLs to Intents via Intent.parseUri(...) and executing them — potentially enabling:
- Triggering non-exported app components
- Accessing sensitive Content Providers
- Open-redirect style attacks analogous to web applications