16 KB Page Size for VPN Apps: Check Xray and sing-box Cores
From 1 February 2027, Google Play will not let you release an update that does not support 16 KB memory page sizes. That is what Android’s 16 KB page size guide says as of 10 November 2026, for apps targeting Android 15 (API level 35) or higher on 64 bit devices. It reaches VPN apps because the tunnel is native code. A WireGuard, Xray, sing-box or OpenVPN build adds shared library files, and each file carries its own alignment, which you can check in minutes.
This guide is for VPN teams that ship native cores: a step by step audit with the tools Android names, a table of what to check per component, a 16 KB test plan and a CI release gate. Rebuilding Go cores is the one item we could not verify from Google or Go documentation, so it is marked unverified, with questions for the maintainers.
What Does Google Play Require for 16 KB Page Size Support?
The Android 16 KB page size guide states the rule. Apps targeting Android 15 (API level 35) or higher must support 16 KB page sizes on 64 bit devices on Google Play, and from 1 February 2027, if updates do not, you “won’t be able to release these updates.” The footer shows 4 November 2026 as the last update. The date has moved before, so here is what each page says today.
| Source | What it says about 16 KB | Date on the page |
|---|---|---|
| Android Developers Blog post | New apps and updates targeting Android 15 or higher need 16 KB support from 1 November 2025 | Posted 8 May 2025 |
| Android’s 16 KB page size guide | Updates cannot be released from 1 February 2027; no extension described | Updated 4 November 2026 |
| Android’s target API level page and the Play Console Help article on it | Neither mentions 16 KB | Android page 28 October 2026; Help page undated |
| A third party SDK vendor’s support article | Described a Play extension to 31 May 2026, a date now past | Not a Google page |
We cannot reconcile the first and last rows with the second from Google’s pages, so we do not try. The alt text of the guide’s Play Console figure describes a warning that names the same February date. Plan against the date in your own console, and read the guide again when you set your release calendar. Our Google Play target API level guide for VPN apps uses the same February date and tracks the other Play deadlines.
Which Parts of a VPN App Does the 16 KB Rule Reach?
Android says the rule affects apps with C or C++ code, anything built with the NDK, and apps that link third party native libraries or SDKs. Java and Kotlin only apps are not affected, though Google still recommends testing them in a 16 KB environment.
A VPN app usually falls in the first group. The tunnel is native, and Xray and sing-box are both Go engines (see our Xray vs sing-box comparison). Your own code can be pure Kotlin and the AAR you add still carries .so files, sometimes several: the WireGuard Android tunnel module’s build file we read lists libwg-go.so, libwg.so and libwg-quick.so.
Alignment belongs to each compiled file. Android says to fix any arm64-v8a or x86_64 library reported as unaligned, so audit both ABIs.
On the toolchain, the guide says NDK r28 and higher align by default, while r27 and lower need the linker flags -Wl,-z,max-page-size=16384 and -Wl,-z,common-page-size=16384. The changelogs add that r27 introduced switches for ndk-build and CMake and r28 made that option the default.
Which Component Needs Which Check?
Turn the inventory into owners and actions, using only tools Android’s guide names.
| Component | Where it comes from | What to check | Who fixes it |
|---|---|---|---|
| Your own JNI or NDK code | Your repository | LOAD alignment, RELRO, hard coded PAGE_SIZE, mmap() |
You: NDK r28 or higher |
| WireGuard backend | Upstream library or your wireguard-go build | Every .so, both ABIs, in the shipped version |
You, or upgrade the library |
| Xray or sing-box core (Go) | Wrapper library, client project or your gomobile build | Every .so per ABI, and the NDK version that built it |
Whoever runs the build; ask the maintainers |
| OpenVPN, strongSwan, other C or C++ | Upstream Android project or your NDK build | As your own code, plus bundled crypto libraries | Whoever runs the build |
| Rust, Zig or prebuilt vendor binaries | Vendor or maintainer | The compiled file; Android’s guide covers NDK flags only | Vendor; unverified until proven |
| Third party SDKs with native code | AAR dependencies | The merged APK, and the provider’s supported version | The provider |
| Cores unpacked or downloaded after install | Your update mechanism | APK tools cannot see them; test in a 16 KB environment | You, before you publish the file |
Keep it as a living inventory: one row per package name, core, version, ABI, builder, NDK version and measured LOAD alignment. With illustrative numbers, three white label package names that each bundle two cores in two ABIs make 12 files to verify on every release.
How Do You Audit Every Shared Library in the APK?
Run these on the release build, which is what Play receives. The commands come from Android’s guide unless marked as ours.
- List the libraries. In Android Studio, Build > Analyze APK shows the
libfolder, with an Alignment column that warns about misaligned files. From a shell, list every.soper ABI (our step). - Run Android’s script.
check_elf_alignment.shcomes from AOSP (system/extras/tools) and prints ALIGNED or UNALIGNED per library. If anyarm64-v8aorx86_64library is UNALIGNED, fix its packaging, recompile and retest. - Read the LOAD lines. Run
llvm-objdump -pon each.so(Build Tools 35.0.0 or higher plus the NDK). Every line should showalign 2**14or higher. A2**13,2**12or lower means the library needs fixing. - Check RELRO. Android’s guide says a library passes if any one of these is true: it has no GNU_RELRO segment, the segment’s end is 16 KB aligned, (VirtAddr + MemSiz) % 0x4000 == 0, or no writable data follows it in the same LOAD segment. A file that meets none of them can crash with a segmentation fault, typically when built with NDK r27 or lower. Check your own files with
llvm-readelf, and do not gate on the modulo test alone. - Check zip alignment.
zipalign -v -c -P 16 4should end with “Verification successful.” For a bundle,bundletool dump configshould showPAGE_ALIGNMENT_16K. - Check packaging. The guide recommends AGP 8.5.1 or higher with uncompressed shared libraries. With AGP 8.3 to 8.5 an app may appear to work but fail to install when built from a bundle in Play.
unzip -l app-release.apk | grep '\.so$'
./check_elf_alignment.sh app-release.apk
llvm-objdump -p libcore.so | grep LOAD
llvm-readelf -Wl libcore.so | grep 'LOAD\|RELRO\|Type'
zipalign -v -c -P 16 4 app-release.apk
bundletool dump config --bundle=app-release.aab | grep alignment
One caution matters for CI. In the version of the script we read on AOSP main on 10 November 2026, we found no non zero exit status tied to the count of unaligned libraries. Our reading: a pipeline step that checks only the exit code could pass a bad build. The same version reads only the first LOAD line of each file, which is one more reason to run step 3 yourself.
How Do You Test on a 16 KB Emulator or Device?
Alignment checks prove the layout, not that the tunnel runs. Android lists four 16 KB environments: an Emulator system image, Cuttlefish, a supported Pixel with the “Boot with 16KB page size” developer option, and Samsung Remote Test Lab. The emulator images are named “Google APIs Experimental 16 KB Page Size”. Confirm the environment first: adb shell getconf PAGE_SIZE must print 16384.
Then run a VPN pass. This list is our suggestion, not Google’s:
- Install and open the app. On a 16 KB device, a compatibility warning at first launch means something in the APK is still 4 KB aligned.
- Connect with each bundled core and send traffic for several minutes.
- Switch networks, kill the process and reconnect.
- Start the tunnel from every path you support: interface, boot, always on VPN.
- Repeat on
arm64-v8aandx86_64, and watch the log for native crashes.
Do not lean on compatibility mode. Android’s guide says the package manager may run an app in backcompat mode if its .so files have 4 KB LOAD alignment, with a warning at first launch, and adds that apps should still be 16 KB aligned. The pages we read do not say whether Play counts such an app as supporting 16 KB, so ship aligned files.
For stricter tests, the guide says Android 17 can force backcompat off and make an incompatible binary abort immediately, using two adb shell setprop commands listed there.
What Can You Verify About Go Based Cores Like Xray and sing-box?
Less than you would like. We would rather say so than print a build command we could not source.
What we could verify: Android documents the NDK side. NDK r28 and higher align by default, and the older flags are linker flags. The NDK’s CMake source adds -Wl,-z,max-page-size=16384 for arm64-v8a and x86_64 when the r27 switch is on. Go documents passing flags to a linker: cmd/link describes -extldflags, and cgo says CGO_LDFLAGS is added to the linker flags.
What we could not verify: neither Go page mentions page size or Android alignment, and Android’s guide gives flags for ndk-build and CMake only. We found no document saying which settings make a Go c-shared or gomobile library 16 KB aligned. Treat any recipe that claims otherwise as unverified until the output passes steps 3 and 4.
Two upstream examples, neither a recipe for your build:
- The WireGuard Android project added
-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ONto its CMake arguments in a commit titled “tools: align to 16k” dated 21 May 2025. Its wireguard-go Makefile builds ac-sharedlibrary and passes the CMake linker flags to Go throughCGO_LDFLAGS. That link is our reading of two project files, not documented behavior. - sing-box’s build workflow on its testing branch sets up NDK r28 for its Android library jobs. That describes its CI, not the alignment of any released file.
Send these questions to the maintainers of every Go core you ship, and record the answers:
- Which NDK version builds the Android library you release?
- Which Go version and path: gomobile bind,
-buildmode=c-sharedor another? - Can you show the
llvm-objdump -pLOAD lines for thearm64-v8aandx86_64files in your latest release? - Do you pass extra linker flags, and which?
- Is the 16 KB check part of your release process, and since which release?
A Go issue about libgojni.so points the same way: one commenter says a newer NDK fixed the warning, and a reply says it is not a gomobile issue and quotes Android’s guidance on NDK r28 or higher. It is a user thread, not documentation, so treat it as a lead.
What Should Your CI Release Gate Check?
A gate runs the audit on every build, which matters most with several brands, because a core upgrade can bring back a 4 KB file. Per build automation, such as our VPN QA and test automation service, is a natural home for a regression prone check like this.
Release gate checklist:
- Pin NDK r28 or higher and AGP 8.5.1 or higher, and fail the build on anything older.
- Check the release artifact, never a debug build.
- Parse the
check_elf_alignment.shoutput and fail on any UNALIGNED line forarm64-v8aorx86_64. Do not rely on the exit code. - Run
llvm-objdump -pon every.soand require2**14or higher on each LOAD line. - Require “Verification successful” from
zipalign -v -c -P 16 4, andPAGE_ALIGNMENT_16Kfrombundletool dump configfor bundles. - Compare the
.solist with the last release, and hold the build until a person reviews any new file. - Boot a 16 KB emulator, confirm
getconf PAGE_SIZE, install the build and test connect and disconnect for each bundled core. - Feed the gate a known misaligned library and confirm it fails.
- Log each core’s name, version, builder and NDK version.
- Check the Play Console compatibility warning before promoting a release.
FAQ
What is the Google Play deadline for 16 KB page size support?
Android’s guide says 1 February 2027, for updates to apps targeting Android 15 (API level 35) or higher on 64 bit devices, as of 10 November 2026. An earlier Google post said 1 November 2025, so check again before you commit.
Does the rule apply to a Kotlin VPN app that uses a tunnel library?
Yes, if the library ships native code. Android says apps that link third party native libraries or SDKs are affected, so look in the lib folder of your APK.
How do I check whether an Xray or sing-box core is aligned?
Run llvm-objdump -p on the .so; each LOAD line should show align 2**14 or higher. Then run the RELRO check and Android’s script.
Do 32 bit libraries need to be aligned?
Android’s guide says to fix any arm64-v8a or x86_64 library reported as UNALIGNED, and the Play rule names 64 bit devices. We found no 32 bit requirement.
The One Thing to Do First
For 16 KB page size work, build the inventory first: every package name, core and .so, per ABI, with its builder and measured alignment. A file built with NDK r28 or higher that shows 2**14 is done. A file whose builder you cannot name is the one to chase first. Then add the date to your 2027 platform compliance calendar.
Not sure which of your native cores are aligned, or who builds them? Tell us the cores and platforms you ship on the contact page, and we can talk through what to check first.
Last checked against Android’s 16 KB page size guide, the May 2025 Android Developers Blog post, Google’s target API level pages, the NDK r27 and r28 changelogs, AOSP and NDK sources, WireGuard Android and sing-box project files, and Go’s cmd/link and cgo documentation on 10 November 2026.