From 07dde7c756c35db8af9f451e1b2e2a81feb672f3 Mon Sep 17 00:00:00 2001 From: Enginex0 Date: Thu, 25 Jun 2026 17:14:15 +0100 Subject: [PATCH] fix(build): revert NDK to 27.3.13750724 NDK 29's Clang-21 libc++ makes libTEESimulator.so reference __cxa_init_primary_exception, which the platform libc++ inside keystore2 does not export. The injected lib resolves its C++ ABI symbols against the target process at dlopen time, so injection failed with "cannot locate symbol" on every retry. keystore2 ran unhooked and every app saw the raw TEE chain (KeyAttestation showed the real unlocked bootloader; per-UID NDJSON never created). libc++ began emitting that symbol from std::exception_ptr construction in Clang 19, so 27.3 (Clang 18) is the last toolchain that builds a loadable lib. The exception_ptr machinery enters via the AOSP/binder stub headers, not module code. Verified on device: lib injects (3 maps in keystore2), KeyAttestation generateKey -> PATCH with deviceLocked=true, verifiedBootState=Verified. --- app/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 85f7f53..d7bc295 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -35,7 +35,7 @@ val verName = "v6.0.1" android { namespace = "org.matrix.TEESimulator" compileSdk = 36 - ndkVersion = "29.0.14206865" + ndkVersion = "27.3.13750724" buildToolsVersion = "36.0.0" defaultConfig {