# Rebuilding and replacing Android native media libraries

This document applies to Mango Player Android Google Play `0.7.19+52` and only
to components governed by an LGPL licence. It does not grant rights in Mango
Player's proprietary code, content or marks. Exact versions and hashes are in
`component-manifest.json` and `source-index.json`.

## Payload boundary

The Play build contains FFmpegKit shared libraries and the media-kit default
`libmpv.so` stack. It does not contain libVLC, Jellyfin, `libffmpegJNI.so` or
`libpostproc.so`. Downloads remain part of the application and do not change
this native-library boundary.

## media-kit / libmpv

1. Verify every media-kit archive in `source-index.json` before extracting it.
2. Use the pinned `libmpv-android-video-build` commit and its `default` flavor.
   The recorded configuration uses `mpv:-Dgpl=false`,
   `ffmpeg:--disable-gpl`, `ffmpeg:--disable-nonfree` and
   `ffmpeg:--enable-version3`.
3. Build the ABIs you need with the Android SDK/NDK versions recorded by that
   source tree.
4. Unpack an APK, replace `lib/<abi>/libmpv.so` and the matching
   `libmedia_kit_native_event_loop.so`, preserving filenames and public ABI.
5. Repack, zip-align and sign the APK with a key you control. Android will not
   accept it as an in-place update of Mango's differently signed package.

## FFmpegKit

The exact Flutter wrapper commit, Android native commit, Maven Java sources,
FFmpeg n8.1.2 source and binary hashes are mirrored. The AAR uses the non-GPL
`full` variant with `--enable-version3`, without `--enable-gpl` or
`--enable-nonfree`.

The archive named `arthenica-ffmpeg-kit-v6.0.tar.gz` is a reference upstream
build system. It is not represented as the exact supplier-modified build
recipe. The supplier publishes prebuilts and bindings but not the exact
modified third-party scripts used for every dependency in the AAR. Therefore
this document cannot honestly give a fully reproducible supplier command; that
missing closure remains an independent legal gate.

A compatible independently rebuilt FFmpegKit set can be substituted by
replacing all matching FFmpegKit `lib/<abi>/*.so` libraries in an unpacked APK,
then repacking, zip-aligning and signing with a key controlled by the modifier.
Mango adds no native-library hash check or anti-tamper mechanism.

## Rights and support

Mango terms do not restrict reverse engineering performed solely to debug
modifications to a covered LGPL library. Questions about this evidence pack
can be sent to `legal@mangoplayer.app`. This is technical evidence, not legal
advice or a declaration that public Store distribution is cleared.
