Skip to content

fix: 16KB page size support for Google Play (#119) - #120

Open
pishguy wants to merge 1 commit into
blueboy-tm:masterfrom
pishguy:master
Open

fix: 16KB page size support for Google Play (#119)#120
pishguy wants to merge 1 commit into
blueboy-tm:masterfrom
pishguy:master

Conversation

@pishguy

@pishguy pishguy commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds 16KB page size support required by Google Play for apps with native code. Google Play Console rejects apps that don't support 16KB ELF page alignment, which is now mandatory for all apps targeting Android 15+.

Problem

Google Play requires all native shared libraries (.so files) to have ELF LOAD segments aligned to 16KB boundaries (p_align >= 0x4000). The existing libgojni.so (xray-core) and libtun2socks.so were compiled with 4KB alignment (0x1000), causing Play Store rejection.

Changes

Native Libraries

  • Rebuilt libgojni.so from xray-core v25.12.8 with 16KB ELF page alignment
    • arm64-v8a: 29MB → align=0x4000 (16KB) ✅
    • armeabi-v7a: 28MB → align=0x4000 (16KB) ✅
    • x86_64: 31MB → align=0x4000 (16KB) ✅
    • x86: 28MB → align=0x4000 (16KB) ✅
  • Repacked libv2ray.aar with updated libgojni.so for all architectures

Build Configuration

File Change Before After
android/build.gradle AGP version 8.1.0 8.7.0
android/build.gradle compileSdkVersion 34 35
android/build.gradle useLegacyPackaging - false
gradle-wrapper.properties Gradle version 7.4 8.10.2
AndroidManifest.xml extractNativeLibs - false

Xray-core Upgrade

  • Upgraded from v25.3.6 to v25.12.8
  • Built with Go 1.25.5 and NDK 29.0.14206865
  • 16KB alignment is the default for GOOS=android GOARCH=arm64 in Go 1.23+

Verification

# ELF alignment check (arm64-v8a)
LOAD RX: align=0x4000 (16KB) 16KB=YES
LOAD RW: align=0x4000 (16KB) 16KB=YES
LOAD RW: align=0x4000 (16KB) 16KB=YES

Build Scripts

Build scripts are included in build/ directory for reproducibility:

  • build/build_xray.sh — Rebuilds libgojni.so from xray-core source
  • build/build_tun2socks.sh — Rebuilds libtun2socks.so from badvpn (requires CMake)

Notes

  • libtun2socks.so (badvpn) is a PIE executable renamed to .so, not a shared library. It was not rebuilt due to NDK 29 compatibility issues with badvpn's CMake config. If Google Play still rejects this file, a fork of badvpn with updated CMake support may be needed.
  • Tested build with Go 1.25.5 and Android NDK 29.0.14206865 on macOS (arm64).

Related Issue

Closes #119

- Upgrade AGP 8.1.0 → 8.7.0, Gradle 7.4 → 8.10.2, compileSdk 34 → 35
- Add extractNativeLibs=false, useLegacyPackaging=false
- Rebuild libgojni.so with xray-core v25.12.8 (16KB ELF alignment)
- Repack libv2ray.aar with updated native libraries
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.

16KB Page Size Support Required for Google Play

1 participant