Commit Graph
6 Commits
Author SHA1 Message Date
TheM14 5ddbd6154b Build the JNI bridge for the Android app
The app's MPVLib loads libplayer.so before libmpv, and mpv-android builds
that bridge with ndk-build over app/src/main/jni, installing it and the
prebuilt ffmpeg/mpv objects into app/src/main/libs/<abi>. The workflow
only built the mpv target and then ran Gradle, so the APK shipped
without libplayer.so and every playback died with UnsatisfiedLinkError.

Run ndk-build the way buildscripts/scripts/mpv-android.sh does, and write
ndk.properties, which the Gradle build needs to find the NDK for symbol
stripping (the previous APK carried 134 MB of unstripped libraries).
2026-10-31 03:52:57 +08:00
TheM14 8673a3b762 Package the ffmpeg shared libraries the Android build links against
The Android libmpv.so has DT_NEEDED entries for libavcodec, libavfilter,
libavformat, libavutil, libswresample, libswscale and libavdevice, but
the app only carried libmpv.so, libjoc_core.so and libc++_shared.so, so
the linker rejected libmpv at dlopen time and the player crashed on
every file.

Copy every shared object from the cross-build prefix into the app's
libs/<abi> directory, and into the standalone library artifact too,
instead of naming the three files.
2026-10-31 03:33:27 +08:00
TheM14 8ed49a1170 Locate the Android SDK and the library directory the way the build
system lays them out

download-sdk.sh unpacks the SDK as buildscripts/sdk/android-sdk-linux,
and mpv-android keeps the libraries in app/src/main/libs with jniLibs
pointing at it. Check those names first, fall back to a platforms/
search, and write the libraries into libs/<abi> while recreating the
alias.
2026-10-31 03:05:03 +08:00
TheM14 68fc020260 Replace the dangling jniLibs link before copying the libraries
mpv-android ships app/src/main/jniLibs as a symlink for the ABI its own
build wants, so mkdir -p fails with "File exists" when the link target
does not exist. Replace the link (or file) with a plain directory and
copy the three libraries into arm64-v8a/.
2026-10-31 02:55:20 +08:00
TheM14 c45808135d Package the Android build as an installable APK
The arm64 job stopped at the three shared libraries, so the only way to
use them was to build a player around them. Let the libraries go into
mpv-android's jniLibs and let Gradle assemble and sign the app instead.

- copy libmpv.so, libjoc_core.so and libc++_shared.so into
  app/src/main/jniLibs/arm64-v8a
- locate the SDK under buildscripts/sdk, accept its licences, and link
  the unpacked NDK where AGP looks for it
- run assembleRelease with a throwaway injected signing key, so the APK
  installs without repository secrets
- verify the signature when apksigner is available and upload the APK as
  mpv-joc-android-arm64-v8a-apk, keeping the bare libraries as before
- cache the Gradle home between runs
- document the artifact and how to pass the ad_joc options

Checked locally: the workflow parses and every shell block passes
bash -n; the Gradle build itself needs a CI run.
2026-10-31 02:47:40 +08:00
TheM14 9a9bb7b0c8 Add android test build file and fix windows build file 2026-10-18 21:59:32 +08:00