Take odrcore from maven central instead of building it with conan - #558
Merged
Conversation
The app depended on the odrcore conan package for both halves of the JNI bindings: conan cross built libodr_jni.so per ABI, and a custom deployer dropped it into jniLibs alongside the odr-core-java.jar it pulled out of the same package. That is now one ordinary maven dependency, app.opendocument:odr-core-android, which ships the java classes and a libodr_jni.so for all four ABIs in one AAR - so the two halves still cannot drift, without an NDK, python or conan anywhere in the build. It resolves from maven central rather than github packages, which asks for authentication even for a public artifact and would lock out f-droid and any other clean source builder. The runtime asset extraction goes too. odrcore 6.2 writes the renderer's css and js into the html it produces and answers mimetype with its own detection rather than libmagic, so setOdrCoreDataPath and setLibmagicDatabasePath are both inert - initializeCore only sets TMPDIR now, and the 8.1 MB magic.mgc leaves the apk with them. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lqc6gWzBBnoqvdaQ9HPoEa
andiwand
marked this pull request as ready for review
August 2, 2026 12:20
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 394cbba8e0
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the conan build of odrcore with the
app.opendocument:odr-core-androidAAR that OpenDocument.core now publishes.What goes away
The app pulled both halves of the JNI bindings out of the odrcore conan package — conan cross built
libodr_jni.sofor four ABIs, andconandeployer.pydropped them intojniLibsnext to theodr-core-java.jarit extracted from the same package. All of it is replaced by one line in the version catalog.That takes the NDK, python and conan out of the build entirely.
./gradlew assembleProDebugnow needs a JDK and the android SDK, nothing else, and CI loses ~80 lines of NDK install / conan cache / submodule export per workflow. Theconan-odr-indexsubmodule goes with it.Both halves still ship in one artifact, so they cannot drift — that was the original reason for sourcing them from one conan package, and it survives intact. It resolves from maven central, not github packages: the latter demands authentication even for a public artifact, which f-droid and other clean source builders cannot supply.
Runtime assets
CoreLoader.initializeCoreused to unpackassets/coreintofilesDirand point the core at it. odrcore 6.2 ended the need: the renderer's css and js are written into the html it produces, andOdr.mimetypeis core's own detection rather than libmagic.setOdrCoreDataPathandsetLibmagicDatabasePathare both inert now, so the extraction only cost startup time and apk size.initializeCoresetsTMPDIRand nothing more, and the 8.1 MBmagic.mgcleaves the apk.Verified
Built against a local
publishToMavenLocalcopy of the AAR, assembled from the CI native artifacts of coremain:assembleDebug,testProDebugUnitTest,lintProDebug,lintLiteDebug,spotlessCheck— all green from cleanlib/{arm64-v8a,armeabi-v7a,x86,x86_64}/libodr_jni.sopluslibc++_shared.soassets/holds only RawLoader's own html and font; noassets/coreBlocked on
app.opendocument:odr-core-android:6.2.0does not exist on maven central yet — hence draft. Coremainhas published nothing since v6.1.0, and the libmagic/asset removals this depends on are unreleased. The pinnedodrCore = "6.2.0"ingradle/libs.versions.tomlis a guess at the next release number and needs correcting if it lands as something else. CI here will fail to resolve the dependency until then.Worth a look
ndk.debugSymbolLevel = "full"is still set for release builds, but the.sofiles in the AAR are stripped upstream bybuild_native.py. Play will no longer receive useful native symbols for odrcore crashes. Fixing that means shipping unstripped libraries from core, so it is deliberately left alone here.🤖 Generated with Claude Code