Skip to content

ADFA-4729: Keep native libs compressed in CI debug APKs - #1532

Merged
davidschachterADFA merged 3 commits into
stagefrom
task/ADFA-4729-compress-debug-libs
Jul 16, 2026
Merged

ADFA-4729: Keep native libs compressed in CI debug APKs#1532
davidschachterADFA merged 3 commits into
stagefrom
task/ADFA-4729-compress-debug-libs

Conversation

@jomen-adfa

@jomen-adfa jomen-adfa commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Fixes ADFA-4729.

What

CI-built debug APKs now keep their native libs deflate-compressed, shrinking them by ~5.9 MB (v8: 8.07 MB -> 1.75 MB of lib/). One-line fix plus comments/docs: drop "so" from noCompressDebug, the exclusion list used by the CI-only debug recompressApk pass.

Root cause

The app manifest hard-codes android:extractNativeLibs="true" (required — the installer must materialize libs in nativeLibraryDir; e.g. libshizuku.so is an executable the adb shell runs from there). That attribute overrides the jniLibs.useLegacyPackaging DSL, so AGP already packages lib/<abi>/*.so deflate-compressed in every APK — locally built debug APKs included (verified byte-identical against a pre-change test-farm APK). The only APKs with uncompressed libs were the ones that went through recompressApk with "so" in its no-compress list: release (fixed in ADFA-2306 / #1527) and CI debug (this PR).

ARCHITECTURE.md's native-lib-compression bullet is rewritten to document the real mechanism: the manifest attribute is the operative fact, and the recompressApk no-compress lists are the trap that can silently undo AGP's compression.

Verification

  • CI-simulated build (GITHUB_ACTIONS=true ./gradlew :app:assembleV8Debug): all 11 .so entries deflated (8,072,840 -> 1,745,413 bytes), extractNativeLibs=true; APK installs on an arm64 emulator, installer extracts all 11 libs to nativeLibraryDir, app launches with a project open and zero UnsatisfiedLinkError.
  • Local build (no env var): APK lib entries byte-identical to pre-change farm APKs — local dev and the e2e farm are unaffected (they never run recompressApk).

🤖 Generated with Claude Code

The app manifest hard-codes extractNativeLibs="true" (the installer must
materialize libs in nativeLibraryDir, e.g. libshizuku.so is an executable
run from there), which overrides the useLegacyPackaging DSL - so AGP
already packages lib/*.so deflate-compressed in every APK, debug included.
But the CI-only debug recompressApk pass kept "so" in its no-compress list
and silently re-stored them, making CI debug APKs ~5.9 MB larger than
locally built ones. Drop "so" from noCompressDebug, matching the release
fix from ADFA-2306.

Verified: CI-simulated v8 debug APK has all 11 libs deflated
(8.07 MB -> 1.75 MB) and installs/launches cleanly on an arm64 emulator;
locally built debug APKs are byte-identical to before (they never run
recompressApk).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@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 16, 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ee94a4f4-9302-4cb1-8b9e-effa145bb74c

📥 Commits

Reviewing files that changed from the base of the PR and between deb7e0e and 18032dd.

📒 Files selected for processing (1)
  • app/build.gradle.kts
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/build.gradle.kts

📝 Walkthrough
  • Fixed CI debug APK packaging by keeping native .so libraries deflate-compressed, reducing lib/ contents from ~8.07 MB to ~1.75 MB.
  • Documented native-library extraction and recompressApk behavior.
  • Verified all 11 libraries are compressed and the APK installs and launches on an arm64 emulator.
  • Local debug APKs remain unchanged.

Walkthrough

The change updates CI debug APK packaging so native .so libraries remain DEFLATED, and documents how manifest extraction, legacy packaging, and recompressApk behavior interact across debug and release builds.

Changes

Native library packaging

Layer / File(s) Summary
Debug compression configuration
app/build.gradle.kts, ARCHITECTURE.md
noCompressDebug now excludes both "jar" and "so", while architecture documentation records the manifest and recompression constraints for native libraries.

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

Possibly related PRs

Suggested reviewers: davidschachteradfa, jatezzz

Poem

I’m a bunny with libraries packed,
Keeping .so files DEFLATED and stacked.
Debug builds now hop just right,
Manifest paths guide them through the night.
Recompress rules align in flight!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main change: keeping native libs compressed in CI debug APKs.
Description check ✅ Passed The description is directly about the same fix and explains the cause, change, and verification.
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 task/ADFA-4729-compress-debug-libs

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 51b1605 into stage Jul 16, 2026
4 checks passed
@davidschachterADFA
davidschachterADFA deleted the task/ADFA-4729-compress-debug-libs branch July 16, 2026 15:44
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.

3 participants