play-billing-library-version-upgrade
Skill này làm gì
Skill này nâng cấp hoặc chuyển đổi Google Play Billing Library của dự án Android lên phiên bản ổn định mới nhất. Nó tìm phiên bản bắt đầu thực sự, kể cả mã đã lỗi thời, và lập kế hoạch các bước. Nó dành cho lập trình viên Android đang bảo trì mã mua hàng trong ứng dụng.
Khi nào nên dùng
- ✓Khi ứng dụng Android của bạn dùng phiên bản cũ của Google Play Billing Library và bạn muốn cập nhật.
- ✓Khi bản build của ứng dụng lỗi vì dùng mã thanh toán đã lỗi thời như SkuDetails.
- ✓Khi bạn cần một kế hoạch từng bước để chuyển qua nhiều phiên bản chính của thư viện thanh toán.
Liên kết skill
https://github.com/android/skills/blob/main/play/play-billing-library-version-upgrade/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Nâng cấp Google Play Billing Library trong ứng dụng Android của tôi lên phiên bản ổn định mới nhất.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill kiểm tra phiên bản phụ thuộc thanh toán, rồi thử build. Nếu build lỗi, nó quét các lớp thanh toán đã lỗi thời để tìm phiên bản thật. Sau đó nó lập kế hoạch chuyển trực tiếp hoặc chuyển theo bậc lên bản ổn định mới nhất.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Phase 0: Intent Message
Reporting Action: Before proceeding, immediately tell the user: "I will upgrade Play Billing Library to the latest version."
Phase 1: Discovery & Situational Awareness
- Primary Check (Build Version) : Locate the project's billing dependency (e.g.,
com.android.billingclient:billing) inbuild.gradle,build.gradle.kts, orlibs.versions.toml. - Initial Compilation Test: Attempt to sync and build the project immediately.
- Fallback Discovery (Effective Version) :
- Trigger: Only if the build fails immediately, scan the source code for deprecated artifacts.
- Logic : The presence of deprecated APIs indicates the "Effective Version" ---defined as the version where those specific APIs were last available, not when they were introduced.
- Example : If
SkuDetailsis present, treat the baseline as PBL v7 or earlier (regardless of the version string inbuild.gradle).
- Identify Target & Path : Access the version tool or release notes to find the latest stable version and calculate a [Direct/Stepped] migration path based on the Effective Version baseline.
- Calculate Migration Path :
- If the Effective Version is within 2 major versions of the target: Plan a Direct Migration.
- If it is more than 2 major versions behind: Plan a Stepped Migration. Migrate by two major versions at a time (e.g., v4 -> v6 -> v8) until you are within two versions of the target.
- Reporting Action: Before proceeding, tell the user: "I've detected you are effectively on PBL [Current] and the latest is [Target]. I am planning a [direct/stepped] migration path."
Phase 2: Contextual Document Mapping & Planning
For every major version jump identified in your path, you MUST synthesize instructions from:
- Migration Guide (where
[X]is the target major version). - Release Highlights : The "Deprecations" and "Breaking Changes" sections of the relevant Release Notes.
- Developer Documentation: Consult your knowledge of the Google Play Billing documentation regarding the relevant features used in this app (e.g., Subscriptions, One-Time Products).
- Develop the Plan: Identify every specific code change required (API removals, class replacements, logic shifts) and print this out as a checklist.
Phase 3: Instructions for Execution
Reporting Action: For each of the following steps, give a brief explanation of what you will be doing prior to execution, and a brief summary of what you accomplished afterwards.
Step 1: SDK & Environment Alignment
- Action : Update
build.gradleto meet SDK requirements (e.g., "PBL 9 requirescompileSdk35"). - Gradle Version: Verify if the new library requires a newer Android Gradle Plugin (AGP) or Kotlin version.
Step 2: Intent-based Refactoring
Analyze the intent of the existing code rather than performing purely textual string replacement.
- Action : You MUST follow all deprecation instructions and refactor patterns from both the references/migration-logic.md section, the official migration guides, and the general documentation pages identified in Phase 2.
- Verification : Verify you are doing all steps from all documentation and then making sure you follow the specific directions from the checklist in the references.
Step 3: Sequential Verification (Only applicable for Stepped Migrations)
- Upgrade to the first major intermediate version in your path.
- Run
./gradlew assembleDebugto verify no intermediate breaking changes were missed. - Repeat until you reach the final target version.
Step 4: Final Validation Checklist
- Smart Checklist Verification:
- Open references/version-checklist.md and locate the Smart Version-Specific Checklist.
- Action: For every version between your [Detected Effective Version] and [Detected New Version], verify that every item has been addressed in the code using "Find in Files" or structural analysis.
- Tests : Run all unit and implementation tests (
./gradlew test). - Clean Build : Verify the project completes a full clean build:
./gradlew clean assembleDebug. Then, run./gradlew syncand./gradlew builds
Câu hỏi thường gặp
Vì sao phiên bản trong file build đôi khi không khớp?
Mã đã lỗi thời có thể cho thấy ứng dụng thực sự đang ở phiên bản cũ hơn, nên skill dùng phiên bản mà mã đó còn hoạt động lần cuối.
Khi nào dùng chuyển đổi theo bậc?
Khi ứng dụng lạc hậu hơn hai phiên bản chính so với bản ổn định mới nhất, skill lập kế hoạch nâng cấp theo bậc.
Nó có kiểm thử luồng mua hàng không?
Skill tập trung vào các bước nâng cấp và build, nên bạn vẫn cần tự kiểm thử việc mua hàng.
Chi tiết
Mô tả gốc của tác giả
Use this skill when upgrading or migrating an Android project from any legacy Google Play Billing Library (PBL) version to the latest stable version of PBL.
repo: android/skills
Độ phổ biến
- Sao GitHub
- 10k
- Vị trí xếp hạng
- #11929
- Giấy phép
- Apache-2.0
- Cập nhật
- 29/10/2026
Bình luận
- …
Thêm skill từ kho mã này
agp-9-upgrade
10kGiúp agent của bạn nâng cấp ứng dụng Android lên Android Gradle Plugin 9 và xử lý các thay đổi gây lỗi. Không dành cho dự án đa nền tảng.
camerax
10kGiúp agent của bạn xây dựng các tính năng camera Android bằng CameraX, gồm quay video, điều khiển phần cứng, ML Kit và hiệu ứng Media3.
android-for-cars-parked-apps
10kĐiều chỉnh một ứng dụng video, trò chơi hoặc trình duyệt Android để chạy như ứng dụng khi xe đỗ trên Android Auto và Android Automotive.
appfunctions
10kTìm các luồng công việc chính trong ứng dụng Android và công khai chúng dưới dạng AppFunctions để agent AI và lệnh giọng nói có thể chạy.
Skill tương tự
android-clean-architecture
280kGiúp agent của bạn tổ chức dự án Android hiệu quả, cấu trúc code để việc bảo trì và phát triển tính năng mới dễ dàng hơn.
compose-multiplatform-patterns
280kGiúp agent của bạn dùng các mẫu Compose Multiplatform và Jetpack Compose trong dự án KMP, gồm trạng thái, điều hướng, giao diện và hiệu năng.
dart-flutter-patterns
280kGiúp agent của bạn viết code cho ứng dụng Dart và Flutter. Agent dùng các mẫu hiện đại để tạo ứng dụng vững chắc và dễ quản lý.