← 返回
未分类

android-lib-lookup

自动从本地缓存的 AAR/JAR 文件中查询 Android/Gradle 项目依赖类和 API。 特征 类查找——输入类名,获取其所属库、版本和完整的 API 签名 包浏览— 列出包下的所有类 库列表— 列出 Maven 依赖项中的所有公共类 模糊搜索——按关键字搜索类名 自动索引——首次查询时建立索引,并缓存以供后续使用。 Kotlin DSL 支持— 适用于build.gradle两者build.gradle.kts 零依赖——纯 Python 3.6+ 标准库,无需 pip 安装
user_d2af0937
未分类 community v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 135
下载
💾 5
安装
1
版本
#latest

概述

Android Dependency Class Lookup

Automatically indexes classes from Gradle-cached AAR/JAR dependencies and provides

instant API lookups. Zero external dependencies — pure Python standard library.

When to Use

  • Encountering unknown classes (especially from internal or third-party AAR dependencies)
  • Needing to know the exact API of a dependency library
  • Wanting to use a library's feature but unsure about method signatures
  • Confirming which dependency a class belongs to

Lookup Flow

Step 1: Get the Fully Qualified Class Name

Always check import statements first — the same simple class name may exist in multiple libraries:

  1. Look at import statements at the top of the file for the FQCN (e.g., com.example.StringUtils)
  2. Use FQCN for precise lookup
  3. Only use simple class name or fuzzy search when import is unavailable

Step 2: Identify the Module Path

The tool needs the Android module path (directory containing build.gradle or build.gradle.kts).

Step 3: Run the Query

Script location: scripts/lookup_class.py (relative to this skill directory)

Lookup by class name (most common):

python3 <SKILL_DIR>/scripts/lookup_class.py -p <MODULE_PATH> -c <class_name>

Examples:

# Precise lookup with FQCN (recommended)
python3 scripts/lookup_class.py -p /path/to/module -c com.example.StringUtils

# Simple name lookup (returns all matches)
python3 scripts/lookup_class.py -p /path/to/module -c StringUtils

# Show full source code instead of API summary
python3 scripts/lookup_class.py -p /path/to/module -c StringUtils --source

Other queries:

# List all classes in a package
python3 scripts/lookup_class.py -p <MODULE_PATH> --package com.example.util

# List all classes in a library
python3 scripts/lookup_class.py -p <MODULE_PATH> --library com.example:utils

# Fuzzy search
python3 scripts/lookup_class.py -p <MODULE_PATH> --search Toast

# Index statistics
python3 scripts/lookup_class.py -p <MODULE_PATH> --stats

Step 4: Use the Results

Results are JSON with: class (FQCN), library (Maven coordinate), version, and api_summary (public method signatures with Javadoc when sources.jar is available).

Key Features

  • Auto-indexing: First query builds the index automatically (~0.5s), subsequent queries use cache (~0.1s)
  • Auto-invalidation: Rebuilds when build.gradle changes
  • Dual extraction: Prefers sources.jar for source-level API (with Javadoc), falls back to javap
  • Gradle DSL support: Both Groovy (build.gradle) and Kotlin DSL (build.gradle.kts)
  • Dependency configs: implementation, api, compileOnly, runtimeOnly, kapt, ksp, annotationProcessor, etc.

Coding Guidelines

When writing code based on lookup results:

  • Prefer internal utility classes over reinventing the wheel
  • When a class exists in multiple libraries, use the one already imported in the current file
  • Match method signatures and parameter types exactly as shown in the API summary

版本历史

共 1 个版本

  • v1.0.0 Initial release 当前
    2026-04-10 19:28 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 670 📥 324,316
ai-intelligence

ontology

oswalpalash
类型化知识图谱,用于结构化智能体记忆与可组合技能。支持创建/查询实体(人员、项目、任务、事件、文档)及关联...
★ 714 📥 243,984
ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,362 📥 318,703