fix: 16KB page size support for Google Play (#119) - #120
Open
pishguy wants to merge 1 commit into
Open
Conversation
- 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
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.
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 (
.sofiles) to have ELF LOAD segments aligned to 16KB boundaries (p_align >= 0x4000). The existinglibgojni.so(xray-core) andlibtun2socks.sowere compiled with 4KB alignment (0x1000), causing Play Store rejection.Changes
Native Libraries
libgojni.sofrom xray-corev25.12.8with 16KB ELF page alignmentarm64-v8a: 29MB →align=0x4000(16KB) ✅armeabi-v7a: 28MB →align=0x4000(16KB) ✅x86_64: 31MB →align=0x4000(16KB) ✅x86: 28MB →align=0x4000(16KB) ✅libv2ray.aarwith updatedlibgojni.sofor all architecturesBuild Configuration
android/build.gradleandroid/build.gradleandroid/build.gradleuseLegacyPackagingfalsegradle-wrapper.propertiesAndroidManifest.xmlextractNativeLibsfalseXray-core Upgrade
v25.3.6tov25.12.8GOOS=android GOARCH=arm64in 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=YESBuild Scripts
Build scripts are included in
build/directory for reproducibility:build/build_xray.sh— Rebuildslibgojni.sofrom xray-core sourcebuild/build_tun2socks.sh— Rebuildslibtun2socks.sofrom 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.Related Issue
Closes #119