Skip to content

feat(android): add Compressor_enableAudio flag to build without TAndroidLame - #433

Open
chocky335 wants to merge 1 commit into
numandev1:mainfrom
chocky335:android/optional-audio-compression
Open

chocky335 wants to merge 1 commit into
numandev1:mainfrom
chocky335:android/optional-audio-compression

Conversation

@chocky335

Copy link
Copy Markdown

Summary

Every Android app that installs the library ships libandroidlame.so from a JitPack fork, even if it never calls Audio.compress (#427, and earlier #366, #373, #379). The new Compressor_enableAudio Gradle property, default true, lets an app build without it: with false, android/build.gradle swaps the LAME-based AudioCompressor.kt for a stub that rejects with [E_AUDIO_DISABLED], and drops TAndroidLame, jlayer and the JitPack repo.

Review focus: the source-set swap in android/build.gradle. The Nitro spec and iOS do not change.

Closes #427

Changelog

[Android] [Added] - Compressor_enableAudio Gradle property to build without audio compression and the TAndroidLame dependency

Test Plan

  • Ran local JS PR gate: yarn test:pr
  • If this changes compression/upload/download native behavior, ran the Harness tests on a simulator/device: yarn test:harness:android or yarn test:harness:ios.

@chocky335

Copy link
Copy Markdown
Author

Build and device checks for this change.

  • yarn test:pr: 15 tests pass, lint reports 0 errors (the 9 warnings exist on main).
  • CI's ./gradlew assembleDebug --build-cache with the flag on and with it off: both build. With the flag off, the APK has no libandroidlame.so, and dexdump finds 0 com.naman14 and 0 javazoom classes (9 and 71 with the flag on). The dependency tree lists TAndroidLame and jlayer only with the flag on. ./gradlew lint passes in both modes.
  • Release APK, arm64: about 327 KB smaller with the flag off.
  • Xiaomi Mi 11 Lite, Android 13, release build of examples/bare with a probe screen. Flag on: Audio.compress, Image.compress and createVideoThumbnail resolve. Flag off: Audio.compress rejects with [E_AUDIO_DISABLED], the other two resolve. No crash in logcat.
  • The harness suite did not run on that phone. It hangs off a remote host, and Metro cannot reach it through adb reverse. The probe covers the same three calls.

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.

[Feature Request] Android: build without audio compression and the TAndroidLame dependency

1 participant