BitComet Android FFmpeg relinking kit, build-1
FFmpeg commit b4a62c32549b8295691a8e0ff2c9b82188923159
Media3 commit 8c6678b657ede1e7883fc164ef73ed483c7796c3
NDK 28.1.13356709, API 24, arm64-v8a and x86_64.

This kit contains the original non-FFmpeg JNI object for each ABI,
the corresponding FFmpeg static libraries, wrapper source, license texts,
the original AAR, and portable build/relink instructions.
Download ffmpeg-source.tar.xz separately from the source-version directory.
The version directory's SHA256SUMS covers the source archive and each build ZIP.
Before extraction, compare their SHA-256 values using Get-FileHash -Algorithm SHA256.
Paths in manifest.json refer to files inside this ZIP, relative to its root.
Retain all per-file copyright and license notices.
App version 3.1.0 uses this component build; future identical builds may reuse it.

1. Unpack ffmpeg-source.tar.xz. Make your changes in the FFmpeg source.
2. Install MSYS2 make, diffutils, coreutils and a host C compiler,
   plus Android NDK 28.1.13356709. In MSYS2 use:
   pacman -S --needed make diffutils coreutils mingw-w64-x86_64-gcc
   In MSYS2 Bash, run (adjust only your input paths):
   bash build-ffmpeg.sh /c/work/ffmpeg /c/Android/ndk/28.1.13356709 /c/work/rebuilt
3. In PowerShell, relink against your rebuilt libraries:
   powershell -ExecutionPolicy Bypass -File relink.ps1 -NdkPath C:\Android\ndk\28.1.13356709 -LibrariesPath C:\work\rebuilt\android-libs
   For the supplied original libraries, omit -LibrariesPath.
4. Replace jni/<abi>/libffmpegJNI.so in the supplied AAR with output/<abi>/libffmpegJNI.so.
   The Media3 Java interface and FFmpeg ABI must remain compatible.
5. To replace the libraries in an APK and sign with your own key, run:
   powershell -ExecutionPolicy Bypass -File replace-apk-library.ps1 -ApkPath C:\work\original.apk -LibrariesPath C:\work\output -BuildToolsPath C:\Android\build-tools\36.0.0 -KeyStorePath C:\work\user.keystore -KeyAlias user -OutputPath C:\work\modified.apk
   The script uses Android SDK zipalign and apksigner, prompts for the
   signing password, and verifies the resulting signature. It preserves
   the APK's existing ABI set and does not overwrite an existing output.
   For automation, -PasswordEnvironmentVariable NAME reads the keystore
   password from that environment variable instead of prompting.
   Use adb install --no-incremental -r on a disposable emulator; stop the
   app before updating and allow startup to complete before sending input.
   Production release APKs
   contain arm64-v8a only. Do not add a different ABI without all app libraries.
   A different signing key prevents an update over the official installation.
   Test with a separate disposable emulator and preserve any user data.
   The official private signing key is not required or provided.
   Verify the signature with apksigner verify, then check logcat for the
   Media3 audio decoder initialized message while playing an AC-3/E-AC-3 file.

6. Run powershell -ExecutionPolicy Bypass -File verify-materials.ps1
   after extraction to verify component files against manifest.json.
   This check does not require the external SHA256SUMS file.

APK replacement/installation and the modified-library playback workflow
must be independently validated before release. This kit does not itself
claim that all distribution and license conditions have been approved.
LGPL permits modification for the user's own use and reverse engineering
for debugging those modifications. Third-party licenses take precedence
over conflicting general distribution terms.
