AI Agent Hub
Back to skills
Android Dependency Class Lookup icon

Android Dependency Class Lookup

Development Updated 2026.08.29

Paste the following prompt into your AI chat to install this skill:

Follow https://skillhub.cn/install/skillhub.md to install @user_d2af0937/android-lib-lookup.

About this skill

Problem

When working in an Android project, an unfamiliar class name is rarely enough to identify the right API. The same StringUtils may come from an internal AAR, a third-party library, or a base utility package, and its method signatures can change across versions. android-lib-lookup is built for this case: it extracts class information from Gradle-cached AAR and JAR dependencies, helping engineers confirm which Maven coordinate and version a class belongs to, and which public APIs it exposes.

How It Works

The skill uses only the Python standard library and does not require additional installation. A typical lookup has three steps:
- Start from import statements: prefer the fully qualified class name, such as com.example.StringUtils, to avoid ambiguity caused by simple class names.
- Locate the Android module path: the tool needs a directory containing build.gradle or build.gradle.kts so it can resolve dependency configurations.
- Run the class query: the script is scripts/lookup_class.py, and the result is JSON with class, library, version, and api_summary; when sources.jar is available, API summaries can include Javadoc.

Key capabilities include:
- Automatic indexing: the first query builds the index in about 0.5s, while later queries use the cache in about 0.1s.
- Automatic invalidation: the index is rebuilt when build.gradle changes, reducing stale cache risk.
- Dual extraction: it prefers sources.jar for source-level APIs and falls back to javap for bytecode parsing.
- Gradle DSL support: it works with Groovy and Kotlin DSL, and covers common dependency configurations such as implementation, api, compileOnly, and runtimeOnly.

Scope and Caveats

It is useful for confirming dependency ownership, inspecting method signatures, and reusing existing utility classes first, but it does not replace full documentation or architecture decisions. If the current file already imports a class with the same simple name, prefer that source. When writing code, match parameter types exactly as shown in the api_summary.

Use Cases

  • When a failing class name appears, read import statements to get the FQCN, then confirm which AAR or JAR provides it.
  • Query a utility class in a module directory to get its version and public method signatures before calling the AAR API.
  • When several dependencies expose the same class, compare the imported FQCN with lookup results and select the library already used.
  • Inspect build.gradle or .kts configurations to locate method ownership and version across implementation or api dependencies.

Best For

  • Android client engineers who need to confirm the library coordinate, version, and public APIs of unfamiliar classes in legacy modules.
  • Kotlin and Groovy project maintainers who need to distinguish same-name classes and avoid calling the wrong dependency's method signatures.
  • Dependency governance engineers who need to verify AAR/JAR ownership across implementation, api, and compileOnly configurations.
  • Internal AAR consumers who need to inspect method signatures from sources.jar or javap summaries when full docs are missing.