Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The publication script needs reliable release immutability under concurrent uploads and correct handling of staging paths containing spaces.
2 open issues
What changed in this PR
This PR isolates the forked JPEG 2000 codec from other Android decoder dependencies by renaming its Java package and native library while retaining OpenJPEG 2.5.4.
Changes:
- Renames the codec to
com.incode.jp2andlibincode-openjpeg.so, restricts native exports, and preserves 16 KB alignment. - Adds coexistence tests and staged-AAR testing.
- Adds Maven staging, explicit publication scripts, and GitHub Actions build artifacts.
| File | Description |
|---|---|
testapp/src/main/java/com/incode/jp2/test/MainActivity.java |
Updates the package and decoder import. |
testapp/src/androidTest/java/com/incode/jp2/test/TestDecoderCoexistence.java |
Tests decoder coexistence and truncated input. |
testapp/build.gradle |
Adds the second decoder and staged-artifact testing. |
scripts/uploadStagedRepo.sh |
Uploads staged Maven files with conflict checks and metadata merging. |
scripts/mavenRepoCredentials.sh |
Reads credentials and supplies curl authentication. |
README.md |
Documents build, publication, and validation procedures. |
library/src/main/java/com/incode/jp2/JP2Encoder.java |
Renames the package and native library load. |
library/src/main/java/com/incode/jp2/JP2Decoder.java |
Renames the package and native library load. |
library/src/main/cpp/openjpg.cpp |
Renames JNI entry points. |
library/src/androidTest/java/com/incode/jp2/Util.java |
Migrates the test utility package. |
library/src/androidTest/java/com/incode/jp2/TestJp2Encoder.java |
Migrates encoder tests to the new package. |
library/src/androidTest/java/com/incode/jp2/TestJp2Decoder.java |
Migrates decoder tests to the new package. |
library/exports.map |
Restricts exports to JNI entry points. |
library/consumer-rules.pro |
Preserves native method names during obfuscation. |
library/CMakeLists.txt |
Renames the native target and applies export isolation. |
library/build.gradle |
Configures fork coordinates, build settings, and Maven staging. |
gradle/wrapper/gradle-wrapper.properties |
Selects Gradle 8.14.5. |
build.gradle |
Selects Android Gradle Plugin 8.9.1. |
.github/workflows/build-aar.yml |
Builds, lints, stages, and uploads artifacts. |
Review effort: Balanced
| upload() { | ||
| local file="$1" | ||
| local path="${file#"$repo_dir"/}" | ||
| if ! auth_curl --fail --silent --show-error --retry 3 --upload-file "$file" "$repo_url/$path" > /dev/null; then |
Comment on lines
+216
to
+219
| download_metadata "$artifact_path" "$remote_metadata" | ||
| missing=$(missing_versions "$remote_metadata" "${versions[@]}") | ||
| rm -f "$remote_metadata" | ||
| [ -z "$missing" ] && break |
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.


The decoder uses
libopenjpeg.soandcom.gemalto.jp2, which can conflict with another JPEG 2000 dependency in the same app.This fork of Thales JP2ForAndroid 1.1.0 retains OpenJPEG 2.5.4 and publishes
com.incode.sdk:jp2-android:1.1.0-incode.1.It renames the Java package to
com.incode.jp2and the native library tolibincode-openjpeg.so.The native export map exposes only JNI entry points.
The build retains all four ABIs and 16 KB alignment.
GitHub Actions builds, lints, and uploads the AAR and staged Maven files as workflow artifacts.
Maven publication remains a separate, explicit script operation.
Test: Release build and lint passed locally and in GitHub Actions.
All 26 upstream native tests passed on ARM emulators with 4 KB and 16 KB pages.
Two coexistence tests passed with the original decoder, including both load orders and the staged AAR.
ELF checks passed for all four ABIs: 16 KB LOAD alignment, renamed SONAME, and isolated exports.
Manual check: In an SDK consumer app, read a passport with a JPEG 2000 portrait in debug and protected release builds.
Repeat with another dependency that supplies
libopenjpeg.so, without native-library packaging workarounds.The portrait must display without a crash or decoding error.
Notes for review: The library requires compileSdk 36 and retains minSdk 16.
Cloud-built artifacts do not replace the version already published from the validated local build.
The uploader now preserves staging paths with spaces; a local HTTP test covers publication, metadata, retries, and conflict rejection.
The upload conflict checks are not an atomic lock.
Concurrent publication still needs server-side no-redeploy protection or a shared publisher lock; that review finding remains open.
Acceptance criteria:
Review effort estimate: ~1.5-2 hrs (M). This is a heuristic estimate that includes native packaging, publication, and device checks.
Context for AI agents
The published AAR SHA-256 is
c6905c951f71e173a2e501d92ef405258a00e0c42c8890b0802de4f5d38e2cae.The source implementation commit is
1f38c8a; later commits add publication scripts and CI.The coexistence fixture uses
dev.keiji.jp2:jp2-android:1.0.5only in the test app.The version script hides OpenJPEG implementation symbols to avoid interposition across separately loaded libraries.
Physical passport and protected SDK runtime checks remain pending.