Skip to content

ADFA-943: Strip leftover top-level cruft from the release APK - #1593

Merged
davidschachterADFA merged 4 commits into
stagefrom
fix/ADFA-943-cleanup-apk-top-level
Jul 28, 2026
Merged

ADFA-943: Strip leftover top-level cruft from the release APK#1593
davidschachterADFA merged 4 commits into
stagefrom
fix/ADFA-943-cleanup-apk-top-level

Conversation

@davidschachterADFA

@davidschachterADFA davidschachterADFA commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • ADFA-943: the release APK carried a bunch of leftover top-level files not present in upstream AndroidIDE's build.
  • Added packaging.resources.excludes entries in app/build.gradle.kts to strip:
    • Raw .proto sources leaked by the protobuf gradle plugin's default resource bundling (project-models, aapt2-proto, profiler, jvm-symbol-models), plus protobuf's own well-known-type sources and edition feature-default descriptors — none of these are read at runtime, only by protoc/codegen.
    • Inert version-metadata properties from httpclient/httpcore, google-http-client, google-auth-library, unbescape, and the shaded OpenTelemetry API in the Kotlin compiler embeddable jar.
    • IntelliJ-platform-only descriptors (intellij.java.frontback.psi[.impl].xml) and the shaded log4j NOTICE from the Kotlin compiler embeddable jar.
    • jgit's OSGi bundle localization file (OSGI-INF/l10n/plugin.properties).
  • assets/templates/xml/{drawable,layout,menu}.xml, also flagged in the ticket, turned out to be actively used (ProjectWriter.createMenu/createDrawable/createLayout, wired to the file-tree "new file" action) — left alone.

Test plan

  • flox activate -d flox/local -- ./gradlew :app:assembleV8Release --parallel --max-workers=6 builds successfully.
  • Unzipped the resulting APK and diffed its top-level entries before/after — every file listed in the ticket is gone; only expected entries remain (dex, manifest, resources.arsc, Kotlin/coroutines metadata, and Firebase/Play Services version metadata used by features CoGo added beyond AndroidIDE).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved Android packaging to prevent build-time-only metadata and source files from being included in released APK and AAB artifacts.
    • Updated packaged resource exclusions to reduce unnecessary files while preserving required runtime resources.

The protobuf gradle plugin bundles project-models/aapt2-proto/profiler/
jvm-symbol-models' raw .proto sources into their own resources by
default, and several third-party jars (protobuf-javalite, httpclient,
google-http-client, google-auth-library, unbescape, jgit, the Kotlin
compiler embeddable's shaded log4j/OpenTelemetry) drop inert version
metadata or IntelliJ-only descriptors at the APK root. None of this is
read at runtime, so exclude it via packaging.resources in app/build.gradle.kts.

assets/templates/xml/{drawable,layout,menu}.xml, also flagged in the
ticket, turned out to be wired to the file-tree "new file" action
(ProjectWriter.createMenu/createDrawable/createLayout) and were left alone.

Verified by building :app:assembleV8Release and diffing the APK's
top-level entries before/after.

@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 Jul 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c4d0b7b7-4650-495a-b86d-ee50999a388f

📥 Commits

Reviewing files that changed from the base of the PR and between babd11c and 94c028e.

📒 Files selected for processing (1)
  • app/build.gradle.kts

📝 Walkthrough

Walkthrough

The Android packaging configuration revises protobuf exclusions and adds exclusions for build-time metadata from several third-party libraries while retaining the public suffix list exclusion.

Changes

Packaging exclusions

Layer / File(s) Summary
Resource exclusion rules
app/build.gradle.kts
The packaging configuration replaces protobuf directory exclusions with raw .proto and descriptor-set exclusions, and adds exclusions for HttpClient, Google HTTP client/auth, Kotlin, unbescape, IntelliJ, jgit, and related metadata files.

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

Possibly related PRs

Suggested reviewers: jatezzz, jomen-adfa

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: removing leftover packaged files from the release APK.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ADFA-943-cleanup-apk-top-level

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@davidschachterADFA
davidschachterADFA merged commit 2e606b7 into stage Jul 28, 2026
4 checks passed
@davidschachterADFA
davidschachterADFA deleted the fix/ADFA-943-cleanup-apk-top-level branch July 28, 2026 23:01
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