Android Tutorial Android 16KB Page Size Compatibility Checker

This script checks for all the necessary markers to be sure your APK/AAB/SO files are 16KB page size compatible.
It has been simplified to easy usage.


What Does This Check?​

Starting with Android 15, devices may use 16KB memory page sizes instead of the traditional 4KB. Apps with improperly aligned native libraries will fail to load on these devices.

This script performs comprehensive validation that goes beyond simple alignment checks:

  • ✅ PT_LOAD segment alignment (p_align >= 16384)
  • ✅ Virtual address alignment (p_vaddr % p_align == 0)
  • ✅ File offset alignment (p_offset % p_align == 0)
  • ✅ Congruence requirement (p_vaddr % p_align == p_offset % p_align)
  • ✅ Android property note detection (.note.gnu.property)

STEPS
1. Make sure to download the NDK tools and extract to a location.Make sure to scroll down to get the latest version, v28 and above

2. Download the SCRIPT: leafy-check-16kb.ps1

3. Open Powershell at the location of the script, run the script,
Interactive Mode (Easiest - script will prompt you for the NDK Path, and then prompt again for the path to APK/AAB/.So etc)
Note: It remembers the NDK Path, so subsequent commands, just hit enter when it prompts for NDK Path
B4X:
.\leafy-check-16kb.ps1

Command Line Mode:(You specify the apk path and ndkpath)
B4X:
.\leafy-check-16kb.ps1 -Path "C:\path\to\your\app.apk" -NdkPath "C:\Android\Sdk\ndk\27.0.0"


4. If you get Policy Execution error,RUN powershell in Administrator mode and enter this
B4X:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser


1759841874675.png


 
Last edited:

Alex_197

Well-Known Member
Licensed User
Longtime User
Question - your screenshot shows warnings like this
B4X:
WARNING: No .note.gnu.property section found (may indicate old NDK)

Can we ignore them?

Thank you.
 
Top