Fix Quest launch crashes, version the APK like the tarball, and support native builds in Android Studio
build / build (push) Successful in 2m13s

- patchelf gl4es's embedded SONAME to libGL.so so AGP's jniLibs packaging
  (which drops any file not literally named "*.so") and the dynamic
  linker's NEEDED-entry resolution (by embedded SONAME, not filename)
  finally agree - fixes the "library \"libGL.so.1\" not found" crash seen
  on real Quest hardware.
- QuestShockActivity now checks that res/data and res/sound exist before
  starting the native engine, showing an explanatory dialog instead of
  crashing on init_popups' unchecked NULL resource load when a fresh
  install has no game data copied in yet.
- dist/questshock-<version>-android-arm64.apk is now versioned from the
  same git-tag-or-dev-placeholder scheme as the desktop tarball
  (build-image/version.sh, shared by both via the Makefile and
  build-apk.sh).
- build-image/prepare-android-project.sh (prep logic extracted out of
  build-apk.sh) can now stage android/ for a native build directly in
  Android Studio (--host-paths), exporting the prebuilt SDL2/SDL2_mixer/
  fluidsynth-lite/gl4es libraries and writing host-resolvable paths,
  instead of only ever building inside the Docker image.
- Corrected GET_ASSETS.txt/GET_ASSETS_QUEST.txt, which wrongly described
  merging res/pc/hd and res/pc/cdrom trees out of the raw installer's
  sshock.kpf - an already-installed copy's res/data res/sound can just
  be copied directly, with extract_assets.sh only needed from the raw
  installer.
This commit is contained in:
ml
2026-07-23 06:42:45 +02:00
parent 3da137da09
commit ac640762d7
14 changed files with 304 additions and 100 deletions
+43 -7
View File
@@ -24,7 +24,7 @@ a cross-platform port of the original game.
game, out of the compiled engine and the extracted assets. Also builds
`dist/shockolate-<version>-linux-<arch>.tar.gz`, a redistributable
package that omits the proprietary game assets (`make package`), and
`dist/questshock-debug.apk` for the Quest (`make apk`).
`dist/questshock-<version>-android-arm64.apk` for the Quest (`make apk`).
- `android/` - the Quest app (Java `SDLActivity` glue, Gradle project).
`android/engine-patches/` holds the one small patch needed to build
`engine/` as an Android shared library instead of a desktop executable
@@ -64,6 +64,13 @@ game data lives inside it in a zip-format `sshock.kpf`) into
they aren't installed locally it falls back to running the extraction in
a throwaway Docker container instead.
If you already have the game installed instead (on Windows, or via
Wine/Proton on Linux), you don't need the installer or the script at
all - just copy its `res/data/` and `res/sound/` folders directly into
`res/assets/ss_ee/data/` and `res/assets/ss_ee/sound/`. That's exactly
the same layout `extract_assets.sh` produces, so `make dist`/`make
package`/`make apk` pick it up the same way either way.
## Packaging
`make package` builds `dist/shockolate-<version>-linux-<arch>.tar.gz`: the
@@ -71,7 +78,8 @@ compiled binary, its runtime libraries, shaders, a default MIDI
soundfont, license information, and `res/GET_ASSETS.txt` in place of the
actual game data (which the tarball never includes). Version comes from
the current git tag (push a `vX.Y.Z` tag to drive a release); without one
it builds an untagged `0.0.0-dev+<sha>` placeholder.
it builds an untagged `0.0.0-dev+<sha>` placeholder. `make apk` (below)
is versioned identically, via the same `build-image/version.sh`.
A Gitea Actions workflow (`.gitea/workflows/build.yml`) builds this
package on every push, using the build-image as its container (so no
@@ -80,11 +88,11 @@ resulting tarball to dl.ladkau.de.
## Playing on Meta Quest
`make apk` builds `dist/questshock-debug.apk` - a plain (non-VR) Android
app that runs as a flat, floating panel in the Quest's Home environment,
same as any other sideloaded Android app. It's not a head-tracked 6DoF VR
port (that's a much larger, separate undertaking); play with a Bluetooth
mouse/keyboard connected to the headset.
`make apk` builds `dist/questshock-<version>-android-arm64.apk` - a plain
(non-VR) Android app that runs as a flat, floating panel in the Quest's
Home environment, same as any other sideloaded Android app. It's not a
head-tracked 6DoF VR port (that's a much larger, separate undertaking);
play with a Bluetooth mouse/keyboard connected to the headset.
1. Install the APK with [SideQuest](https://sidequestvr.com/) (or `adb
install`).
@@ -99,6 +107,34 @@ mouse/keyboard connected to the headset.
`/sdcard/questshock/res/`.
4. Launch it again.
### Building natively in Android Studio
`make apk` always compiles the engine and links the APK inside the
Docker build-image - convenient for CI/CLI builds, but Android Studio
can't attach a debugger to (or get IDE code-intelligence for) a build
that happens inside a container it isn't running.
To have Android Studio compile and deploy `android/` itself instead:
```sh
./run-image.sh bash build-image/prepare-android-project.sh --host-paths
```
This stages everything `make apk` normally stages (a scratch, patched
copy of `engine/`; the Android SDL2/SDL2_mixer/fluidsynth-lite/gl4es
prebuilts; bundled assets) - the same as `build-apk.sh`'s own prep step -
except it writes `android/engine.properties` with paths that resolve on
your host filesystem, and additionally exports the prebuilt libraries
(otherwise only present inside the image, at `/opt/prebuilt/android`) to
`build/android-prebuilt/` so they're visible outside the container too.
Re-run it whenever `engine/`, `android/engine-patches/`, or the
prebuilt-library versions in `build-image/Dockerfile` change.
Then open `android/` as a project in Android Studio (JDK 17, NDK
`26.1.10909125`, and SDK Platform/Build-Tools 34 installed, matching
`build-image/Dockerfile` and `android/app/build.gradle`) and build/run
normally - no Docker involved for this part.
## License
The original tooling in this repository (the Docker build image, build