Repository navigation
build: compress DEX and native libs in APK (legacy packaging) - #364
TimeToBuildBob wants to merge 1 commit into
Conversation
Sets dex.useLegacyPackaging = true and jniLibs.useLegacyPackaging = true so that DEX and .so files are stored compressed rather than uncompressed. Per-ABI APKs are currently 61–73 MB uncompressed. IzzyOnDroid maintainer estimates legacy packaging reduces APK size by 30–40 MB, potentially bringing arm64 within the ~30 MB per-app limit. Trade-off: compressed .so prevents Android 9+ from mmapping the library directly from the APK zip, adding extraction overhead on install/update. The size benefit is significant enough for third-party repo distribution. Closes: ActivityWatch#61 (pending CI measurement) Git-Session-Id: 63be8af6-6fc3-4ea8-9852-4cf1b5219c81
🤖 AI code reviewAdds a Safe to merge — no P0/P1 findingsConfidence 5/5 ✅ No findings. The diff looks correct to me on this pass. Files changed (1) — the diff as I read it
Previous review passes
Reviewed Maintainer commands
|
|
Updated after IzzySoft's clarification on ActivityWatch/aw-android#61: this PR is now draft, not waiting only on a merge click. IzzyOnDroid relisting is ruled out under its no-LLM policy. The diff currently enables compression globally, while universal and per-ABI builds have different download/installed-storage trade-offs. The APK build matrix was skipped, so passing tests do not supply the promised size comparison. Removed the issue-closing claim from the description. Maintainer distribution-scope/F-Droid preference and measured APK/installed-footprint evidence remain prerequisites to selecting a default; no code change or merge made. |
Summary
Proposes
dex.useLegacyPackaging = trueandjniLibs.useLegacyPackaging = trueinmobile/build.gradle, compressing DEX and native-library ZIP entries. The current diff applies to both universal and per-ABI APKs; it is not a universal-only change.Related: #61. This is a packaging experiment, not an issue-closing fix or an IzzyOnDroid relisting path.
Distribution decision still needed
IzzySoft's follow-up confirms that ActivityWatch is not eligible for IzzyOnDroid under its no-LLM policy. A smaller APK does not change that decision.
The remaining motivation is reducing download/transfer cost, especially for the universal APK. Compressing native libraries requires extraction on install, trading smaller APKs against extraction overhead and an additional native-library copy on device. Universal and single-ABI builds have different trade-offs; do not infer installed-size savings from download savings alone.
Before adopting this globally, maintainers should decide whether compression should be universal-only or also apply to per-ABI builds, and clarify F-Droid's preference as IzzySoft suggested. This PR does not establish that preference.
Verification
Current-head tests passed, including the release-variant R8 smoke test and Android API 29 E2E check. The APK build matrix was skipped, so these checks do not provide before/after release APK size measurements or installed-footprint evidence.
Still required before choosing a default: comparable universal/per-ABI build sizes, installed-footprint and startup checks for the compressed native-library path, and a maintainer decision on distribution scope. The size reductions discussed in the issue remain estimates, not measurements of this PR.