Commit 9045142
authored
feat: o3 level optimization for image diffing (#443)
## Summary
Replace the CMake-compiled C native library with prebuilt `.so` binaries
in the Android SDK, pin additional AndroidX Lifecycle dependencies in
the MAUI NuGet packages, and bump the MAUI SDK version to 0.5.2.
## Changes
### Android SDK (`observability-android`)
- **Switch from CMake source compilation to prebuilt `.so` binaries**:
Removed all C source files (`tile_hash.c`, `tile_hash.h`,
`tile_hash_jni.c`, `nearest_divisor.c`, `nearest_divisor.h`) and the
`externalNativeBuild { cmake { ... } }` block from `build.gradle.kts`.
Added prebuilt `libsession_replay_c.so` binaries under `jniLibs/` for
all four ABIs: `arm64-v8a`, `armeabi-v7a`, `x86`, `x86_64`. This
eliminates the CMake/NDK build dependency and ensures consistent binary
output across environments.
- **Rename native library**: Updated `TileHashNative.kt` to load
`session_replay_c` instead of the old `tile_hash` library name.
### MAUI / .NET SDK (`mobile-dotnet`)
- **Pin additional AndroidX Lifecycle dependencies**: Added
`Xamarin.AndroidX.Lifecycle.LiveData` and
`Xamarin.AndroidX.Lifecycle.ViewModelSavedState` at `[2.9.2.1, 3.0.0)`
in both `LDObservability.csproj` and `LDObservability.Fat.csproj` to
prevent NU1608 version-mismatch warnings in consumer projects.
- **Version bump to 0.5.2** in `Directory.Build.props`.
## Test Plan
- [ ] Build Android SDK — verify it compiles without CMake/NDK and the
prebuilt `.so` files are bundled correctly in the AAR
- [ ] Run Android SDK on all ABIs (arm64-v8a, armeabi-v7a, x86, x86_64)
— verify `TileHashNative` loads `libsession_replay_c.so` successfully
- [ ] Build MAUI SDK — verify no NU1608 dependency warnings
- [ ] Run session replay on Android via MAUI — verify tile hashing works
end-to-end
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Switches Android session-replay hashing from source-built JNI
(CMake/NDK) to bundled prebuilt `.so` binaries and renames the loaded
library, which can impact runtime loading/ABI compatibility. Additional
AndroidX pinning and a package version bump are low risk but may affect
downstream dependency resolution.
>
> **Overview**
> Moves Android session replay tile-hashing from a CMake/NDK-built JNI
library to **prebuilt native binaries**: removes the CMake build
configuration and deletes the C sources/JNI glue, relies on packaged
`libsession_replay_c.so` under `jniLibs/` for all ABIs, and updates
`TileHashNative` to load `session_replay_c`.
>
> Updates the .NET MAUI NuGet packaging by bumping
`LaunchDarkly.SessionReplay` to `0.5.2` and pinning additional AndroidX
Lifecycle dependencies (`LiveData`, `ViewModelSavedState`, and aligned
`LiveData.Core`) to reduce consumer version-conflict warnings.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
b5239b4. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 47c4640 commit 9045142
15 files changed
Lines changed: 8 additions & 380 deletions
File tree
- sdk/@launchdarkly
- mobile-dotnet/observability
- observability-android/lib
- src/main
- cpp
- jniLibs
- arm64-v8a
- armeabi-v7a
- x86_64
- x86
- kotlin/com/launchdarkly/observability/replay/capture
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| |||
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
| 38 | + | |
38 | 39 | | |
| 40 | + | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
| |||
Lines changed: 0 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | 95 | | |
102 | 96 | | |
103 | 97 | | |
| |||
Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 0 additions & 185 deletions
This file was deleted.
Lines changed: 0 additions & 48 deletions
This file was deleted.
0 commit comments