# Rebuilding and replacing native media libraries

This document applies only to components covered by an LGPL licence. It does
not grant rights in Mango Player's proprietary code, third-party content or
marks. The exact component set and hashes are in `component-manifest.json`.

## Android mobile

The Google Play 0.7.19 build loads FFmpegKit shared libraries and the
`media_kit` `libmpv.so` backend as separate native libraries. It does not
contain libVLC or Jellyfin. To test compatible modified libraries:

1. Download the source archives listed for the released Mango version. Check
   the public closure status before treating that set as complete corresponding
   source.
2. Rebuild the `default` media-kit Android flavor with `-Dgpl=false`,
   `--disable-gpl`, `--disable-nonfree` and `--enable-version3`, or rebuild
   FFmpegKit's non-GPL `full` flavor around FFmpeg n8.1.2.
3. Unpack an APK, replace the relevant `lib/<abi>/*.so` files while preserving
   their names and public ABI, then repack the application.
4. Repack, zip-align and sign the APK with your own Android signing key.
5. Install it as a separate test build. Android will not accept it as an
   in-place update of a package signed by another key.

Mango does not add a native-library hash check or anti-tamper mechanism. Store
variants must not contain Jellyfin `libffmpegJNI.so`; mobile Google Play must
also remain free of libVLC. The exact media-kit build scripts and inputs are
mirrored in the release dossier. FFmpegKit's exact wrapper/native pins and the
reference upstream v6.0 build system are mirrored too, but the supplier has
not published the exact modified third-party build scripts used for its full
dependency payload. That limitation is explicit and remains a legal-review
gate rather than being presented as a reproducible recipe.

## iPhone and iPad

The media-kit payload is an embedded `Mpv.xcframework` dynamic framework.
Rebuild the `ios-universal-video-default` flavor from the v0.6.0 source pack,
replace the matching framework in an Xcode archive, then re-sign the modified
application and framework with an Apple development identity you control.
Installation and execution remain subject to Apple's platform signing rules.
Mango does not supply Apple private keys and does not impose an additional
technical restriction on replacement of the LGPL framework.

This is the relink mechanism audited technically. Whether a particular App
Store distribution method satisfies every LGPL requirement is a legal-review
gate and is not certified by this document.

## Windows

`libmpv-2.dll` is a separate DLL next to `mango_player.exe`. Rebuild a
compatible libmpv DLL from the corresponding source and replace that file in a
copy of the installed application. Preserve its filename and exported libmpv
ABI. The current application does not verify the DLL hash.

The historical Windows payload's flags prove an LGPL variant, but its complete
static dependency closure and exact custom build command are not yet archived.
Therefore no Windows Store candidate is cleared by this document until a new,
reproducible DLL is produced or that closure is recovered.

## Android TV

Direct-download builds may contain the GPL Jellyfin decoder in addition to
libVLC. Google Play and Amazon builds must use the dedicated Store flavor,
which excludes Jellyfin but retains VideoLAN's LGPL libVLC fallback. To test a
modified libVLC, rebuild the pinned `vlc-android` + `libvlcjni` + VLC source
set, replace the AAR payloads in an unpacked APK, then repack and sign it with
a key controlled by the modifier. Mango performs no libVLC payload hash check.

## Support

Questions about the source pack or replacement procedure can be sent to
`legal@mangoplayer.app`. This technical guide is not legal advice.
