LunarSnip 1.0 - FFmpeg 9.0.2 corresponding source and replacement ================================================================= Scope ----- This publication matches the native library hashes in release-manifest.json. FFmpeg is LGPL 2.1 or later. zimg 3.0.6 and dav1d 1.5.3 are permissive dependencies; NASM 2.16.03 is a build tool. Full notices accompany this package. Editor and independently authored Java/JNI bridge sources are not included. The FFmpeg sources are unmodified upstream sources; no application patches are needed to build the libraries. Prerequisites ------------- Use Linux x86_64, Python 3.12+ with venv/pip, a C/C++ host toolchain, make, autoconf, automake, libtool and pkg-config. Install Android SDK command-line tools, NDK 28.2.13676358, and Android build-tools providing zipalign/apksigner with 16 KB alignment support (for example build-tools 36.0.0). The Python build tools are pinned to Meson 1.9.1 and Ninja 1.13.0. Install these into the build script's private venv, not a global Python. Set ANDROID_HOME to YOUR Android SDK directory. SDK, compiler and output paths in the published build-info files use ${ANDROID_HOME} and ${SOURCE_ROOT} placeholders; the build script resolves your actual paths. Network access is needed for SDK installation and the pinned Python packages. The source archive already contains the required upstream source downloads. Verify and extract ------------------ Download corresponding-source.tar.gz and SHA256SUMS from this page. The SHA256SUMS file also covers the other public files; download those too before running a check over every entry, or verify just the source entry: grep ' corresponding-source.tar.gz$' SHA256SUMS | sha256sum -c - mkdir source-work tar -xzf corresponding-source.tar.gz -C source-work cd source-work python3 scripts/build-native-hdr.py --dependencies-only --jobs 2 Both arm64-v8a and x86_64 are built by default. To build just one: python3 scripts/build-native-hdr.py --dependencies-only --abis x86_64 --jobs 2 Outputs: app/build/generated/native-hdr/jniLibs//libavcodec.so app/build/generated/native-hdr/jniLibs//libavfilter.so app/build/generated/native-hdr/jniLibs//libavformat.so app/build/generated/native-hdr/jniLibs//libavutil.so app/build/generated/native-hdr/jniLibs//libswresample.so app/build/generated/native-hdr/jniLibs//libswscale.so The build also supplies the compatible NDK libc++_shared.so runtime. The replacement helper below preserves the original APK's runtime and bridge; use the pinned NDK and preserve their compatibility. No first-party bridge source is needed. The output build-info.json is metadata, not an APK library. Modifying FFmpeg ---------------- After the first build has extracted the sources, edit files under: build/native-hdr/sources/ffmpeg-9.0.2/ In this isolated working directory, remove the dependencies.sha256 cache marker for each ABI you want to rebuild, then repeat the build: rm build/native-hdr/x86_64/dependencies.sha256 python3 scripts/build-native-hdr.py --dependencies-only --abis x86_64 --jobs 2 For arm64, use arm64-v8a in both places. Keep the public interfaces and shared-library names compatible with the app. A random newer FFmpeg major version is not necessarily compatible. If you distribute modified binaries, provide the matching modifications/source and build configuration and comply with the applicable licenses. Do not accidentally enable GPL/nonfree components if you intend to preserve this package's licensing arrangement. Create an APK with replacement libraries --------------------------------------- Obtain an installable APK of the application matching this native build. The publication intentionally does NOT include an unsigned development APK or any signing key. A Play .aab file is not itself an installable APK. The application distributor must arrange a usable APK delivery path. From the publication download directory, run (use your own paths): python3 replace-apk-libraries.py \ --apk official.apk \ --libraries source-work/app/build/generated/native-hdr/jniLibs \ --abi x86_64 \ --output modified-unsigned.apk Repeat --abi to replace both architectures. The helper replaces all six FFmpeg libraries for the selected ABI(s), leaves the DEX, resources, first-party bridge and other libraries intact, and discards old APK signature metadata. It does not establish API compatibility or sign the result. Align and sign using Android build-tools and YOUR key: "$ANDROID_HOME/build-tools/36.0.0/zipalign" -f -P 16 4 \ modified-unsigned.apk modified-aligned.apk keytool -genkeypair -keystore my-test-key.jks -alias test \ -keyalg RSA -keysize 2048 -validity 3650 "$ANDROID_HOME/build-tools/36.0.0/apksigner" sign \ --ks my-test-key.jks --out modified-signed.apk modified-aligned.apk "$ANDROID_HOME/build-tools/36.0.0/apksigner" verify --verbose modified-signed.apk "$ANDROID_HOME/build-tools/36.0.0/zipalign" -c -P 16 4 modified-signed.apk keytool/apksigner prompt for key details/passwords. Keep your private key private. Do not use or request the distributor's production signing key. Install and test ---------------- Use a separate emulator or test device with a supported 64-bit Android ABI: adb -s YOUR_TEST_DEVICE install modified-signed.apk adb -s YOUR_TEST_DEVICE shell am start -W \ -n app.lunarsnip/.MainActivity Do NOT uninstall the official app or clear its data to bypass a signing mismatch. A differently signed build cannot update it in place. Confirm the application opens, then test the explicitly confirmed CPU HDR fallback with suitable HDR media, cancellation, and actual rendered SDR output. Device/format compatibility is not guaranteed. Rights and limitations ---------------------- LGPL-covered source and modifications remain subject to their licenses. Modification for your own use and reverse engineering for debugging such modifications are permitted as required by LGPL 2.1 section 6. The separate editor and first-party bridge are not designated LGPL by this publication. These downloads do not complete store/legal/patent review or runtime validation for every device. The ARM64 libraries were build/link checked; this publication does not claim ARM64 runtime testing.