Repository navigation
chore: upgrade dotlottie-rs to v0.1.60, enable audio, harden native libs - #146
Merged
Merged
Conversation
Bump deps/dotlottie-rs from 3bb9d23 (v0.1.58+21) to v0.1.60, which moves ThorVG from v1.1.0 to v1.1.3 and brings bezier path slots, experimental video support, interruptible tweened transitions and audio seek/segment sync fixes. The C API and generated header are unchanged, so the JNI bridge and Kotlin bindings need no changes. Also fix the NDK version check in make/android.mk: it used a GNU-only sed escape and misparsed the revision on macOS.
Build libdotlottie_player.so with the dotlottie-rs `audio` feature (rodio/cpal/oboe) so .lottie files with audio layers play their sound. The JNI bridge already handed the JavaVM and application Context to dotlottie_init_android through dlsym, and every View and composable calls ensureAndroidInitialized, so that path now resolves instead of being a no-op. Add setAudioVolume(Float) and audioVolume to the low-level player, the drawable, both Views and the Compose controller, backed by two new JNI methods over dotlottie_set_audio_volume / dotlottie_get_audio_volume. Document the feature and the init requirement for headless use of the low-level player.
cargo invokes the NDK clang directly, bypassing ndk-build and CMake, which is where the NDK normally injects -fstack-protector-strong. As a result ThorVG and oboe were compiled without stack canaries and libdotlottie_player.so had no __stack_chk_fail reference (#142). Export CFLAGS/CXXFLAGS with -fstack-protector-strong on every cargo invocation so the cc crate applies it. Rust code itself has no stack protector on stable rustc. Rebuild all four ABIs against NDK r29 with the audio feature and the hardening flag, and stamp version.txt with the v0.1.60 submodule commit.
The NDK's prebuilt libc++_shared.so has no stack protector and is flagged by security scanners (#69). It cannot be rebuilt, so remove it from the AAR by linking libc++ statically into both native libraries. This is safe here: only a C API crosses the boundary between libdlplayer.so and libdotlottie_player.so, ThorVG is compiled with -fno-exceptions -fno-rtti, the JNI bridge uses no C++ standard library, and the Rust cdylib's version script keeps libc++ symbols out of the export table (exports remain exactly the dotlottie_* C API). For the cargo build, CXXSTDLIB="" stops the cc crate and the dotlottie-rs build script from adding -lc++ (an NDK linker script for -lc++_shared), and -lc++_static -lc++abi are appended through per-target RUSTFLAGS so they follow every object that references them. The JNI bridge switches to ANDROID_STL=c++_static and the libc++_shared pickFirst rule goes. libdotlottie_player.so grows by 117-208 KB per ABI while the 0.9-1.4 MB libc++_shared.so is dropped, a net reduction of 0.8-1.2 MB per ABI. libjnidispatch.so from the same issue stopped shipping with the move off JNA.
|
android-actions/setup-android defaults to installing 'tools platform-tools'. Google no longer publishes the legacy 'tools' package, so the setup step fails before anything in the repository runs. Request platform-tools only.
This was referenced Oct 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Four commits, in order:
3bb9d23→03cb06a, ThorVG v1.1.0 → v1.1.3). Brings bezier path slots, experimental video support, interruptible tweened transitions, fractional keyframe frames in themes/slots, and audio seek/segment sync fixes. The C API and generated header are unchanged, so no binding changes were needed. Also fixes the NDK version check inmake/android.mk, which used a GNU-only sed escape and misparsed on macOS.audiofeature (rodio/cpal/oboe). The JNI bridge already handed the JavaVM and Context todotlottie_init_androidviadlsym, so that path now resolves. AddssetAudioVolume(Float)/audioVolumeon the low-level player, drawable, both Views and the Compose controller, plus README docs.-fstack-protector-strong, so ThorVG and oboe had no canaries. The makefile now exportsCFLAGS/CXXFLAGSwith the flag. Rust code has no stack protector on stable rustc by design.libc++_shared.sono longer shipped (x86/libc++_shared.so and x86/libjnidispatch.so not passing mobsf security review #69). The NDK's prebuiltlibc++_shared.sohas no canaries and cannot be rebuilt. Only a C API crosses the library boundary, ThorVG is built with-fno-exceptions -fno-rtti, the JNI bridge uses no C++ stdlib, and the cdylib version script keeps libc++ out of the export table.libjnidispatch.sofrom the same issue stopped shipping with the move off JNA.All four ABIs rebuilt from a clean target against NDK r29 (29.0.14206865), matching
ndkVersionin Gradle.Verification (per shipped
libdotlottie_player.so)__stack_chk_faildotlottie_*Net size = library growth from static libc++ (117–208 KB) minus the removed
libc++_shared.so(0.9–1.4 MB). Header regenerated by cbindgen is byte-identical to the committed one. Feature strings (webp/png/jpg/ttf/expressions) and ThorVG 1.1.3 version string confirmed present.Behaviour notes
setAudioVolumeis clamped to0f..1fnatively; default1f.ensureAndroidInitialized. Headless use ofcom.dotlottie.dlplayer.DotLottiePlayermust call it once before loading an animation with audio, otherwise cpal panics on the missing JVM context. Documented in the README.threadsis set).libc++_shared.sofor other native libs will need to supply their own; thepickFirstsrule was removed since there is nothing to pick.Not verified here
No Android SDK on the build machine, so Gradle, the CMake build of
libdlplayer.sowithANDROID_STL=c++_static, and the sample apps were not run. Please smoke test on a device: an animation with audio plays sound; plain animations render on View, GL View, Compose and hardware-buffer paths; an app that also bundles its ownlibc++_shared.soloads fine.Closes #69. Addresses #142.