forked from Blendman974/faceclaw
fix: align llama native library for Android 16 KiB pages
This commit is contained in:
5 files changed
+142
-3
No files matched your search
@@ -0,0 +1,33 @@
|
||||
# Android 16 KiB page compatibility
|
||||
|
||||
The initial debug APK triggered Android's page-size compatibility warning.
|
||||
Its `libfaceclaw_llama.so` LOAD segments were aligned to 4096 bytes. The other
|
||||
six packaged arm64 libraries were aligned to 16384 bytes, and APK ZIP alignment
|
||||
already passed `zipalign -c -P 16 4`.
|
||||
|
||||
The llama JNI shared library now links with both `max-page-size=16384` and
|
||||
`common-page-size=16384`, matching the LC3 JNI library. This changes the native
|
||||
binary layout rather than hiding the compatibility warning or disabling debug.
|
||||
Gradle already tracks CMakeLists.txt as an input, and Ninja reconfigures and
|
||||
relinks existing builds after this change.
|
||||
|
||||
Reproduce the regression and artifact checks inside `devenv shell`:
|
||||
|
||||
```sh
|
||||
python3 -m unittest discover -s tests -p test_apk_pages.py
|
||||
bash build.sh
|
||||
python3 scripts/check-apk-pages.py platforms/android/app/build/outputs/apk/debug/app-debug.apk
|
||||
"$ANDROID_HOME/build-tools/35.0.1/zipalign" -c -P 16 4 platforms/android/app/build/outputs/apk/debug/app-debug.apk
|
||||
```
|
||||
|
||||
The checker rejects the initial APK and reports its misaligned llama library.
|
||||
Five unit tests cover 4 KiB rejection, 16 KiB acceptance, RELRO boundaries and
|
||||
invalid ELF program headers. APK checks inspect all arm64/x86_64 shared libraries.
|
||||
|
||||
Reference: [Android's 16 KiB guidance](https://developer.android.com/guide/practices/page-sizes).
|
||||
Static alignment and successful installation do not prove every native code
|
||||
path works on-device; voice/LLM features still require functional testing.
|
||||
|
||||
The rebuilt APK passes all seven native-library checks, ZIP alignment and APK
|
||||
signature verification. The connected Pixel 10 Pro Fold reports `getconf
|
||||
PAGE_SIZE` = 4096; actual execution with 16 KiB pages remains untested.
|
||||
@@ -29,17 +29,21 @@ The build produces a debug APK for arm64 Android phones. It does not install
|
||||
the APK or flash firmware. Build output and machine-local signing/SDK files
|
||||
are ignored by Git.
|
||||
|
||||
Final artifact: `dist/faceclaw-device-preferences-debug.apk` (110,299,294 bytes),
|
||||
Final artifact: `dist/faceclaw-device-preferences-debug.apk` (115,876,494 bytes),
|
||||
package `com.faceclaw.app`, version 0.8.6 (806). Build completed successfully;
|
||||
APK v2 signature verified with `apksigner`. The packaged JavaScript contains all
|
||||
three controls, and the DEX contains the new calendar and head-up native APIs.
|
||||
SHA-256 (also saved alongside the APK):
|
||||
|
||||
```text
|
||||
589d1627df72ec84e56a85dbfe257c123ded094b6708997da6b9bd18a2d7fbaf
|
||||
091ced145d499ec00aa03cbea60f5cec7a2167e459896c4b5b45211e1c9a7e8a
|
||||
```
|
||||
|
||||
Physical validation remains pending. No phone or glasses were used. See the
|
||||
The updated APK also passes ELF LOAD/RELRO and ZIP alignment checks for 16 KiB
|
||||
pages; see [16 KiB validation](validation-android-16k.md).
|
||||
|
||||
Glasses validation remains pending. The APK was installed on a Pixel 10 Pro Fold,
|
||||
which currently reports 4096-byte pages. No glasses were used. See the
|
||||
manual procedures for [notifications](validation-notifications.md),
|
||||
[Android calendars](validation-calendars.md) and [head-up wake](validation-head-up.md).
|
||||
In particular, successful BLE encoding and simulated ACK/reconnect tests do
|
||||
|
||||
Reference in new issue
Block a user