Skip to content

build: bump NDK to r28 for 16 KB page-size compliance (conflict resolution) - #217

Merged
ErikBjare merged 2 commits into
ActivityWatch:masterfrom
TimeToBuildBob:build/ndk-r28-16kb-pages
Aug 8, 2026
Merged

build: bump NDK to r28 for 16 KB page-size compliance (conflict resolution)#217
ErikBjare merged 2 commits into
ActivityWatch:masterfrom
TimeToBuildBob:build/ndk-r28-16kb-pages

Conversation

@TimeToBuildBob

Copy link
Copy Markdown
Contributor

Conflict resolution from #213 — rebased onto current master.

This PR resolves the merge conflict that blocked #213. The changes are identical to #213 (bump NDK r25→r28, add ELF alignment check in scripts/check-jnilibs.py); only the rebase onto the updated master head was needed to clear the conflict.

Closes #213 — Erik can review and merge this instead of the conflicting original.


Why a separate PR: TimeToBuildBob doesn't have write access to ActivityWatch/aw-android branches, so the conflict-resolved head was pushed to the fork and opened as a new PR rather than force-pushing the original branch.

Google Play rejects app updates without 16 KB page-size support since
Nov 2025. The aw-server-rust native libs were built with NDK r25, which
links LOAD segments 4 KB-aligned (verified: 0x1000). NDK r28+ links
with -z max-page-size=16384 by default for all Android targets.

Also extends scripts/check-jnilibs.py to fail CI when 64-bit libs have
LOAD alignment below 0x4000, so an NDK downgrade can't silently regress
compliance (mirrors Google's check_elf_alignment semantics: every LOAD
segment must be >=16 KB aligned).
… reads

Review findings: the gate only checked the hardcoded libaw_server.so
while the Makefile also packages libaw_sync.so; and a truncated ELF
declaring program headers past EOF crashed struct.unpack instead of
reporting a diagnostic. Require both known libs, validate any other
packaged *.so, and bounds-check phdr offsets/reads.
@greptile-apps

greptile-apps Bot commented Aug 8, 2026

Copy link
Copy Markdown

Greptile Summary

The PR upgrades both CI and Gradle to Android NDK r28 and strengthens native-library validation for 16 KB page-size compliance.

  • Pins NDK 28.2.13676358 in the workflow and Android module.
  • Requires both Rust JNI libraries for every supported ABI.
  • Parses ELF program headers and verifies 16 KB PT_LOAD alignment for 64-bit libraries.
  • Extends validation to any additional packaged shared libraries.

Confidence Score: 5/5

The PR appears safe to merge; no concrete build, packaging, or runtime defect was identified.

The NDK pins are consistent across CI and Gradle, the newly required JNI libraries match the Makefile’s four-ABI output contract, and the ELF parser uses the expected Android ELF layouts and alignment criterion.

Important Files Changed

Filename Overview
.github/workflows/build.yml Pins CI native builds to NDK 28.2.13676358 while retaining the NDK version in JNI cache keys.
mobile/build.gradle Aligns Gradle’s requested NDK version with the CI toolchain.
scripts/check-jnilibs.py Expands required-library checks and validates ELF program-header alignment for 64-bit Android ABIs.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    CI[CI build] --> NDK[Install NDK r28]
    NDK --> Rust[Build Rust JNI libraries]
    Rust --> JNI[Package JNI libraries for four ABIs]
    JNI --> Check[Run check-jnilibs.py]
    Check --> ELF[Validate ELF structure]
    ELF --> Align{64-bit PT_LOAD alignment >= 16 KB?}
    Align -->|Yes| Artifact[Upload and package JNI artifacts]
    Align -->|No| Fail[Fail build]
Loading

Reviews (1): Last reviewed commit: "fix(check-jnilibs): also validate libaw_..." | Re-trigger Greptile

@ErikBjare
ErikBjare merged commit 53a2fb6 into ActivityWatch:master Aug 8, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants