Skip to content

Repository files navigation

Kỹ năng Dịch Ngược Android & Trích Xuất API — Codex plugin/skill

Lưu ý / Nguồn tham khảo: Dự án này được tham khảo và dựa trên mã nguồn gốc từ SimoneAvogadro/android-reverse-engineering-skill.

Một bản port tương thích với Codex của kỹ năng (skill) dịch ngược Android. Nó thực hiện dịch ngược (decompile) các tệp Android APK/XAPK/JAR/AAR và trích xuất các HTTP API mà ứng dụng sử dụng: các endpoint của Retrofit, các lệnh gọi OkHttp, các request của Volley, các URL được hardcode, các header/token xác thực, và luồng gọi mạng (network call flows) từ giao diện người dùng (UI).

Package này được cấu trúc lại dành cho Codex thay vì Claude Code:

  • Codex plugin manifest: plugins/android-reverse-engineering/.codex-plugin/plugin.json
  • Kỹ năng Codex (Bundled Codex skill): plugins/android-reverse-engineering/skills/android-reverse-engineering/SKILL.md
  • Codex marketplace cục bộ (Local Codex marketplace): .agents/plugins/marketplace.json
  • Các script hỗ trợ và tài liệu tham khảo nằm trong thư mục skill.

Yêu cầu hệ thống (Requirements)

Bắt buộc:

  • Java JDK 17+
  • jadx CLI

Tùy chọn nhưng khuyên dùng:

  • Vineflower/Fernflower để dịch ngược Java tốt hơn đối với code phức tạp
  • dex2jar cho quy trình làm việc với Fernflower/Vineflower trên các tệp APK/DEX
  • apktool và adb để hỗ trợ các tác vụ phân tích Android

Chạy trình kiểm tra dependency đi kèm sau khi cài đặt:

cd plugins/android-reverse-engineering/skills/android-reverse-engineering
bash scripts/check-deps.sh

Windows PowerShell:

Set-Location plugins\android-reverse-engineering\skills\android-reverse-engineering
& .\scripts\check-deps.ps1

Lựa chọn cài đặt 1: Cài đặt dưới dạng Codex plugin thông qua local marketplace

Từ thư mục gốc của repository này:

codex plugin marketplace add .

Sau đó mở Codex, sử dụng /plugins, chọn marketplace Android Reverse Engineering Codex Local, và cài đặt android-reverse-engineering.

Tệp marketplace trỏ Codex tới:

./plugins/android-reverse-engineering

Lựa chọn cài đặt 2: Chỉ cài đặt skill global (toàn cục)

Cách này đơn giản hơn nếu bạn chỉ muốn sử dụng skill $android-reverse-engineering mà không cần đóng gói plugin.

Linux/macOS:

./install-codex-skill.sh

Windows PowerShell:

.\install-codex-skill.ps1

Thao tác thủ công tương đương:

mkdir -p ~/.agents/skills
cp -R plugins/android-reverse-engineering/skills/android-reverse-engineering   ~/.agents/skills/android-reverse-engineering

Codex tự động phát hiện các skill từ .agents/skills trong một repository và từ ~/.agents/skills đối với các skill ở cấp độ toàn hệ thống. Hãy khởi động lại Codex nếu skill không xuất hiện ngay lập tức.

Hướng dẫn sử dụng trong Codex (Usage)

Gọi skill một cách rõ ràng (explicitly):

Sử dụng $android-reverse-engineering để dịch ngược ./app.apk với tham số --deobf và viết báo cáo ra api-report.md.

(Nguyên bản: Use $android-reverse-engineering to decompile ./app.apk with --deobf and write api-report.md.)

Một số prompt hữu ích khác:

Use $android-reverse-engineering to extract all Retrofit, OkHttp, Volley, hardcoded URL, and auth patterns from ./myapp-decompiled/sources.
Use $android-reverse-engineering to trace the login flow from LoginActivity through ViewModel/Repository to the HTTP request.

Sử dụng script thủ công

Từ thư mục skill:

cd plugins/android-reverse-engineering/skills/android-reverse-engineering

# Kiểm tra các dependency
bash scripts/check-deps.sh

# Cài đặt dependency còn thiếu
bash scripts/install-dep.sh jadx
bash scripts/install-dep.sh vineflower

# Dịch ngược APK với jadx
bash scripts/decompile.sh app.apk

# Dịch ngược XAPK
bash scripts/decompile.sh app-bundle.xapk

# So sánh kết quả đầu ra của jadx và Fernflower/Vineflower
bash scripts/decompile.sh --engine both --deobf app.apk

# Tìm các lệnh gọi API
bash scripts/find-api-calls.sh output/sources/
bash scripts/find-api-calls.sh output/sources/ --retrofit
bash scripts/find-api-calls.sh output/sources/ --urls
bash scripts/find-api-calls.sh output/sources/ --auth

Lệnh tương đương trong PowerShell:

Set-Location plugins\android-reverse-engineering\skills\android-reverse-engineering
& .\scripts\check-deps.ps1
& .\scripts\decompile.ps1 -Deobf app.apk
& .\scripts\find-api-calls.ps1 output\sources -Retrofit

Cấu trúc Repository (Repository structure)

android-reverse-engineering-skill-codex/
├── .agents/
│   └── plugins/
│       └── marketplace.json
├── plugins/
│   └── android-reverse-engineering/
│       ├── .codex-plugin/
│       │   └── plugin.json
│       └── skills/
│           └── android-reverse-engineering/
│               ├── SKILL.md
│               ├── agents/
│               │   └── openai.yaml
│               ├── references/
│               │   ├── setup-guide.md
│               │   ├── jadx-usage.md
│               │   ├── fernflower-usage.md
│               │   ├── api-extraction-patterns.md
│               │   └── call-flow-analysis.md
│               └── scripts/
│                   ├── check-deps.sh
│                   ├── check-deps.ps1
│                   ├── install-dep.sh
│                   ├── install-dep.ps1
│                   ├── decompile.sh
│                   ├── decompile.ps1
│                   ├── find-api-calls.sh
│                   └── find-api-calls.ps1
├── install-codex-skill.sh
├── install-codex-skill.ps1
├── LICENSE
└── README.md

Những thay đổi so với dự án gốc

  • Thay thế siêu dữ liệu (metadata) của Claude plugin bằng metadata của Codex plugin tại .codex-plugin/plugin.json.
  • Thêm .agents/plugins/marketplace.json để Codex có thể khám phá local plugin marketplace.
  • Cập nhật frontmatter của SKILL.md bao gồm các trường bắt buộc đối với Codex là namedescription.
  • Loại bỏ các tham chiếu CLAUDE_PLUGIN_ROOT và chuyển các hướng dẫn sử dụng sang các đường dẫn tương đối scripts/references/.
  • Thêm agents/openai.yaml cho UI metadata của Codex và implicit invocation policy (chính sách gọi ngầm định).
  • Thêm các trình cài đặt hỗ trợ đa nền tảng (cross-platform helper installers) để copy skill vào thư mục ~/.agents/skills/android-reverse-engineering.
  • Sửa lỗi trong Bash API search helper để đảm bảo việc tìm kiếm auth/base URL thực sự không phân biệt chữ hoa chữ thường (case-insensitive).

Tuyên bố miễn trừ trách nhiệm (Disclaimer)

Chỉ sử dụng dự án này cho các mục đích hợp pháp, chẳng hạn như kiểm tra bảo mật được ủy quyền, phân tích khả năng tương tác được pháp luật cho phép, phân tích phần mềm độc hại, giáo dục và thực hành CTF/lab. Không dịch ngược phần mềm mà bạn không được phép phân tích.

Giấy phép (License)

Apache-2.0, kế thừa từ dự án gốc SimoneAvogadro/android-reverse-engineering-skill.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages