Skip to content

ADFA-4996: Exclude DebugProbesKt.bin from the APK - #2192

Merged
davidschachterADFA merged 7 commits into
stagefrom
fix/ADFA-4996
Oct 29, 2026
Merged

davidschachterADFA merged 7 commits into
stagefrom
fix/ADFA-4996

Conversation

@davidschachterADFA

@davidschachterADFA davidschachterADFA commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

ADFA-4996

Excludes DebugProbesKt.bin from the APK. The file is the bytecode of kotlin/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):

  1. app/build.gradle.kts: excludes += "DebugProbesKt.bin" in the existing packaging { resources } list. This removes the APK's own entry.
  2. Comment only: shortens the comment from commit 1 (review NITPICK).
  3. subprojects/tooling-api-impl/build.gradle.kts: exclude("DebugProbesKt.bin") in the shadowJar block. assets/data/common/tooling-api-all.jar carried 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:

  • Before: the debug APKs built on 10-23 and 10-26 contain 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) holds DebugProbesKt.bin (1,728 bytes).
  • After, top level: :app:assembleV8Release at the first commit produced an APK (1,836 entries) with no DebugProbesKt.bin entry.
  • After, nested: ./gradlew :subprojects:tooling-api-impl:jar at the last commit produced tooling-api-all.jar with 13,406 entries and no DebugProbesKt.bin. The kotlinx/coroutines/debug/AgentPremain classes are still there, and the public-suffix exclude still holds.
  • The repo has no DebugProbes, -javaagent or kotlinx-coroutines-debug use (grep over *.kt, *.java, *.kts), and the tooling jar's manifest has Main-Class only, so nothing here installs the debug probes.

Not checked:

  • A full APK build at the last commit. The nested jar was checked by building the module; I did not rebuild and inspect the APK again.
  • Transitive dependencies that might call DebugProbes.install(). I did not read their code.
  • The AgentPremain classes 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

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

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: b78a8b9c-6c99-44e1-9d78-762885d7f199
Commits

Reviewing files that changed from the base of the PR and between 12c58bd and 270e8e9.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 418da139-bb9a-4eea-b21c-033f12c23e02
Commits

Reviewing files that changed from the base of the PR and between 50a420e and 8a474e3.

Files selected for processing: 2
  • app/build.gradle.kts
  • subprojects/tooling-api-impl/build.gradle.kts
Files skipped from review as they are similar to previous changes: 1
  • app/build.gradle.kts

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

📝 Summary
  • Excluded DebugProbesKt.bin from APK resources and from the tooling-api-impl shadow JAR.
  • Risk: The exclusion removes the coroutine debug-agent resource. The supplied evidence does not establish whether transitive dependencies use DebugProbes.install() or confirm build test results.

The APK packaging configuration and the tooling API shadowJar configuration now exclude DebugProbesKt.bin. The existing public-suffix-list exclusion remains unchanged.

Changes: Packaging Resource Exclusions

Layer / File(s) Summary
Debug-agent resource exclusion
app/build.gradle.kts, subprojects/tooling-api-impl/build.gradle.kts
The APK packaging and tooling API shadowJar configurations exclude DebugProbesKt.bin. The existing public-suffix-list exclusion remains unchanged.

Priority: Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Suggested reviewers: itsaky-adfa, daniel-adfa

Merge Risk: Minimal · previous review 8a474

No actionable merge-blocking issue was identified; normal build validation should confirm the final archive contents.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title names the main change: excluding DebugProbesKt.bin from the APK, with the ticket ID. The raw summary confirms the packaging exclude in app/build.gradle.kts and the shadowJar exclude in the t…
Description check Passed The description explains the change. It names the excluded file, says what it is, and lists the commits that add the app-level exclude, a comment fix, and the tooling-api shadowJar exclude. It also gi…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within survi…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: excluding DebugProbesKt.bin from the APK, with the ticket ID. The raw summary confirms the packaging exclude in app/build.gradle.kts and the shadowJar exclude in the tooling-api-impl build, both of which serve that goal.

Full details: Description check

Explanation

The description explains the change. It names the excluded file, says what it is, and lists the commits that add the app-level exclude, a comment fix, and the tooling-api shadowJar exclude. It also gives build and jar-entry checks and open items. This matches the changeset in the summary.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 2 files.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks the bundles tight,
One debug file slips out of sight.
The APK and shadow JAR agree,
Both leave that resource off the tree.
Then hops away, content as can be.

Comment @coderabbitai help to get the list of available commands.

@davidschachterADFA davidschachterADFA left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-level DebugProbesKt.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 packaging block in the app module and no per-build-type override; the markdown-preview-plugin and apk-viewer-plugin blocks belong to separate plugin builds. The .bin is the bytecode of kotlin/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-debug or byte-buddy match in source or build files) and for the tooling jar (only the stdlib's own probe hooks reference DebugProbes; the manifest has Main-Class only).
  • 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 thread app/build.gradle.kts Resolved
Comment thread app/build.gradle.kts Resolved
davidschachterADFA and others added 2 commits October 27, 2026 14:02
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
@davidschachterADFA
davidschachterADFA merged commit b71d0f2 into stage Oct 29, 2026
6 checks passed
@davidschachterADFA
davidschachterADFA deleted the fix/ADFA-4996 branch October 29, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants