Commit Graph
4 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 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 126e2cd233 Init mpv-joc 2026-10-18 21:31:38 +08:00