Repository navigation
ADFA-4996: Exclude DebugProbesKt.bin from the APK - #2192
Conversation
DebugProbesKt.bin is the instrumented class the coroutines debug agent swaps in. Nothing in the repo installs DebugProbes or runs a java agent, so the 1,733-byte resource only adds noise to the APK. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAaRxctiVy7ZMt3dBCN
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
davidschachterADFA
left a comment
There was a problem hiding this comment.
CRITICAL
- none
IMPORTANT
- none
MINOR
- app/build.gradle.kts:184 - a copy of DebugProbesKt.bin stays inside tooling-api-all.jar (not reached by this exclude)
NITPICK - 1 inline, not listed
Rules and scope. Read CLAUDE.md and REVIEW.md. Neither has a written approve or request-changes rule beyond "tie every blocking comment to a concrete risk", so the skill's grading applied. Not stacked (base is stage, nothing is based on this PR). No prior approvals; the only earlier review is the claude[bot] notice that reviews are manual. Ticket ADFA-4996 asks to strip this file from the APK; the top-level entry is removed, the nested copy is the MINOR above.
Checked and holding:
- The path form works: the release APK built at
50a420ec7(1,836 entries) and the debug APK built at the same head (1,947) have no top-levelDebugProbesKt.bin; the debug APKs built 10-23 and 10-26 have it, 1,733 bytes, at the root. - Sibling excludes use the same form, tabs, ASCII, and one comment per exclude. There is one
packagingblock in the app module and no per-build-type override; themarkdown-preview-pluginandapk-viewer-pluginblocks belong to separate plugin builds. The.binis the bytecode ofkotlin/coroutines/jvm/internal/DebugProbesKt, so "the instrumented DebugProbesKt class" is accurate. - "Nothing here installs DebugProbes or runs a java agent" holds for the repo (no
DebugProbes,-javaagent,kotlinx-coroutines-debugorbyte-buddymatch in source or build files) and for the tooling jar (only the stdlib's own probe hooks referenceDebugProbes; the manifest hasMain-Classonly). - The PR body's byte size, grep and APK claims reproduce.
Not verified: the app's own dex was not scanned for DebugProbes.install; the bundled .br Maven repo and SDK archives (hundreds of MB) were not decoded, and they carry whole library jars by design; no release APK was built without the exclude, so the before/after comparison is debug before against release and debug after.
Comment only; no behaviour change. Addresses a NITPICK in review. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAaRxctiVy7ZMt3dBCN
… jar The app-level packaging exclude removes only the APK's own entry. The tooling-api-all.jar bundled under assets/data/common carried its own 1,728-byte copy, which app/build.gradle.kts cannot reach (the same gap ADFA-4202 notes for public-suffix-list.txt). Exclude it in the shadowJar block too. Rebuilt tooling-api-all.jar: 13,406 entries (was 13,407 in the debug APK), no DebugProbesKt.bin, AgentPremain classes unchanged. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAaRxctiVy7ZMt3dBCN
ADFA-4996
Excludes
DebugProbesKt.binfrom the APK. The file is the bytecode ofkotlin/coroutines/jvm/internal/DebugProbesKt, which the kotlinx-coroutines debug agent installs. It is about 1.7 KB, so the saving is under 2 KB; the point is one less stray file in the APK.Changes (review by commit):
app/build.gradle.kts:excludes += "DebugProbesKt.bin"in the existingpackaging { resources }list. This removes the APK's own entry.subprojects/tooling-api-impl/build.gradle.kts:exclude("DebugProbesKt.bin")in theshadowJarblock.assets/data/common/tooling-api-all.jarcarried its own 1,728-byte copy, which the app-level exclude cannot reach (the same gap the ADFA-4202 comment in that block describes). Found in review.Checked:
DebugProbesKt.bin(1,733 bytes) at the root. The debug APK built at the first commit has the nested copy:tooling-api-all.jar(13,407 entries) holdsDebugProbesKt.bin(1,728 bytes).:app:assembleV8Releaseat the first commit produced an APK (1,836 entries) with noDebugProbesKt.binentry../gradlew :subprojects:tooling-api-impl:jarat the last commit producedtooling-api-all.jarwith 13,406 entries and noDebugProbesKt.bin. Thekotlinx/coroutines/debug/AgentPremainclasses are still there, and the public-suffix exclude still holds.DebugProbes,-javaagentorkotlinx-coroutines-debuguse (grep over*.kt,*.java,*.kts), and the tooling jar's manifest hasMain-Classonly, so nothing here installs the debug probes.Not checked:
DebugProbes.install(). I did not read their code.AgentPremainclasses and the bundled Maven repo and SDK archives still carry whole library jars; this PR does not touch them.🤖 Generated with Claude Code
https://claude.ai/code/session_01Vh2DAaRxctiVy7ZMt3dBCN