# Using a modified libdivecomputer with Scubbl

This document describes the practical replacement/relinking path for the LGPL-2.1 `libdivecomputer` component distributed with Scubbl. It does not grant rights to Scubbl-owned proprietary source code beyond rights required by applicable law or the LGPL component's license.

Current libdivecomputer commit used by Scubbl:

`fe26d46ee0e695d3ba1753b84944d6b6e0d407f2`

## General requirements

A replacement libdivecomputer must remain interface-compatible with the version expected by the Scubbl native bridge. Start from the exact corresponding source and build materials published in this directory.

Make your changes to libdivecomputer, preserve the LGPL notices applicable to the modified library, and build a replacement runtime binary/framework using the documented build inputs.

## Android

Scubbl packages libdivecomputer as a separate `libdivecomputer.so` for each Android ABI. The proprietary `libscubbl_divecomputer.so` links against that shared library at runtime.

For personal testing of a modified library:

1. Build an interface-compatible replacement `libdivecomputer.so` for the same ABI.
2. Work from an APK/package that you are legally entitled to modify for your own use.
3. Replace the packaged `libdivecomputer.so` for the relevant ABI without modifying the Scubbl bridge binary.
4. Repackage the application.
5. Sign the resulting Android package with a signing key you control.
6. Install that user-signed build on a device you control, subject to Android platform requirements.

A package signed with a different key is not an official Scubbl release and generally cannot update an installed store build signed by Scubbl.

## iOS

Scubbl packages libdivecomputer as a separate dynamic `LibDiveComputer.framework` with install name:

`@rpath/LibDiveComputer.framework/LibDiveComputer`

For personal testing of a modified library:

1. Build an interface-compatible replacement `LibDiveComputer.xcframework` / device `LibDiveComputer.framework` from the published corresponding source and build script.
2. Work from an application bundle/build that you are legally entitled to modify for your own use.
3. Replace the embedded `LibDiveComputer.framework` while preserving the expected framework name and compatible exported interface.
4. Re-sign the application bundle and embedded framework using an Apple development/distribution identity and provisioning setup you control and are entitled to use.
5. Install the resulting user-signed application on a device permitted by that Apple signing/provisioning setup.

Apple code-signing, provisioning, device installation and App Store rules are platform requirements separate from the rights granted by LGPL-2.1. A modified/re-signed build is not an official Scubbl build and is not represented as eligible for App Store redistribution.

## Scubbl proprietary boundary

The Scubbl React Native application, UI, business logic, Bluetooth/session orchestration, persistence, backend code and native Scubbl bridge remain proprietary. This document exists to preserve the rights applicable to the separately linked LGPL component.
