Agent skill

Android Hidden API and R8 Check

by gkd-kit in gkd-kit/gkd

Checks whether Android hidden-API implementations and system callbacks survive R8 minification, and diagnoses Release-only failures such as AbstractMethodError.

GPL-3.0Auto-check passedMobile

Install Android Hidden API and R8 Check

skills CLI
$ npx skills add gkd-kit/gkd --skill android-hidden-api-r8 -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install gkd-kit/gkd android-hidden-api-r8 --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/gkd-kit/gkd.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/android-hidden-api-r8 .claude/skills/android-hidden-api-r8 && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
android-hidden-api-r8
GitHub stars
43k
Token cost
~1.5k tokens
SKILL.md length
745 words
Files
2 (incl. references)
Skills in repo
2
Repo updated
First seen
Licence
GPL-3.0

At a glance

Checks whether Android hidden-API implementations and system callbacks survive R8 minification, and diagnoses Release-only failures such as AbstractMethodError.

  • Adding or changing implementations of hidden Android interfaces or superclasses
  • SKILL.md covers Identify the call contract, Inspect actual R8 inputs, Choose the fix and Validate and report, plus 1 more section
  • Calls npx and pnpm
  • A Debug build works but the minified Release build crashes with AbstractMethodError

What it does

The skill makes sure R8 receives the type information and keeps the method contracts needed when Android calls project code. It starts by separating the kinds of call: into system hidden APIs, direct calls to project implementations, and system callbacks through hidden interfaces or superclasses, which do not all need keep rules. The agent identifies the runtime caller, the dispatch type, the implementation and the required method names, parameter types and return descriptors, remembering that R8 reads bytecode and not Kotlin's override keyword.

Next it inspects what R8 actually receives: the module and build variant that run it, compilation classpaths versus R8 analysis inputs, type names, descriptors and inheritance after remapping, stubs and their declared members, and existing annotations, consumer rules and missing-type diagnostics. It notes that -dontwarn only silences warnings. For regressions after a migration it compares inputs and artifacts from working and failing versions.

For the fix, it prefers restoring a dependency path that final R8 analysis can see while keeping compile stubs out of the APK. Otherwise it applies targeted @Keep or consumer keep rules to the real entry points, preserving method existence, names and signatures. A failure-cases reference file is included.

When your agent uses it

  • Adding or changing implementations of hidden Android interfaces or superclasses
  • A Debug build works but the minified Release build crashes with AbstractMethodError
  • Methods or signatures go missing or get renamed after R8 runs
  • Reviewing bytecode remapping or module dependencies that feed R8

Example prompts

  • “Our Release build throws AbstractMethodError in the accessibility callback but Debug works. Find out why R8 breaks it.”
  • “I added a class implementing a hidden system interface. Check whether R8 will keep the required methods.”
  • “Compare the R8 inputs of the last working version with the failing one after the dependency migration.”

Requirements

  • An Android project that uses R8 for its Release builds

What it can do on your machine

Read from SKILL.md and the folder at commit daed366. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npx
    • pnpm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Android Hidden API and R8 Check loads about 1.5k tokens when it runs, and up to ~2.3k if it reads all its reference files. Until then it costs about 107 tokens; SKILL.md has 745 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~107
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from gkd-kit/gkd at commit daed366, republished under its GPL-3.0 licence (© gkd-kit). 745 words, ~1,488 tokens.

Download SKILL.mdSave it as .claude/skills/android-hidden-api-r8/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
android-hidden-api-r8
description
Check compatibility between Android hidden APIs and R8 when adding or changing hidden interface or superclass implementations, system callbacks, bytecode remapping, or related module dependencies. Also use for Debug-only success with minified Release failures involving AbstractMethodError, removed or renamed methods, or changed signatures. Excludes ordinary UI, documentation, and unrelated code changes.

Android Hidden APIs and R8

Ensure R8 receives the necessary type information and preserves the method contracts required when Android calls project code. Inspect affected paths within the task's scope. Expand to a broader audit only when requested or supported by evidence.

Identify the call contract

  • Distinguish calls into system hidden APIs, direct calls to project implementations, and system callbacks through hidden interfaces or superclasses. These do not all imply missing keep rules.
  • Identify the runtime caller, dispatch type, implementation, and required method names, parameter types, and return descriptors.
  • R8 analyzes bytecode and input types, not Kotlin's override keyword. Successful compilation does not prove that the final R8 task sees the same inheritance relationships.

Inspect actual R8 inputs

  • Locate the application module and build variant that run R8. Trace both compilation classpaths and actual R8 analysis inputs. Do not infer consumer visibility from a library's compileOnly or androidMainCompileOnly declaration.
  • For remapping, check that transformed type names, method descriptors, and inheritance relationships match the declarations supplied for analysis. Resolving a remap index, applying an ASM transformation, and supplying types to final R8 analysis are separate concerns.
  • Check that stubs declare the required classes and members. A separate *Hidden type does not automatically supply hidden members missing from a public SDK type. Do not assume R8 merges duplicate types or remapped declarations into android.jar.
  • Inspect existing annotations, consumer rules, merged rules, and missing-type diagnostics. -dontwarn suppresses warnings; it does not restore missing type relationships or preserve methods.
  • For migration regressions, compare inputs and artifacts from known working and failing versions before attributing every difference to the migration.

Choose the fix

  • When analysis dependencies were lost, first restore a dependency path visible to final R8 analysis while keeping compilation stubs out of the APK. Use the project's actual AGP version, variants, and task inputs; do not treat an internal task property as a stable universal API.
  • If the contract remains invisible, apply targeted @Keep or consumer keep rules to the actual entry points. Preserve required method existence, names, and signatures; preserving names alone must not allow required methods to be removed.
  • Ship a library's required preservation rules with the library and validate them in a consumer with R8 enabled. Do not rely on a particular host accidentally supplying stubs or keep rules.
  • Choose preservation scope from evidence. Public SDK callbacks, bundled project-owned AIDL, and entry points already covered by rules do not all need Keep merely because they use Binder. Keeping entire packages or disabling R8 is not the default fix.
  • Do not infer runtime dispatch solely from the referenced class name in decompiled output. For instructions such as invoke-super, verify the applicable ART/Dalvik semantics or use a minimal runtime reproduction before changing stubs.
Show full SKILL.md (294 more words)Show less

Validate and report

  • Build the affected variant with R8 actually enabled. Before building, check whether associated tasks upload or publish artifacts. Prefer a validation path without external publication side effects and stay within the user's authorization.
  • Use mapping, usage, seeds, and merged rules as supporting evidence. Inspect the final DEX for critical methods, complete descriptors, and required inheritance relationships; no single report establishes every contract.
  • Confirm that compilation stubs are absent from the APK. Validate library changes through a consumer or minimal integration fixture, rather than only inspecting an AAR before final optimization.
  • Use runtime validation as needed for system dispatch, exception handling, or API-version compatibility. Contract checks should assert required methods and behavior, not fixed referenced class names or complete decompiled text that R8 may legitimately change.
  • Report root-cause evidence, fix scope, build/artifact results, and runtime validation separately. State any unverified parts when building or device testing is unavailable. Debug success or method presence alone does not establish that a runtime failure is fully resolved.

Read failure patterns as needed for callbacks lost after module migration, hidden members missing from public types, or uncertainty about invoke-super. Verify each hypothesis against the current project rather than applying a pattern as a universal diagnosis.

Update this skill

Upstream: lisonge/remap.

When asked to update this skill, use either command from the consuming project's root if it was installed with the skills CLI:

shell
npx skills update android-hidden-api-r8

Or with pnpm:

shell
pnpm dlx skills update android-hidden-api-r8

For a manually copied installation, compare the installed directory with upstream and merge updates to SKILL.md and references/. Preserve project-specific customizations. Review the resulting diff and reconcile any affected guidance in the project's AGENTS.md without replacing unrelated instructions. Updating the skill does not automatically update that file. Do not update the skill as part of an ordinary R8 investigation unless requested.

© gkd-kit, GPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in .agents/skills/android-hidden-api-r8 of gkd-kit/gkd.

  • SKILL.md
  • references/failure-cases.md

Open the folder on GitHubat commit daed366

Compare with similar skills

Android Hidden API and R8 Check next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Android Hidden API and R8 Check compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Android Hidden API and R8 Check this skillgkd-kit/gkd43k—~1.5kAutomated safety check: PassGPL-3.0
Coding Stylesk2andy/candy-browser485—~548Automated safety check: PassMPL-2.0
Compose Multiplatform Patternsmonta-app/ocpp-emulator1795 repos~2kAutomated safety check: PassApache-2.0
Android Tombstone Symbolicationdotnet/skills5.6k1 repos~2.1kAutomated safety check: PassMIT
Android Developmentdpconde/claude-android-skill336—~1.7kAutomated safety check: PassMIT
Architecture Overclocknekomangaorg/Neko2.8k—~1.4kAutomated safety check: PassApache-2.0

Similar skills

  • Coding Style

    sk2andy/candy-browser

    Apply Candy Browser's project-specific Kotlin, Jetpack Compose, Android/WebView, testing, and generator conventions.

    485 GitHub stars~548 tokensUpdated today
    MobileAuto-check passed
  • Compose Multiplatform Patterns

    monta-app/ocpp-emulator

    Compose Multiplatform and Jetpack Compose patterns for KMP projects — state management, navigation, theming, performance, and platform-specific UI.

    179 GitHub starsUsed in 5 repos~2k tokens
    MobileAuto-check passed
  • Official

    Resolves native crash frames from .NET Android tombstones to function names, source files and line numbers using BuildIds, Microsoft's symbol server and llvm-symbolizer.

    5.6k GitHub starsUsed in 1 repo~2.1k tokens
    MobileAuto-check passed
  • Android Development

    dpconde/claude-android-skill

    Create production-quality Android applications following Google's official architecture guidance and NowInAndroid best practices.

    336 GitHub stars~1.7k tokensUpdated 10 mo ago
    MobileAuto-check passed
  • Architecture Overclock

    nekomangaorg/Neko

    Resolves deep, structural performance bottlenecks in the Kotlin Android codebase.

    2.8k GitHub stars~1.4k tokensUpdated yesterday
    MobileAuto-check passed
  • Claude Android Ninja

    Drjacky/claude-android-ninja

    Build and migrate Android apps with Kotlin, Jetpack Compose, MVVM, Hilt, Room 3 (KSP, SQLiteDriver, Flow/suspend DAOs), Navigation3, and multi-module Gradle.

    124 GitHub stars~5.2k tokensUpdated 8 days ago
    MobileAuto-check passed

More from gkd-kit/gkd

  • Android API Diff

    gkd-kit/gkd

    Looks up Android framework Java and AIDL APIs across versions with the android-api-diff CLI: signatures, availability, source files and hidden-API access code.

    43k GitHub stars~796 tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Android Hidden API and R8 Check

What does Android Hidden API and R8 Check do?

Checks whether Android hidden-API implementations and system callbacks survive R8 minification, and diagnoses Release-only failures such as AbstractMethodError. The skill makes sure R8 receives the type information and keeps the method contracts needed when Android calls project code. It starts by separating the kinds of call: into system hidden APIs, direct calls to project implementations, and system callbacks through hidden interfaces or superclasses, which do not all need keep rules.

When should I use Android Hidden API and R8 Check?

Android Hidden API and R8 Check fits situations like: adding or changing implementations of hidden Android interfaces or superclasses; A Debug build works but the minified Release build crashes with AbstractMethodError; methods or signatures go missing or get renamed after R8 runs; reviewing bytecode remapping or module dependencies that feed R8.

How do I install Android Hidden API and R8 Check in Claude Code?

Run `npx skills add gkd-kit/gkd --skill android-hidden-api-r8 -a claude-code`. Or copy the skill folder (.agents/skills/android-hidden-api-r8 in gkd-kit/gkd) into .claude/skills/android-hidden-api-r8 in your project. Claude Code loads it when a task matches its description.

How do I install Android Hidden API and R8 Check in Codex?

Run `npx skills add gkd-kit/gkd --skill android-hidden-api-r8 -a codex`. Or copy the skill folder (.agents/skills/android-hidden-api-r8 in gkd-kit/gkd) into .agents/skills/android-hidden-api-r8 in your project. Codex loads it when a task matches its description.

Can I use Android Hidden API and R8 Check in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add gkd-kit/gkd --skill android-hidden-api-r8 -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/android-hidden-api-r8, .gemini/skills/android-hidden-api-r8, .github/skills/android-hidden-api-r8 and .opencode/skills/android-hidden-api-r8 in your project.

What does Android Hidden API and R8 Check need to run?

Going by SKILL.md and its folder, Android Hidden API and R8 Check needs the command-line tools its instructions call (npx and pnpm). Our summary lists: An Android project that uses R8 for its Release builds.

Does Android Hidden API and R8 Check access the network?

SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.

Is Android Hidden API and R8 Check safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Android Hidden API and R8 Check use?

Android Hidden API and R8 Check is published under the GPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Android Hidden API and R8 Check use?

About 1.5k tokens (SKILL.md is roughly 6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 776 tokens, read only when the agent opens those files.

What are the alternatives to Android Hidden API and R8 Check?

Skills that share tags, products or a category with Android Hidden API and R8 Check: Coding Style (sk2andy/candy-browser, 485 stars), Compose Multiplatform Patterns (monta-app/ocpp-emulator, 179 stars), Android Tombstone Symbolication (dotnet/skills, 5.6k stars) and Android Development (dpconde/claude-android-skill, 336 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Android Hidden API and R8 Check?

gkd-kit (a GitHub organization) maintains it in gkd-kit/gkd, which has 42,544 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on October 6, 2026.

Source: gkd-kit/gkd on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.