Skip to main content

Resolve Android app labels to launch activities via adb and aapt

Project description

Activity Finder

中文文档

Resolve Android app display names (labels) to their launch activities via adb and aapt.

Installation

pip install activity-finder

Or install from source:

git clone https://github.com/jaxonister/activity_finder.git
cd activity_finder
pip install -e .

Prerequisites

  • Python >= 3.10
  • Android SDK Platform Tools (adb on PATH)
  • Android SDK Build Tools (aapt). Set AAPT_PATH env var, or ensure it's discoverable via ANDROID_HOME.

Usage

CLI

# Search by label
activity-finder "Keep"

# With custom aapt path
activity-finder --aapt /path/to/aapt "WeChat"

# Disable cache
activity-finder --no-cache "Keep"

# Verbose output
activity-finder -v "Keep"

Python API

from activity_finder import AppInfoFinder, AppCache

cache = AppCache(db_path="apps.db")
finder = AppInfoFinder(cache=cache)

# Fuzzy match: "云盘" matches "中国移动云盘", "百度网盘", etc.
results = finder.resolve_label_to_package("云盘")
for r in results:
    print(f"{r['label']}  {r['package']}  {r['activity']}")

cache.close()

How It Works

  1. Lists all installed packages via adb shell pm list packages
  2. Pulls each APK and reads labels via aapt dump badging
  3. Matches labels against the keyword (substring/fuzzy match)
  4. Returns all matching apps with label, package name, and launch activity
  5. Caches results in SQLite to speed up subsequent searches

License

MIT

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

activity_finder-0.1.2.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

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

activity_finder-0.1.2-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file activity_finder-0.1.2.tar.gz.

File metadata

  • Download URL: activity_finder-0.1.2.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for activity_finder-0.1.2.tar.gz
Algorithm Hash digest
SHA256 2e9624e10f2cfed2f7cb7ed26f49cc11b0e46774074feb12546cdae69c78aabb
MD5 d8f18eee9b48443ce26e5316f891c954
BLAKE2b-256 3eabe53887f1ba007990580d64ea8ea49b5111405c1926f477031459f76805b3

See more details on using hashes here.

File details

Details for the file activity_finder-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for activity_finder-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cadbb704f88e17dfe0917474891cd438927ff8d3fe8e7893ae8fad8e9cea7ba2
MD5 bfa95d6d26cdf7dadc540053892595da
BLAKE2b-256 8488131190b8bd66ad67fc1706272af0dc72c3f12a4a5d5320a4cd5e3953d356

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