Skip to main content

Static SDK detection for Android APK files — 5-layer analysis engine

Project description

APK SDK Analyzer

Static third-party SDK detection tool for Android APK files.

Features

  • Zero-dependency on decompilers — pure Python static analysis
  • 5-layer detection engine: DEX class names · AndroidManifest components · Native .so libs · META-INF version files · DEX BuildConfig static fields
  • Structured output: JSON + interactive single-file HTML report
  • Extensible signature database: YAML files in sdk_signatures/ — update without recompiling
  • Cross-platform exe: Windows / macOS / Linux via PyInstaller

Quick Start

# Install
pip install -r requirements.txt

# Run
python src/main.py target.apk

# Output
# target_report.json  — structured data
# target_report.html  — interactive report (open in browser)

Pre-built Binaries

Download from Releases:

Platform File
Windows x64 apk-analyzer-windows-x64.exe
macOS ARM64 apk-analyzer-macos-arm64
Linux x64 apk-analyzer-linux-x64
apk-analyzer.exe target.apk
apk-analyzer.exe target.apk --signatures-dir ./sdk_signatures
apk-analyzer.exe target.apk --categories push,ads --verbose

Detection Methods

Layer Method Coverage
L1 DEX class name prefix matching ~90% of SDKs
L2 AndroidManifest service/receiver/activity Confirms presence
L3 Native .so library names Native SDKs
L4 META-INF .version files AndroidX / Google libs
L5 DEX BuildConfig.VERSION_NAME static fields Exact versions

SDK Signature Format

# sdk_signatures/<category>/<id>.yaml
id: xiaomi_mipush
name: 小米推送 MiPush
category: push
vendor: Xiaomi
description: "小米厂商推送通道"

detection:
  package_prefixes:
    - "com.xiaomi.push"
  native_libs:
    - "libmipush.so"
  manifest_services:
    - "com.xiaomi.push.service.XMPushService"

version_extraction:
  buildconfig:
    class_pattern: "com.xiaomi.push.BuildConfig"
    field: "VERSION_NAME"

risk:
  permissions:
    - "android.permission.RECEIVE_BOOT_COMPLETED"
  data_collection:
    - "设备标识符"
  privacy_risk: low   # low / medium / high
  notes: "..."

Output JSON Structure

{
  "meta": { "tool_version": "1.0.0", "analysis_time": "...", ... },
  "apk_info": { "package_name": "com.example.app", "version_name": "1.2.3", ... },
  "detected_sdks": [
    {
      "id": "xiaomi_mipush",
      "name": "小米推送 MiPush",
      "version": "5.9.6",
      "confidence": "high",
      "detection_evidence": { "matched_packages": ["com.xiaomi.push"], ... },
      "risk": { "privacy_risk": "low", ... }
    }
  ],
  "summary": { "total_detected": 46, "by_category": { "push": 5, ... } }
}

Contributing Signatures

Add a YAML file to the appropriate sdk_signatures/<category>/ directory. See existing files for the format. No code changes required.

Build from Source

pip install pyinstaller
pyinstaller apk_analyzer.spec
# Output: dist/apk-analyzer(.exe)

License

MIT

Release Pipeline

Automated release pipeline via GitHub Actions:

PR merge (feature-* or fix-*)
   ↓ auto-tag.yml
Creates v1.y.z tag
   ↓ publish.yml  
Publishes to PyPI → pip install apk-analyzer

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

apk_analyzer-1.4.0.tar.gz (24.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

apk_analyzer-1.4.0-py3-none-any.whl (37.9 kB view details)

Uploaded Python 3

File details

Details for the file apk_analyzer-1.4.0.tar.gz.

File metadata

  • Download URL: apk_analyzer-1.4.0.tar.gz
  • Upload date:
  • Size: 24.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for apk_analyzer-1.4.0.tar.gz
Algorithm Hash digest
SHA256 9000ddb4a98a17ac5a27cd50a02a17afa463d116cddfb340ad74c38dec4da7fe
MD5 c868d6b8c241af7ed33eb9b71512278f
BLAKE2b-256 db609aa2fcec7402ec961e219b5e879b19e98a5b5a0a442add16e425fa21b3f7

See more details on using hashes here.

File details

Details for the file apk_analyzer-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: apk_analyzer-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 37.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for apk_analyzer-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d4132b482facb4a61537a23ea6f7477d5776b7e8092a2192260fd4c8133f0667
MD5 b84edc456b16d34e4670398297d61e80
BLAKE2b-256 c26d425aaef3670baa7100dd0ff8a27c7c1bdafe390d9da26d991c900077ad0b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page