[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M758BWTTB9YT7FRB3PDSAK97":3,"skill-same:01M758BWTTB9YT7FRB3PDSAK97":72},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":36,"commitSha":37,"skillDirectory":5,"forksCount":14,"repositoryHtmlUrl":38,"repositoryHomepageUrl":6,"ownerHtmlUrl":39,"ownerBlogUrl":40,"ownerDescription":6,"updatedAt":41,"install":42,"resources":55},"01M758BWTTB9YT7FRB3PDSAK97","reverse-engineering-android-malware-with-jadx",null,"Reverse engineers malicious Android APK files using JADX decompiler to analyze Java\u002FKotlin source code, identify malicious functionality including data theft, C2 communication, privilege escalation, and overlay attacks. Examines manifest permissions, receivers, services, and native libraries. Activates for requests involving Android malware analysis, APK reverse engineering, mobile malware investigation, or Android threat analysis.","SamuelChien\u002Fmega-skills-collection","SamuelChien","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F4652114?v=4","01M74KK34WVHA0P5ZYSJRDDFMG","Samuel Chien","01M74KK35FQN1N9VZ9EPTH3P2S",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Freverse-engineering-android-malware-with-jadx\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Freverse-engineering-android-malware-with-jadx\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: reverse-engineering-android-malware-with-jadx\ndescription: >\n  Reverse engineers malicious Android APK files using JADX decompiler to analyze Java\u002FKotlin\n  source code, identify malicious functionality including data theft, C2 communication,\n  privilege escalation, and overlay attacks. Examines manifest permissions, receivers,\n  services, and native libraries. Activates for requests involving Android malware analysis,\n  APK reverse engineering, mobile malware investigation, or Android threat analysis.\ndomain: cybersecurity\nsubdomain: malware-analysis\ntags: [malware, Android, reverse-engineering, JADX, mobile-malware]\nversion: 1.0.0\nauthor: mahipal\nlicense: Apache-2.0\n---\n\n# Reverse Engineering Android Malware with JADX\n\n## When to Use\n\n- A suspicious Android APK has been reported as malicious or flagged by mobile threat detection\n- Analyzing Android banking trojans, spyware, SMS stealers, or adware samples\n- Determining what data an app collects, where it sends it, and what permissions it abuses\n- Extracting C2 server addresses, encryption keys, and configuration data from Android malware\n- Understanding overlay attack mechanisms used by banking trojans\n\n**Do not use** for analyzing obfuscated native (.so) libraries within APKs; use Ghidra or IDA for native ARM binary analysis.\n\n## Prerequisites\n\n- JADX 1.5+ installed (download from https:\u002F\u002Fgithub.com\u002Fskylot\u002Fjadx\u002Freleases)\n- Android SDK with `aapt2` and `adb` tools for APK inspection\n- apktool for full APK disassembly including smali code and resources\n- Python 3.8+ with `androguard` library for automated APK analysis\n- Frida for dynamic instrumentation (optional, for runtime analysis)\n- Isolated Android emulator (Genymotion or Android Studio AVD) without Google services\n\n## Workflow\n\n### Step 1: Extract APK Metadata and Permissions\n\nExamine the APK structure and AndroidManifest.xml:\n\n```bash\n# Get APK basic info\naapt2 dump badging malware.apk\n\n# Extract AndroidManifest.xml\napktool d malware.apk -o apk_extracted\u002F -f\n\n# Analyze permissions with androguard\npython3 \u003C\u003C 'PYEOF'\nfrom androguard.core.apk import APK\n\napk = APK(\"malware.apk\")\n\nprint(f\"Package:    {apk.get_package()}\")\nprint(f\"App Name:   {apk.get_app_name()}\")\nprint(f\"Version:    {apk.get_androidversion_name()}\")\nprint(f\"Min SDK:    {apk.get_min_sdk_version()}\")\nprint(f\"Target SDK: {apk.get_target_sdk_version()}\")\n\n# Dangerous permissions\ndangerous_perms = {\n    \"android.permission.READ_SMS\": \"SMS theft\",\n    \"android.permission.RECEIVE_SMS\": \"SMS interception\",\n    \"android.permission.SEND_SMS\": \"Premium SMS fraud\",\n    \"android.permission.READ_CONTACTS\": \"Contact harvesting\",\n    \"android.permission.READ_CALL_LOG\": \"Call log theft\",\n    \"android.permission.RECORD_AUDIO\": \"Audio surveillance\",\n    \"android.permission.CAMERA\": \"Camera surveillance\",\n    \"android.permission.ACCESS_FINE_LOCATION\": \"Location tracking\",\n    \"android.permission.READ_PHONE_STATE\": \"Device fingerprinting\",\n    \"android.permission.SYSTEM_ALERT_WINDOW\": \"Overlay attacks\",\n    \"android.permission.BIND_ACCESSIBILITY_SERVICE\": \"Full device control\",\n    \"android.permission.REQUEST_INSTALL_PACKAGES\": \"Sideloading apps\",\n    \"android.permission.BIND_DEVICE_ADMIN\": \"Device admin abuse\",\n}\n\nprint(\"\\nDangerous Permissions:\")\nfor perm in apk.get_permissions():\n    if perm in dangerous_perms:\n        print(f\"  [!] {perm}\")\n        print(f\"      Risk: {dangerous_perms[perm]}\")\n    elif \"android.permission\" in perm:\n        print(f\"  [*] {perm}\")\n\n# Components\nprint(\"\\nActivities:\")\nfor act in apk.get_activities():\n    print(f\"  {act}\")\n\nprint(\"\\nServices:\")\nfor svc in apk.get_services():\n    print(f\"  {svc}\")\n\nprint(\"\\nReceivers:\")\nfor rcv in apk.get_receivers():\n    print(f\"  {rcv}\")\nPYEOF\n```\n\n### Step 2: Decompile with JADX\n\nOpen the APK in JADX for Java\u002FKotlin source analysis:\n\n```bash\n# Open in JADX GUI\njadx-gui malware.apk\n\n# Command-line decompilation for scripted analysis\njadx -d jadx_output\u002F malware.apk --show-bad-code\n\n# Decompile with all options\njadx -d jadx_output\u002F malware.apk \\\n  --deobf \\\n  --deobf-min 3 \\\n  --deobf-max 64 \\\n  --show-bad-code \\\n  --threads-count 4\n\n# The output directory structure:\n# jadx_output\u002F\n#   sources\u002F           \u003C- Decompiled Java source code\n#     com\u002Fmalware\u002Fapp\u002F\n#       MainActivity.java\n#       C2Service.java\n#       SMSReceiver.java\n#   resources\u002F         \u003C- Decoded resources (layouts, strings, assets)\n#     AndroidManifest.xml\n#     res\u002F\n#     assets\u002F\n```\n\n### Step 3: Identify Malicious Functionality\n\nSearch for suspicious code patterns in decompiled sources:\n\n```bash\n# Search for network communication\ngrep -rn \"HttpURLConnection\\|OkHttpClient\\|Retrofit\\|Volley\\|URL(\" jadx_output\u002Fsources\u002F\n\n# Search for SMS operations\ngrep -rn \"SmsManager\\|getDefault().sendTextMessage\\|SMS_RECEIVED\" jadx_output\u002Fsources\u002F\n\n# Search for overlay attack code\ngrep -rn \"SYSTEM_ALERT_WINDOW\\|TYPE_APPLICATION_OVERLAY\\|WindowManager.LayoutParams\" jadx_output\u002Fsources\u002F\n\n# Search for accessibility service abuse\ngrep -rn \"AccessibilityService\\|onAccessibilityEvent\\|performAction\" jadx_output\u002Fsources\u002F\n\n# Search for data exfiltration\ngrep -rn \"getDeviceId\\|getSubscriberId\\|getSimSerialNumber\\|getLine1Number\" jadx_output\u002Fsources\u002F\n\n# Search for crypto operations (key storage, encryption)\ngrep -rn \"SecretKeySpec\\|Cipher.getInstance\\|AES\\|DES\\|RSA\" jadx_output\u002Fsources\u002F\n\n# Search for dynamic code loading\ngrep -rn \"DexClassLoader\\|PathClassLoader\\|loadDex\\|loadClass\" jadx_output\u002Fsources\u002F\n\n# Search for obfuscated strings and decryption\ngrep -rn \"Base64.decode\\|decrypt\\|decipher\\|xor\" jadx_output\u002Fsources\u002F\n```\n\n### Step 4: Analyze C2 Communication\n\nTrace the network communication logic:\n\n```python\n# Automated C2 extraction from decompiled code\nimport os\nimport re\n\njadx_dir = \"jadx_output\u002Fsources\"\n\n# Patterns for C2 URLs and IPs\nurl_pattern = re.compile(r'https?:\u002F\u002F[^\\s\"\\'\u003C>]+')\nip_pattern = re.compile(r'\"(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})\"')\nbase64_pattern = re.compile(r'\"([A-Za-z0-9+\u002F]{20,}={0,2})\"')\n\nurls = set()\nips = set()\nb64_strings = set()\n\nfor root, dirs, files in os.walk(jadx_dir):\n    for fname in files:\n        if fname.endswith('.java'):\n            filepath = os.path.join(root, fname)\n            with open(filepath, 'r', errors='ignore') as f:\n                content = f.read()\n\n            for match in url_pattern.finditer(content):\n                urls.add(match.group())\n            for match in ip_pattern.finditer(content):\n                ips.add(match.group(1))\n            for match in base64_pattern.finditer(content):\n                b64_strings.add(match.group(1))\n\nprint(\"URLs found:\")\nfor u in urls:\n    print(f\"  {u}\")\n\nprint(\"\\nIP addresses:\")\nfor ip in ips:\n    print(f\"  {ip}\")\n\n# Decode Base64 strings\nimport base64\nprint(\"\\nDecoded Base64 strings:\")\nfor b64 in b64_strings:\n    try:\n        decoded = base64.b64decode(b64).decode('utf-8', errors='ignore')\n        if any(c.isprintable() for c in decoded) and len(decoded) > 3:\n            print(f\"  {b64[:30]}... -> {decoded[:100]}\")\n    except:\n        pass\n```\n\n### Step 5: Examine Native Libraries\n\nCheck for native code that may contain additional malicious logic:\n\n```bash\n# List native libraries in the APK\nunzip -l malware.apk | grep \"\\.so$\"\n\n# Extract native libraries\nunzip malware.apk \"lib\u002F*\" -d apk_native\u002F\n\n# Check native library properties\nfile apk_native\u002Flib\u002Farmeabi-v7a\u002F*.so\nreadelf -d apk_native\u002Flib\u002Farmeabi-v7a\u002F*.so | grep NEEDED\n\n# Strings from native libraries\nstrings apk_native\u002Flib\u002Farmeabi-v7a\u002Flibpayload.so | grep -iE \"(http|url|key|encrypt|password)\"\n\n# For deep native analysis, import into Ghidra:\n# File -> Import -> Select .so file -> Select ARM architecture\n```\n\n### Step 6: Document Analysis and Extract IOCs\n\nCompile a comprehensive Android malware analysis report:\n\n```\nAnalysis documentation should include:\n- APK metadata (package name, version, signing certificate)\n- Permission analysis with risk assessment\n- Component analysis (activities, services, receivers, providers)\n- Decompiled code walkthrough of malicious functions\n- C2 communication protocol and endpoints\n- Data exfiltration methods and targeted data types\n- Persistence mechanisms (device admin, accessibility service)\n- Evasion techniques (emulator detection, root detection)\n- Extracted IOCs (C2 URLs, domains, IPs, signing certificate hash)\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **APK (Android Package)** | Android application package format containing compiled DEX bytecode, resources, manifest, and native libraries |\n| **DEX Bytecode** | Dalvik Executable format containing compiled Java\u002FKotlin code; JADX converts this back to readable Java source |\n| **Overlay Attack** | Banking trojan technique displaying a fake UI layer over a legitimate banking app to steal credentials using SYSTEM_ALERT_WINDOW permission |\n| **Accessibility Service Abuse** | Malware registering as an accessibility service to capture screen content, perform actions, and prevent uninstallation |\n| **Smali** | Human-readable representation of DEX bytecode; intermediate representation between bytecode and Java used by apktool |\n| **Dynamic Code Loading** | Loading additional DEX code at runtime using DexClassLoader to hide malicious functionality from static analysis |\n| **Device Admin Abuse** | Malware requesting device administrator privileges to prevent uninstallation and perform device wipe threats |\n\n## Tools & Systems\n\n- **JADX**: Open-source DEX to Java decompiler providing GUI and CLI for Android APK analysis with deobfuscation support\n- **apktool**: Tool for reverse engineering Android APK files to smali code and decoded resources\n- **androguard**: Python framework for automated Android APK analysis including permission, component, and code analysis\n- **Frida**: Dynamic instrumentation toolkit for hooking Java methods and native functions at runtime on Android\n- **MobSF (Mobile Security Framework)**: Automated mobile application security testing framework for static and dynamic analysis\n\n## Common Scenarios\n\n### Scenario: Analyzing an Android Banking Trojan\n\n**Context**: A banking trojan APK is distributed via SMS phishing targeting customers of a specific bank. The sample needs analysis to identify targeted banks, C2 infrastructure, and data theft mechanisms.\n\n**Approach**:\n1. Extract APK metadata and identify requested permissions (SMS, accessibility, overlay, device admin)\n2. Decompile with JADX and search for overlay activity classes that mimic banking app UIs\n3. Identify the list of targeted banking apps by searching for package name lists in the code\n4. Trace the SMS interception receiver to understand how 2FA codes are stolen\n5. Follow the C2 communication code to extract server URLs and command protocol\n6. Check for web injection configuration files in assets\u002F directory\n7. Extract all IOCs and document the complete attack chain\n\n**Pitfalls**:\n- Not deobfuscating class and method names before analysis (use JADX --deobf flag)\n- Missing dynamically loaded DEX files downloaded after installation\n- Ignoring native .so libraries that may contain the actual C2 logic or encryption routines\n- Overlooking assets\u002F directory which may contain encrypted configuration or web injects\n\n## Output Format\n\n```\nANDROID MALWARE ANALYSIS REPORT\n==================================\nAPK File:         update_bank.apk\nPackage:          com.android.systemupdate\nSHA-256:          e3b0c44298fc1c149afbf4c8996fb924...\nVersion:          1.2.3\nMin SDK:          21 (Android 5.0)\nSigning Cert:     SHA-256: abc123... (self-signed)\n\nCLASSIFICATION\nFamily:           Anubis Banking Trojan\nType:             Banking Trojan \u002F SMS Stealer \u002F Keylogger\n\nDANGEROUS PERMISSIONS\n[!] RECEIVE_SMS          - Intercepts incoming SMS (2FA theft)\n[!] READ_SMS             - Reads SMS messages\n[!] SEND_SMS             - Sends premium SMS\n[!] SYSTEM_ALERT_WINDOW  - Overlay attacks on banking apps\n[!] BIND_ACCESSIBILITY   - Full device control\n[!] BIND_DEVICE_ADMIN    - Prevents uninstallation\n\nMALICIOUS COMPONENTS\nService:    com.android.systemupdate.C2Service (C2 communication)\nReceiver:   com.android.systemupdate.SmsReceiver (SMS interception)\nActivity:   com.android.systemupdate.OverlayActivity (credential overlay)\n\nTARGETED APPS (23 banking apps)\ncom.bank.example1, com.bank.example2, ...\n\nC2 INFRASTRUCTURE\nPrimary:    hxxps:\u002F\u002Fc2-server[.]com\u002Fapi\u002Fbot\nFallback:   hxxps:\u002F\u002Fbackup-c2[.]net\u002Fapi\u002Fbot\nProtocol:   HTTPS POST with JSON body\nBot ID:     MD5(IMEI + Build.SERIAL)\n\nEXTRACTED IOCs\nDomains:    c2-server[.]com, backup-c2[.]net\nIPs:        185.220.101[.]42\nURLs:       hxxps:\u002F\u002Fc2-server[.]com\u002Fapi\u002Fbot\n            hxxps:\u002F\u002Fc2-server[.]com\u002Fapi\u002Finjects\nCert Hash:  abc123def456...\n```\n","# Reverse Engineering Android Malware with JADX\n\n## When to Use\n\n- A suspicious Android APK has been reported as malicious or flagged by mobile threat detection\n- Analyzing Android banking trojans, spyware, SMS stealers, or adware samples\n- Determining what data an app collects, where it sends it, and what permissions it abuses\n- Extracting C2 server addresses, encryption keys, and configuration data from Android malware\n- Understanding overlay attack mechanisms used by banking trojans\n\n**Do not use** for analyzing obfuscated native (.so) libraries within APKs; use Ghidra or IDA for native ARM binary analysis.\n\n## Prerequisites\n\n- JADX 1.5+ installed (download from https:\u002F\u002Fgithub.com\u002Fskylot\u002Fjadx\u002Freleases)\n- Android SDK with `aapt2` and `adb` tools for APK inspection\n- apktool for full APK disassembly including smali code and resources\n- Python 3.8+ with `androguard` library for automated APK analysis\n- Frida for dynamic instrumentation (optional, for runtime analysis)\n- Isolated Android emulator (Genymotion or Android Studio AVD) without Google services\n\n## Workflow\n\n### Step 1: Extract APK Metadata and Permissions\n\nExamine the APK structure and AndroidManifest.xml:\n\n```bash\n# Get APK basic info\naapt2 dump badging malware.apk\n\n# Extract AndroidManifest.xml\napktool d malware.apk -o apk_extracted\u002F -f\n\n# Analyze permissions with androguard\npython3 \u003C\u003C 'PYEOF'\nfrom androguard.core.apk import APK\n\napk = APK(\"malware.apk\")\n\nprint(f\"Package:    {apk.get_package()}\")\nprint(f\"App Name:   {apk.get_app_name()}\")\nprint(f\"Version:    {apk.get_androidversion_name()}\")\nprint(f\"Min SDK:    {apk.get_min_sdk_version()}\")\nprint(f\"Target SDK: {apk.get_target_sdk_version()}\")\n\n# Dangerous permissions\ndangerous_perms = {\n    \"android.permission.READ_SMS\": \"SMS theft\",\n    \"android.permission.RECEIVE_SMS\": \"SMS interception\",\n    \"android.permission.SEND_SMS\": \"Premium SMS fraud\",\n    \"android.permission.READ_CONTACTS\": \"Contact harvesting\",\n    \"android.permission.READ_CALL_LOG\": \"Call log theft\",\n    \"android.permission.RECORD_AUDIO\": \"Audio surveillance\",\n    \"android.permission.CAMERA\": \"Camera surveillance\",\n    \"android.permission.ACCESS_FINE_LOCATION\": \"Location tracking\",\n    \"android.permission.READ_PHONE_STATE\": \"Device fingerprinting\",\n    \"android.permission.SYSTEM_ALERT_WINDOW\": \"Overlay attacks\",\n    \"android.permission.BIND_ACCESSIBILITY_SERVICE\": \"Full device control\",\n    \"android.permission.REQUEST_INSTALL_PACKAGES\": \"Sideloading apps\",\n    \"android.permission.BIND_DEVICE_ADMIN\": \"Device admin abuse\",\n}\n\nprint(\"\\nDangerous Permissions:\")\nfor perm in apk.get_permissions():\n    if perm in dangerous_perms:\n        print(f\"  [!] {perm}\")\n        print(f\"      Risk: {dangerous_perms[perm]}\")\n    elif \"android.permission\" in perm:\n        print(f\"  [*] {perm}\")\n\n# Components\nprint(\"\\nActivities:\")\nfor act in apk.get_activities():\n    print(f\"  {act}\")\n\nprint(\"\\nServices:\")\nfor svc in apk.get_services():\n    print(f\"  {svc}\")\n\nprint(\"\\nReceivers:\")\nfor rcv in apk.get_receivers():\n    print(f\"  {rcv}\")\nPYEOF\n```\n\n### Step 2: Decompile with JADX\n\nOpen the APK in JADX for Java\u002FKotlin source analysis:\n\n```bash\n# Open in JADX GUI\njadx-gui malware.apk\n\n# Command-line decompilation for scripted analysis\njadx -d jadx_output\u002F malware.apk --show-bad-code\n\n# Decompile with all options\njadx -d jadx_output\u002F malware.apk \\\n  --deobf \\\n  --deobf-min 3 \\\n  --deobf-max 64 \\\n  --show-bad-code \\\n  --threads-count 4\n\n# The output directory structure:\n# jadx_output\u002F\n#   sources\u002F           \u003C- Decompiled Java source code\n#     com\u002Fmalware\u002Fapp\u002F\n#       MainActivity.java\n#       C2Service.java\n#       SMSReceiver.java\n#   resources\u002F         \u003C- Decoded resources (layouts, strings, assets)\n#     AndroidManifest.xml\n#     res\u002F\n#     assets\u002F\n```\n\n### Step 3: Identify Malicious Functionality\n\nSearch for suspicious code patterns in decompiled sources:\n\n```bash\n# Search for network communication\ngrep -rn \"HttpURLConnection\\|OkHttpClient\\|Retrofit\\|Volley\\|URL(\" jadx_output\u002Fsources\u002F\n\n# Search for SMS operations\ngrep -rn \"SmsManager\\|getDefault().sendTextMessage\\|SMS_RECEIVED\" jadx_output\u002Fsources\u002F\n\n# Search for overlay attack code\ngrep -rn \"SYSTEM_ALERT_WINDOW\\|TYPE_APPLICATION_OVERLAY\\|WindowManager.LayoutParams\" jadx_output\u002Fsources\u002F\n\n# Search for accessibility service abuse\ngrep -rn \"AccessibilityService\\|onAccessibilityEvent\\|performAction\" jadx_output\u002Fsources\u002F\n\n# Search for data exfiltration\ngrep -rn \"getDeviceId\\|getSubscriberId\\|getSimSerialNumber\\|getLine1Number\" jadx_output\u002Fsources\u002F\n\n# Search for crypto operations (key storage, encryption)\ngrep -rn \"SecretKeySpec\\|Cipher.getInstance\\|AES\\|DES\\|RSA\" jadx_output\u002Fsources\u002F\n\n# Search for dynamic code loading\ngrep -rn \"DexClassLoader\\|PathClassLoader\\|loadDex\\|loadClass\" jadx_output\u002Fsources\u002F\n\n# Search for obfuscated strings and decryption\ngrep -rn \"Base64.decode\\|decrypt\\|decipher\\|xor\" jadx_output\u002Fsources\u002F\n```\n\n### Step 4: Analyze C2 Communication\n\nTrace the network communication logic:\n\n```python\n# Automated C2 extraction from decompiled code\nimport os\nimport re\n\njadx_dir = \"jadx_output\u002Fsources\"\n\n# Patterns for C2 URLs and IPs\nurl_pattern = re.compile(r'https?:\u002F\u002F[^\\s\"\\'\u003C>]+')\nip_pattern = re.compile(r'\"(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})\"')\nbase64_pattern = re.compile(r'\"([A-Za-z0-9+\u002F]{20,}={0,2})\"')\n\nurls = set()\nips = set()\nb64_strings = set()\n\nfor root, dirs, files in os.walk(jadx_dir):\n    for fname in files:\n        if fname.endswith('.java'):\n            filepath = os.path.join(root, fname)\n            with open(filepath, 'r', errors='ignore') as f:\n                content = f.read()\n\n            for match in url_pattern.finditer(content):\n                urls.add(match.group())\n            for match in ip_pattern.finditer(content):\n                ips.add(match.group(1))\n            for match in base64_pattern.finditer(content):\n                b64_strings.add(match.group(1))\n\nprint(\"URLs found:\")\nfor u in urls:\n    print(f\"  {u}\")\n\nprint(\"\\nIP addresses:\")\nfor ip in ips:\n    print(f\"  {ip}\")\n\n# Decode Base64 strings\nimport base64\nprint(\"\\nDecoded Base64 strings:\")\nfor b64 in b64_strings:\n    try:\n        decoded = base64.b64decode(b64).decode('utf-8', errors='ignore')\n        if any(c.isprintable() for c in decoded) and len(decoded) > 3:\n            print(f\"  {b64[:30]}... -> {decoded[:100]}\")\n    except:\n        pass\n```\n\n### Step 5: Examine Native Libraries\n\nCheck for native code that may contain additional malicious logic:\n\n```bash\n# List native libraries in the APK\nunzip -l malware.apk | grep \"\\.so$\"\n\n# Extract native libraries\nunzip malware.apk \"lib\u002F*\" -d apk_native\u002F\n\n# Check native library properties\nfile apk_native\u002Flib\u002Farmeabi-v7a\u002F*.so\nreadelf -d apk_native\u002Flib\u002Farmeabi-v7a\u002F*.so | grep NEEDED\n\n# Strings from native libraries\nstrings apk_native\u002Flib\u002Farmeabi-v7a\u002Flibpayload.so | grep -iE \"(http|url|key|encrypt|password)\"\n\n# For deep native analysis, import into Ghidra:\n# File -> Import -> Select .so file -> Select ARM architecture\n```\n\n### Step 6: Document Analysis and Extract IOCs\n\nCompile a comprehensive Android malware analysis report:\n\n```\nAnalysis documentation should include:\n- APK metadata (package name, version, signing certificate)\n- Permission analysis with risk assessment\n- Component analysis (activities, services, receivers, providers)\n- Decompiled code walkthrough of malicious functions\n- C2 communication protocol and endpoints\n- Data exfiltration methods and targeted data types\n- Persistence mechanisms (device admin, accessibility service)\n- Evasion techniques (emulator detection, root detection)\n- Extracted IOCs (C2 URLs, domains, IPs, signing certificate hash)\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **APK (Android Package)** | Android application package format containing compiled DEX bytecode, resources, manifest, and native libraries |\n| **DEX Bytecode** | Dalvik Executable format containing compiled Java\u002FKotlin code; JADX converts this back to readable Java source |\n| **Overlay Attack** | Banking trojan technique displaying a fake UI layer over a legitimate banking app to steal credentials using SYSTEM_ALERT_WINDOW permission |\n| **Accessibility Service Abuse** | Malware registering as an accessibility service to capture screen content, perform actions, and prevent uninstallation |\n| **Smali** | Human-readable representation of DEX bytecode; intermediate representation between bytecode and Java used by apktool |\n| **Dynamic Code Loading** | Loading additional DEX code at runtime using DexClassLoader to hide malicious functionality from static analysis |\n| **Device Admin Abuse** | Malware requesting device administrator privileges to prevent uninstallation and perform device wipe threats |\n\n## Tools & Systems\n\n- **JADX**: Open-source DEX to Java decompiler providing GUI and CLI for Android APK analysis with deobfuscation support\n- **apktool**: Tool for reverse engineering Android APK files to smali code and decoded resources\n- **androguard**: Python framework for automated Android APK analysis including permission, component, and code analysis\n- **Frida**: Dynamic instrumentation toolkit for hooking Java methods and native functions at runtime on Android\n- **MobSF (Mobile Security Framework)**: Automated mobile application security testing framework for static and dynamic analysis\n\n## Common Scenarios\n\n### Scenario: Analyzing an Android Banking Trojan\n\n**Context**: A banking trojan APK is distributed via SMS phishing targeting customers of a specific bank. The sample needs analysis to identify targeted banks, C2 infrastructure, and data theft mechanisms.\n\n**Approach**:\n1. Extract APK metadata and identify requested permissions (SMS, accessibility, overlay, device admin)\n2. Decompile with JADX and search for overlay activity classes that mimic banking app UIs\n3. Identify the list of targeted banking apps by searching for package name lists in the code\n4. Trace the SMS interception receiver to understand how 2FA codes are stolen\n5. Follow the C2 communication code to extract server URLs and command protocol\n6. Check for web injection configuration files in assets\u002F directory\n7. Extract all IOCs and document the complete attack chain\n\n**Pitfalls**:\n- Not deobfuscating class and method names before analysis (use JADX --deobf flag)\n- Missing dynamically loaded DEX files downloaded after installation\n- Ignoring native .so libraries that may contain the actual C2 logic or encryption routines\n- Overlooking assets\u002F directory which may contain encrypted configuration or web injects\n\n## Output Format\n\n```\nANDROID MALWARE ANALYSIS REPORT\n==================================\nAPK File:         update_bank.apk\nPackage:          com.android.systemupdate\nSHA-256:          e3b0c44298fc1c149afbf4c8996fb924...\nVersion:          1.2.3\nMin SDK:          21 (Android 5.0)\nSigning Cert:     SHA-256: abc123... (self-signed)\n\nCLASSIFICATION\nFamily:           Anubis Banking Trojan\nType:             Banking Trojan \u002F SMS Stealer \u002F Keylogger\n\nDANGEROUS PERMISSIONS\n[!] RECEIVE_SMS          - Intercepts incoming SMS (2FA theft)\n[!] READ_SMS             - Reads SMS messages\n[!] SEND_SMS             - Sends premium SMS\n[!] SYSTEM_ALERT_WINDOW  - Overlay attacks on banking apps\n[!] BIND_ACCESSIBILITY   - Full device control\n[!] BIND_DEVICE_ADMIN    - Prevents uninstallation\n\nMALICIOUS COMPONENTS\nService:    com.android.systemupdate.C2Service (C2 communication)\nReceiver:   com.android.systemupdate.SmsReceiver (SMS interception)\nActivity:   com.android.systemupdate.OverlayActivity (credential overlay)\n\nTARGETED APPS (23 banking apps)\ncom.bank.example1, com.bank.example2, ...\n\nC2 INFRASTRUCTURE\nPrimary:    hxxps:\u002F\u002Fc2-server[.]com\u002Fapi\u002Fbot\nFallback:   hxxps:\u002F\u002Fbackup-c2[.]net\u002Fapi\u002Fbot\nProtocol:   HTTPS POST with JSON body\nBot ID:     MD5(IMEI + Build.SERIAL)\n\nEXTRACTED IOCs\nDomains:    c2-server[.]com, backup-c2[.]net\nIPs:        185.220.101[.]42\nURLs:       hxxps:\u002F\u002Fc2-server[.]com\u002Fapi\u002Fbot\n            hxxps:\u002F\u002Fc2-server[.]com\u002Fapi\u002Finjects\nCert Hash:  abc123def456...\n```\n",{"name":5,"tags":25,"author":31,"domain":32,"license":15,"version":33,"subdomain":34,"description":35},[26,27,28,29,30],"malware","Android","reverse-engineering","JADX","mobile-malware","mahipal","cybersecurity","1.0.0","malware-analysis","Reverse engineers malicious Android APK files using JADX decompiler to analyze Java\u002FKotlin source code, identify malicious functionality including data theft, C2 communication, privilege escalation, and overlay attacks. Examines manifest permissions, receivers, services, and native libraries. Activates for requests involving Android malware analysis, APK reverse engineering, mobile malware investigation, or Android threat analysis.\n","main","c2b1fdccc779e99ac814e55fb69ca8d71215dd0f","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection","https:\u002F\u002Fgithub.com\u002FSamuelChien","http:\u002F\u002Fsamuelchien.com\u002F","2026-05-26 08:27:14",{"source":8,"skillName":5,"commands":43,"prompt":53,"zipAvailable":54},[44,47,50],{"tool":45,"command":46},"npx","npx skills add SamuelChien\u002Fmega-skills-collection --skill reverse-engineering-android-malware-with-jadx",{"tool":48,"command":49},"bunx","bunx skills add SamuelChien\u002Fmega-skills-collection --skill reverse-engineering-android-malware-with-jadx",{"tool":51,"command":52},"pnpm","pnpm dlx skills add SamuelChien\u002Fmega-skills-collection --skill reverse-engineering-android-malware-with-jadx","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Freverse-engineering-android-malware-with-jadx\u002FSKILL.md",true,[56,60,66],{"path":57,"resourceType":57,"resourceTypeDesc":58,"sizeBytes":59,"sourceHtmlUrl":16},"LICENSE","许可证",11255,{"path":61,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":64,"sourceHtmlUrl":65},"references\u002Fapi-reference.md","REFERENCE","参考文档",2490,"https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Freverse-engineering-android-malware-with-jadx\u002Freferences\u002Fapi-reference.md",{"path":67,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":70,"sourceHtmlUrl":71},"scripts\u002Fagent.py","SCRIPT","脚本",7815,"https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Freverse-engineering-android-malware-with-jadx\u002Fscripts\u002Fagent.py",[73,81,88,95,102,109],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":77,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":20},"01M76R4WZQZAXGGXMQCA0FZ716","zustand-store-ts","Create Zustand stores with TypeScript, subscribeWithSelector middleware, and proper state\u002Faction separation. Use when building React state management, creating global stores, or implementing reactive state patterns with Zustand.","MIT","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzustand-store-ts\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":77,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":20},"01M76R4T9KENDH7FENGZQHBW4G","zustand-store-creator","Zustand Store Creator - Auto-activating skill for Frontend Development.\nTriggers on: zustand store creator, zustand store creator\nPart of the Frontend Development skill category.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzustand-store-creator\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":77,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":20},"01M76R3YWN84B7SANJ52X799ZE","zero-trust-config-helper","Zero Trust Config Helper - Auto-activating skill for Security Advanced.\nTriggers on: zero trust config helper, zero trust config helper\nPart of the Security Advanced skill category.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzero-trust-config-helper\u002FSKILL.md",[],[],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":77,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":20},"01M76R3HNSV2AEYSKHM915GJ58","zapier-integration-helper","Zapier Integration Helper - Auto-activating skill for Business Automation.\nTriggers on: zapier integration helper, zapier integration helper\nPart of the Business Automation skill category.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzapier-integration-helper\u002FSKILL.md",[],[],{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":20},"01M76R3DJSKAT4FA7DV4BF3GCE","zai-cli","Execute z.AI CLI providing vision, search, reader, and GitHub exploration via CLI and MCP.\nUse when user needs image\u002Fvideo analysis, OCR, UI-to-code conversion, error diagnosis,\nreal-time web search, web page to markdown extraction, or GitHub code exploration.\nTrigger with phrases like \"analyze this image\", \"search the web for\", \"read this page\",\n\"explore this repo\", or \"use zai\". Requires Z_AI_API_KEY.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzai-cli\u002FSKILL.md",[],[],{"skillNo":110,"name":111,"nameZh":6,"description":112,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":77,"licenseFileUrl":6,"sourceHtmlUrl":113,"categories":114,"keywords":115,"publishedAt":20},"01M76R2KAM699XE9AJVAWE4H2E","yt-research","Research competitor YouTube channels, niches, and trending topics for your content strategy.\nUse this skill whenever the user says \"research channels\", \"analyze competitors\", \"find trending topics\",\n\"niche analysis\", \"competitive research\", \"what are other creators doing\", \"scrape YouTube channels\",\nor wants to understand the competitive landscape for a specific tool or topic area. Use when working with yt research. Trigger with 'yt', 'research'.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fyt-research\u002FSKILL.md",[],[]]