android-analysis
Skill37 starsChanged 3 months agoMITView on GitHub
Load when analyzing an Android APK or its decompiled sources, covering AndroidManifest security review, exported component and intent testing, deep link and WebView analysis, SharedPreferences and SQLite storage review, and JNI native library inspection.
In this repository9 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- binary-reversingSkill
- ios-analysisSkill
- mobile-huntingSkill
- mobile-reconSkill
- mobile-vuln-classesSkill
- report-writingSkill
- sdk-analysisSkill
- triage-validationSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 2 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
After apktool + jadx extraction:
- Distinctive: line 29
Analysis order: Always start with the manifest (ground truth), then move to decompiled source, then native libraries.
- Very specific: line 174
Detection in source: Search for getParcelableExtra followed by startActivity, startService, or sendBroadcast without component validation.
- Very specific: line 186
Detection: Search for PendingIntent.get(Activity|Service|Broadcast) where the base intent is implicit (no setComponent() / setClass()) and …
- Very specific: line 316
Use of GetStringUTFChars without length checks
- Distinctive: line 352
When reviewing decompiled Java source, focus on:
- Very specific: line 362
Do NOT attempt to review all source.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Android Analysis: Platform-Specific Techniques
This skill defines Android-specific analysis techniques for MobHunt hunter agents. It is loaded by /hunt-android and /recon commands and used by Android hunter agent instances.
App Structure
After apktool + jadx extraction:
apktool/
AndroidManifest.xml ← decoded, human-readable manifest
res/xml/ ← network_security_config.xml, file_paths.xml, etc.
assets/ ← raw assets (configs, databases, certs)
lib/<abi>/ ← native .so libraries
smali/ ← Dalvik bytecode (fallback if jadx fails)
jadx/
sources/ ← decompiled Java source tree
resources/ ← resource filesAnalysis order: Always start with the manifest (ground truth), then move to decompiled source, then native libraries.
AndroidManifest Security Analysis
Critical Attributes
<application
android:allowBackup="true" <!-- backup extraction risk -->
android:debuggable="false" <!-- must be false in production -->
android:usesCleartextTraffic="false" <!-- HTTP policy -->
android:networkSecurityConfig="@xml/network_security_config"
>SDK Version Analysis
<uses-sdk
android:minSdkVersion="24" <!-- security baseline -->
android:targetSdkVersion="34" <!-- behavior changes -->
/>| targetSdk | Key Security Changes |
| < 28 | Cleartext HTTP allowed by default |
| < 31 | PendingIntent defaults to mutable |
| < 33 | POST_NOTIFICATIONS not required |
| < 34 | Fewer restrictions on implicit intents |
minSdkVersion < 24: App supports Android < 7.0, which lacks Network Security Config enforcement. Note this.
Permission Analysis
Dangerous permissions to flag:
READ_CONTACTS,READ_CALL_LOG,READ_SMS: PII accessACCESS_FINE_LOCATION,ACCESS_BACKGROUND_LOCATION: trackingCAMERA,RECORD_AUDIO: surveillanceREAD_EXTERNAL_STORAGE/MANAGE_EXTERNAL_STORAGE: broad file accessSYSTEM_ALERT_WINDOW: overlay attacks (tapjacking)BIND_ACCESSIBILITY_SERVICE: full screen content access
Permissions alone are not findings. They are context for other vulnerabilities.
Component Analysis
Export Rules
A component is exported if:
android:exported="true"is set explicitly, OR- The component has an
<intent-filter>ANDtargetSdkVersion < 31
For targetSdkVersion >= 31, exported must be declared explicitly for components with intent filters.
Exported Activities
# Test: launch exported activity
adb shell am start -n <package>/<activity>
# With extras
adb shell am start -n <package>/<activity> --es key "value"
# With data URI
adb shell am start -n <package>/<activity> -d "content://..."What to check:
- Does the activity display sensitive data without re-authentication?
- Does it accept intent extras that control behavior (file paths, URLs, user IDs)?
- Is it a WebView activity that loads URLs from intent data?
Exported Services
# Test: start service
adb shell am startservice -n <package>/<service>
# Bind to service
# (requires PoC app for AIDL/Messenger binding)What to check:
- Does the service perform privileged operations on behalf of any caller?
- Is there caller verification (
Binder.getCallingUid())?
Content Providers
# Query provider
adb shell content query --uri content://<authority>/
# With projection
adb shell content query --uri content://<authority>/users --projection "name:password"
# SQL injection test
adb shell content query --uri content://<authority>/users --where "1=1) OR 1=1--"What to check:
- Is the provider exported without
readPermission/writePermission? - Does
query()use raw SQL or parameterized queries? - Does the provider serve files? Check for path traversal:
content://<authority>/../../etc/passwd
Broadcast Receivers
# Send broadcast
adb shell am broadcast -a <action> -n <package>/<receiver>
# With extras
adb shell am broadcast -a <action> --es data "payload"Intent & Deep Link Analysis
Deep Link Types
| Type | Mechanism | Security |
Custom scheme (myapp://) | <data android:scheme="myapp"/> | No verification; any app can register |
App Links (https://) | <data android:scheme="https"/> + autoVerify="true" | Verified via /.well-known/assetlinks.json |
| Web intents | <data android:scheme="https"/> without autoVerify | Chooser dialog, ambiguous |
Custom scheme without autoVerify: Standalone finding if the scheme carries OAuth tokens, session data, or sensitive parameters.
Intent Redirection
The most impactful Android-specific vulnerability class:
// VULNERABLE: extracts intent from extras and starts it
Intent redirect = getIntent().getParcelableExtra("next_intent");
startActivity(redirect); // attacker controls destinationImpact: Attacker can access any non-exported component within the app's context, bypassing exported=false.
Detection in source: Search for getParcelableExtra followed by startActivity, startService, or sendBroadcast without component validation.
PendingIntent Hijacking
// VULNERABLE: implicit intent + mutable PendingIntent
Intent intent = new Intent("com.example.ACTION"); // implicit
PendingIntent pi = PendingIntent.getActivity(ctx, 0, intent, 0); // mutable (pre-API 31)Impact: Attacker's app can intercept the implicit intent and modify it, performing actions under the victim app's identity.
Detection: Search for PendingIntent.get(Activity|Service|Broadcast) where the base intent is implicit (no setComponent() / setClass()) and flags don't include FLAG_IMMUTABLE.
WebView Security
JavaScript Bridge (addJavascriptInterface)
webView.addJavascriptInterface(new JsBridge(), "AndroidBridge");
public class JsBridge {
@JavascriptInterface
public String getToken() { return authToken; }
@JavascriptInterface
public void executeCommand(String cmd) { Runtime.exec(cmd); }
}Assessment: List all @JavascriptInterface methods. If the WebView loads URLs from intent data or untrusted sources, every exposed method is callable by the attacker.
File Access
// DANGEROUS combinations:
webView.getSettings().setAllowFileAccessFromFileURLs(true);
webView.getSettings().setAllowUniversalAccessFromFileURLs(true);
webView.getSettings().setJavaScriptEnabled(true);With file access + JS enabled, an attacker who controls the loaded URL can read local files:
// Attacker's page loaded via deep link:
var x = new XMLHttpRequest();
x.open("GET", "file:///data/data/com.target/shared_prefs/auth.xml");
x.onload = function() { exfiltrate(x.responseText); };
x.send();SSL Error Handling
// VULNERABLE: accepts all certificates
webView.setWebViewClient(new WebViewClient() {
@Override
public void onReceivedSslError(WebViewHandler handler, SslError error) {
handler.proceed(); // NEVER do this
}
});Network Security Config
Located at res/xml/network_security_config.xml:
<!-- WORST: global cleartext -->
<network-security-config>
<base-config cleartextTrafficPermitted="true" />
</network-security-config>
<!-- BAD: user CAs trusted in production -->
<network-security-config>
<base-config>
<trust-anchors>
<certificates src="system" />
<certificates src="user" /> <!-- allows MITM with user CA -->
</trust-anchors>
</base-config>
</network-security-config>Assessment: Cleartext config alone is informational. User CA trust in production is MEDIUM (enables MITM). Both become findings when chained with evidence of sensitive data transmission.
Data Storage
SharedPreferences
// DANGEROUS: world-readable (deprecated API 17, removed API 28+)
getSharedPreferences("prefs", MODE_WORLD_READABLE);
// COMMON: private, but stores sensitive data unencrypted
getSharedPreferences("auth", MODE_PRIVATE);
editor.putString("access_token", token);Detection: shared_prefs_analyzer.py scans for getSharedPreferences calls and flags MODE_WORLD_READABLE/MODE_WORLD_WRITEABLE. For MODE_PRIVATE, check what data is stored; tokens, passwords, PII in plaintext are findings when combined with allowBackup=true or other extraction paths.
SQLite / Room Databases
// VULNERABLE: raw query from user input
db.rawQuery("SELECT * FROM users WHERE id = " + userId, null);
// SAFE: parameterized
db.rawQuery("SELECT * FROM users WHERE id = ?", new String[]{userId});External Storage
// DANGEROUS: world-readable on older Android
File file = new File(Environment.getExternalStorageDirectory(), "data.json");
// DANGEROUS: media store doesn't protect files
context.getExternalFilesDir(null); // app-specific but readable pre-API 29Native Library Analysis
JNI Entry Points
Native functions exported via JNI follow the naming convention:
Java_com_example_app_ClassName_methodNameAnalysis approach:
- List JNI exports:
nm -gD <lib.so> | grep "Java_" - For each export, check the corresponding Java declaration (
nativekeyword) - In Ghidra/BN, analyze the native function for:
- Input validation of JNI parameters
- Use of
GetStringUTFCharswithout length checks - Calls to
system(),exec(),dlopen() - Hardcoded crypto keys or credentials
Unsafe Functions
Flag these in native code (potential buffer overflows):
strcpy,strcat,sprintf,gets,scanfmemcpywithout bounds checking
Anti-Tampering / Root Detection
Common libraries:
- SafetyNet / Play Integrity API
- Root detection (RootBeer, custom checks)
- Integrity checks (signature verification)
These are NOT findings. Missing root detection is informational only.
Tool Reference (Android-Specific)
| Tool | Purpose | Key Usage |
jadx | DEX → Java decompilation | jadx -d <output> <apk> |
apktool | Resource decoding, manifest | apktool d <apk> |
adb | Device interaction, component testing | adb shell am start/broadcast/startservice |
adb shell content | Content provider querying | content query --uri |
aapt2 | APK metadata extraction | aapt2 dump badging <apk> |
| Ghidra | Native .so reversing | Via ghidra_analyze.sh --platform android |
Source Code Review Priorities
When reviewing decompiled Java source, focus on:
- IPC handlers:
onCreate,onNewIntent,onReceive,onBind,query,insert,delete - URL/URI processing:
Uri.parse,getIntent().getData(),getQueryParameter - WebView setup:
loadUrl,addJavascriptInterface,WebSettingsconfiguration - Crypto operations:
Cipher.getInstance,MessageDigest,SecretKeySpec - Data storage:
getSharedPreferences,openOrCreateDatabase,ContentValues - Network calls:
OkHttpClient,HttpURLConnection,Retrofitconfiguration - File operations:
openFileOutput,getExternalFilesDir,FileProvider
Do NOT attempt to review all source; focus on security-relevant classes identified by dex_class_analyzer.py.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

