From d4e24e12fb69756b4a3a7b4e606517dc9ea990e3 Mon Sep 17 00:00:00 2001 From: moy Date: Wed, 4 Feb 2026 14:58:19 +0800 Subject: [PATCH] =?UTF-8?q?Add=2016KB=20page=20size=20support=20for=20Andr?= =?UTF-8?q?oid=2015+=20=E9=80=82=E9=85=8D16kb---=E5=9F=BA=E4=BA=8Ev2.0.8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 61 +++++++++++++++++++ matrix/matrix-android/build.gradle | 4 +- matrix/matrix-android/gradle.properties | 4 +- .../gradle/WeChatPublish.gradle | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../matrix-android-commons/CMakeLists.txt | 2 + .../matrix-android-commons/build.gradle | 1 + .../cpp/libenhance_dlsym/EnhanceDlsym.cpp | 1 + .../matrix-arscutil/build.gradle | 2 +- .../matrix-backtrace/CMakeLists.txt | 2 + .../matrix-backtrace/build.gradle | 1 + matrix/matrix-android/matrix-fd/build.gradle | 1 + .../matrix-hooks/CMakeLists.txt | 2 + .../matrix-android/matrix-hooks/build.gradle | 1 + .../src/main/cpp/common/ScopedCleaner.h | 1 + .../src/main/cpp/memory/MemoryHookJNI.cpp | 1 + .../src/main/cpp/memory/memory.ver | 2 - .../src/main/cpp/pthread/ThreadTrace.cpp | 1 + .../src/main/cpp/pthread/pthread.ver | 2 - .../matrix-io-canary/CMakeLists.txt | 2 + .../matrix-io-canary/build.gradle | 1 + .../matrix-android/matrix-jectl/build.gradle | 1 + .../matrix-memguard/CMakeLists.txt | 2 +- .../matrix-memguard/build.gradle | 1 + .../matrix-opengl-leak/build.gradle | 1 + .../build.gradle | 1 + .../src/main/cpp/CMakeLists.txt | 2 + .../matrix-sqlite-lint/CMakeLists.txt | 2 + .../build.gradle | 1 + .../matrix-trace-canary/CMakeLists.txt | 2 + .../matrix-trace-canary/build.gradle | 4 +- .../matrix-traffic/build.gradle | 1 + matrix/matrix-android/settings.gradle | 12 ++-- 33 files changed, 108 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index cc6cbdb4d..1174a4612 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,67 @@ [![WeChat Approved](https://img.shields.io/badge/Wechat%20Approved-2.0.8-red.svg)](https://github.com/Tencent/matrix/wiki) [![CircleCI](https://circleci.com/gh/Tencent/matrix.svg?style=shield)](https://app.circleci.com/pipelines/github/Tencent/matrix) +--- + +# Android 16KB Page Size Support + +This branch (`v2.0.8-16kb`) adds support for Android 16KB page size devices (Android 15+). + +## Changes Overview + +### Build Environment Updates +- **NDK**: Upgraded to 27.0.12077973 (NDK 27+ supports 16KB alignment by default) +- **Gradle**: Upgraded to 7.5 +- **Android Gradle Plugin**: Upgraded to 7.4.2 +- **Kotlin**: Upgraded to 1.6.21 + +### Key Modifications + +1. **CMakeLists.txt** - Added 16KB alignment linker options to all native modules: + ```cmake + add_link_options(-Wl,-z,max-page-size=16384 -Wl,-z,common-page-size=16384) + ``` + +2. **build.gradle** - Added NDK version specification to modules with native code: + ```gradle + android { + ndkVersion "27.0.12077973" + } + ``` + +3. **Code Compatibility Fixes**: + - Added missing headers (``, ``) for NDK 27 compatibility + - Fixed version script files (`.ver`) to remove undefined symbols + - Added `-Wno-deprecated-declarations` flag where needed + +### Affected Modules +- matrix-android-commons +- matrix-backtrace +- matrix-hooks +- matrix-fd +- matrix-io-canary +- matrix-mallctl +- matrix-memguard +- matrix-opengl-leak +- matrix-trace-canary +- matrix-traffic +- matrix-resource-canary-android +- matrix-sqlite-lint-android-sdk + +### Verify 16KB Alignment + +```bash +$ANDROID_NDK/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-readelf -l | grep LOAD +``` + +Expected output should show alignment value `0x4000` (16384 = 16KB). + +### References +- [Android 16KB Page Size Support](https://developer.android.com/guide/practices/page-sizes) +- [NDK r27 Release Notes](https://developer.android.com/ndk/downloads/revision_history) + +--- + (中文版本请参看[这里](#matrix_cn)) [Matrix for iOS/macOS 中文版](#matrix_ios_cn) diff --git a/matrix/matrix-android/build.gradle b/matrix/matrix-android/build.gradle index 6d26068e3..a710835a8 100644 --- a/matrix/matrix-android/build.gradle +++ b/matrix/matrix-android/build.gradle @@ -8,11 +8,11 @@ buildscript { } - gradle.ext.KOTLIN_VERSION = "1.4.32" + gradle.ext.KOTLIN_VERSION = "1.6.21" dependencies { // classpath - classpath 'com.android.tools.build:gradle:4.1.0' + classpath 'com.android.tools.build:gradle:7.4.2' classpath 'digital.wup:android-maven-publish:3.6.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$gradle.KOTLIN_VERSION" } diff --git a/matrix/matrix-android/gradle.properties b/matrix/matrix-android/gradle.properties index 8baf7a8d9..4c1536100 100644 --- a/matrix/matrix-android/gradle.properties +++ b/matrix/matrix-android/gradle.properties @@ -6,7 +6,7 @@ # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. # Default value: -Xmx1024m -XX:MaxPermSize=256m -org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 +org.gradle.jvmargs=-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 # # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit @@ -19,3 +19,5 @@ VERSION_NAME_SUFFIX= ## two options: Internal (for wechat), External (for public repo) PUBLISH_CHANNEL=Internal android.useAndroidX=true +android.ndkVersion=27.0.12077973 +android.builder.sdkDownload=false diff --git a/matrix/matrix-android/gradle/WeChatPublish.gradle b/matrix/matrix-android/gradle/WeChatPublish.gradle index 15871c933..32f69588c 100644 --- a/matrix/matrix-android/gradle/WeChatPublish.gradle +++ b/matrix/matrix-android/gradle/WeChatPublish.gradle @@ -381,7 +381,7 @@ class WeChatAndroidLibraryPublishExtension extends WeChatPublishExtension { title = null def classpathFiles = project.files(android.getBootClasspath().join(File.pathSeparator)) - classpathFiles += project.files(project.configurations.compile) + classpathFiles += project.files(project.configurations.findByName('implementation') ?: project.configurations.findByName('compile') ?: []) doFirst { classpath += classpathFiles } source = variant.javaCompile.source diff --git a/matrix/matrix-android/gradle/wrapper/gradle-wrapper.properties b/matrix/matrix-android/gradle/wrapper/gradle-wrapper.properties index d4f2fcb46..191d36452 100644 --- a/matrix/matrix-android/gradle/wrapper/gradle-wrapper.properties +++ b/matrix/matrix-android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip diff --git a/matrix/matrix-android/matrix-android-commons/CMakeLists.txt b/matrix/matrix-android/matrix-android-commons/CMakeLists.txt index 1cdd8e69a..253fcea1e 100644 --- a/matrix/matrix-android/matrix-android-commons/CMakeLists.txt +++ b/matrix/matrix-android/matrix-android-commons/CMakeLists.txt @@ -1,4 +1,6 @@ cmake_minimum_required(VERSION 3.4.1) +# 16KB page size alignment for Android +add_link_options(-Wl,-z,max-page-size=16384 -Wl,-z,common-page-size=16384) project(android-commons) option(EnableLOG "Enable Logs" ON) diff --git a/matrix/matrix-android/matrix-android-commons/build.gradle b/matrix/matrix-android/matrix-android-commons/build.gradle index ea33532cc..975d61455 100644 --- a/matrix/matrix-android/matrix-android-commons/build.gradle +++ b/matrix/matrix-android/matrix-android-commons/build.gradle @@ -5,6 +5,7 @@ apply from: rootProject.file('gradle/WeChatNativeDepend.gradle') android { compileSdkVersion rootProject.ext.compileSdkVersion buildToolsVersion rootProject.ext.buildToolsVersion + ndkVersion "27.0.12077973" defaultConfig { minSdkVersion rootProject.ext.minSdkVersion diff --git a/matrix/matrix-android/matrix-android-commons/src/main/cpp/libenhance_dlsym/EnhanceDlsym.cpp b/matrix/matrix-android/matrix-android-commons/src/main/cpp/libenhance_dlsym/EnhanceDlsym.cpp index 6eb5b0cd4..ab0a5ebfe 100644 --- a/matrix/matrix-android/matrix-android-commons/src/main/cpp/libenhance_dlsym/EnhanceDlsym.cpp +++ b/matrix/matrix-android/matrix-android-commons/src/main/cpp/libenhance_dlsym/EnhanceDlsym.cpp @@ -19,6 +19,7 @@ // #include +#include #include #include #include diff --git a/matrix/matrix-android/matrix-arscutil/build.gradle b/matrix/matrix-android/matrix-arscutil/build.gradle index c85af8788..1a850c4b5 100644 --- a/matrix/matrix-android/matrix-arscutil/build.gradle +++ b/matrix/matrix-android/matrix-arscutil/build.gradle @@ -8,7 +8,7 @@ group rootProject.ext.GROUP dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'commons-io:commons-io:2.6' - compile project(':matrix-commons') + implementation project(':matrix-commons') } if("External" == rootProject.ext.PUBLISH_CHANNEL) { diff --git a/matrix/matrix-android/matrix-backtrace/CMakeLists.txt b/matrix/matrix-android/matrix-backtrace/CMakeLists.txt index 18a113c6f..9732242d5 100644 --- a/matrix/matrix-android/matrix-backtrace/CMakeLists.txt +++ b/matrix/matrix-android/matrix-backtrace/CMakeLists.txt @@ -1,4 +1,6 @@ # Sets the minimum version of CMake required to build your native library. +# 16KB page size alignment for Android +add_link_options(-Wl,-z,max-page-size=16384 -Wl,-z,common-page-size=16384) # This ensures that a certain set of CMake features is available to # your build. diff --git a/matrix/matrix-android/matrix-backtrace/build.gradle b/matrix/matrix-android/matrix-backtrace/build.gradle index 8bd5d4c2a..26489ad2c 100644 --- a/matrix/matrix-android/matrix-backtrace/build.gradle +++ b/matrix/matrix-android/matrix-backtrace/build.gradle @@ -4,6 +4,7 @@ apply from: rootProject.file('gradle/WeChatNativeDepend.gradle') android { compileSdkVersion rootProject.compileSdkVersion + ndkVersion "27.0.12077973" defaultConfig { minSdkVersion rootProject.MIN_SDK_VERSION_FOR_HOOK diff --git a/matrix/matrix-android/matrix-fd/build.gradle b/matrix/matrix-android/matrix-fd/build.gradle index 28ecca8d2..cf320c0d3 100644 --- a/matrix/matrix-android/matrix-fd/build.gradle +++ b/matrix/matrix-android/matrix-fd/build.gradle @@ -2,6 +2,7 @@ apply plugin: 'com.android.library' android { compileSdkVersion rootProject.compileSdkVersion + ndkVersion "27.0.12077973" defaultConfig { minSdkVersion rootProject.minSdkVersion diff --git a/matrix/matrix-android/matrix-hooks/CMakeLists.txt b/matrix/matrix-android/matrix-hooks/CMakeLists.txt index 209eb6620..7758f3445 100644 --- a/matrix/matrix-android/matrix-hooks/CMakeLists.txt +++ b/matrix/matrix-android/matrix-hooks/CMakeLists.txt @@ -1,4 +1,6 @@ cmake_minimum_required(VERSION 3.4.1) +# 16KB page size alignment for Android +add_link_options(-Wl,-z,max-page-size=16384 -Wl,-z,common-page-size=16384) option(EnableLOG "Enable QUT Logs" ON) if(EnableLOG) diff --git a/matrix/matrix-android/matrix-hooks/build.gradle b/matrix/matrix-android/matrix-hooks/build.gradle index 5749ccb96..ff5b98b22 100644 --- a/matrix/matrix-android/matrix-hooks/build.gradle +++ b/matrix/matrix-android/matrix-hooks/build.gradle @@ -4,6 +4,7 @@ apply from: rootProject.file('gradle/WeChatNativeDepend.gradle') android { compileSdkVersion rootProject.compileSdkVersion + ndkVersion "27.0.12077973" defaultConfig { minSdkVersion MIN_SDK_VERSION_FOR_HOOK diff --git a/matrix/matrix-android/matrix-hooks/src/main/cpp/common/ScopedCleaner.h b/matrix/matrix-android/matrix-hooks/src/main/cpp/common/ScopedCleaner.h index 5055f322f..2f5f98c41 100644 --- a/matrix/matrix-android/matrix-hooks/src/main/cpp/common/ScopedCleaner.h +++ b/matrix/matrix-android/matrix-hooks/src/main/cpp/common/ScopedCleaner.h @@ -23,6 +23,7 @@ #include +#include namespace matrix { template diff --git a/matrix/matrix-android/matrix-hooks/src/main/cpp/memory/MemoryHookJNI.cpp b/matrix/matrix-android/matrix-hooks/src/main/cpp/memory/MemoryHookJNI.cpp index 3fad302ab..ba2e29366 100644 --- a/matrix/matrix-android/matrix-hooks/src/main/cpp/memory/MemoryHookJNI.cpp +++ b/matrix/matrix-android/matrix-hooks/src/main/cpp/memory/MemoryHookJNI.cpp @@ -18,6 +18,7 @@ // Created by Yves on 2019-08-08. // #include +#include #include #include #include diff --git a/matrix/matrix-android/matrix-hooks/src/main/cpp/memory/memory.ver b/matrix/matrix-android/matrix-hooks/src/main/cpp/memory/memory.ver index cb102d391..66ac2b85b 100644 --- a/matrix/matrix-android/matrix-hooks/src/main/cpp/memory/memory.ver +++ b/matrix/matrix-android/matrix-hooks/src/main/cpp/memory/memory.ver @@ -1,7 +1,5 @@ { global: - JNI_OnLoad; - JNI_OnUnload; Java_*; fake_*; }; \ No newline at end of file diff --git a/matrix/matrix-android/matrix-hooks/src/main/cpp/pthread/ThreadTrace.cpp b/matrix/matrix-android/matrix-hooks/src/main/cpp/pthread/ThreadTrace.cpp index 78b0e3b97..2bc26d767 100644 --- a/matrix/matrix-android/matrix-hooks/src/main/cpp/pthread/ThreadTrace.cpp +++ b/matrix/matrix-android/matrix-hooks/src/main/cpp/pthread/ThreadTrace.cpp @@ -19,6 +19,7 @@ // #include +#include #include #include #include diff --git a/matrix/matrix-android/matrix-hooks/src/main/cpp/pthread/pthread.ver b/matrix/matrix-android/matrix-hooks/src/main/cpp/pthread/pthread.ver index e9f2a448a..9539005e8 100644 --- a/matrix/matrix-android/matrix-hooks/src/main/cpp/pthread/pthread.ver +++ b/matrix/matrix-android/matrix-hooks/src/main/cpp/pthread/pthread.ver @@ -1,7 +1,5 @@ { global: - JNI_OnLoad; - JNI_OnUnload; Java_*; local: *; diff --git a/matrix/matrix-android/matrix-io-canary/CMakeLists.txt b/matrix/matrix-android/matrix-io-canary/CMakeLists.txt index 7e653f3cb..6bd98fa6a 100644 --- a/matrix/matrix-android/matrix-io-canary/CMakeLists.txt +++ b/matrix/matrix-android/matrix-io-canary/CMakeLists.txt @@ -1,4 +1,6 @@ cmake_minimum_required(VERSION 3.4.1) +# 16KB page size alignment for Android +add_link_options(-Wl,-z,max-page-size=16384 -Wl,-z,common-page-size=16384) project(IOCanary) diff --git a/matrix/matrix-android/matrix-io-canary/build.gradle b/matrix/matrix-android/matrix-io-canary/build.gradle index 5802a5b9f..a17798485 100644 --- a/matrix/matrix-android/matrix-io-canary/build.gradle +++ b/matrix/matrix-android/matrix-io-canary/build.gradle @@ -5,6 +5,7 @@ apply from: rootProject.file('gradle/WeChatNativeDepend.gradle') android { compileSdkVersion rootProject.ext.compileSdkVersion buildToolsVersion rootProject.ext.buildToolsVersion + ndkVersion "27.0.12077973" defaultConfig { minSdkVersion rootProject.ext.minSdkVersion diff --git a/matrix/matrix-android/matrix-jectl/build.gradle b/matrix/matrix-android/matrix-jectl/build.gradle index 8b49d40dc..353cd186b 100644 --- a/matrix/matrix-android/matrix-jectl/build.gradle +++ b/matrix/matrix-android/matrix-jectl/build.gradle @@ -4,6 +4,7 @@ apply from: rootProject.file('gradle/WeChatNativeDepend.gradle') android { compileSdkVersion rootProject.compileSdkVersion + ndkVersion "27.0.12077973" defaultConfig { minSdkVersion rootProject.minSdkVersion diff --git a/matrix/matrix-android/matrix-memguard/CMakeLists.txt b/matrix/matrix-android/matrix-memguard/CMakeLists.txt index a5988df49..21c741f60 100644 --- a/matrix/matrix-android/matrix-memguard/CMakeLists.txt +++ b/matrix/matrix-android/matrix-memguard/CMakeLists.txt @@ -43,7 +43,7 @@ target_include_directories( target_compile_options( ${TARGET} - PRIVATE -Wall -Wextra -Werror -Wno-unused-function + PRIVATE -Wall -Wextra -Werror -Wno-unused-function -Wno-deprecated-declarations PRIVATE $<$:-std=c17> PRIVATE $<$:-std=c++17> PUBLIC -fvisibility=hidden -fno-exceptions -fno-rtti -fdata-sections -ffunction-sections diff --git a/matrix/matrix-android/matrix-memguard/build.gradle b/matrix/matrix-android/matrix-memguard/build.gradle index 0d4efe22f..9025dab8e 100644 --- a/matrix/matrix-android/matrix-memguard/build.gradle +++ b/matrix/matrix-android/matrix-memguard/build.gradle @@ -4,6 +4,7 @@ apply from: rootProject.file('gradle/WeChatNativeDepend.gradle') android { compileSdkVersion rootProject.compileSdkVersion + ndkVersion "27.0.12077973" defaultConfig { minSdkVersion MIN_SDK_VERSION_FOR_HOOK diff --git a/matrix/matrix-android/matrix-opengl-leak/build.gradle b/matrix/matrix-android/matrix-opengl-leak/build.gradle index e44c150f6..80c60025c 100644 --- a/matrix/matrix-android/matrix-opengl-leak/build.gradle +++ b/matrix/matrix-android/matrix-opengl-leak/build.gradle @@ -4,6 +4,7 @@ apply from: rootProject.file('gradle/WeChatNativeDepend.gradle') android { compileSdkVersion rootProject.ext.compileSdkVersion + ndkVersion "27.0.12077973" buildToolsVersion rootProject.ext.buildToolsVersion defaultConfig { diff --git a/matrix/matrix-android/matrix-resource-canary/matrix-resource-canary-android/build.gradle b/matrix/matrix-android/matrix-resource-canary/matrix-resource-canary-android/build.gradle index 718046426..ba6792758 100644 --- a/matrix/matrix-android/matrix-resource-canary/matrix-resource-canary-android/build.gradle +++ b/matrix/matrix-android/matrix-resource-canary/matrix-resource-canary-android/build.gradle @@ -6,6 +6,7 @@ apply from: rootProject.file('gradle/WeChatNativeDepend.gradle') android { compileSdkVersion rootProject.ext.compileSdkVersion buildToolsVersion rootProject.ext.buildToolsVersion + ndkVersion "27.0.12077973" defaultConfig { minSdkVersion rootProject.ext.minSdkVersion diff --git a/matrix/matrix-android/matrix-resource-canary/matrix-resource-canary-android/src/main/cpp/CMakeLists.txt b/matrix/matrix-android/matrix-resource-canary/matrix-resource-canary-android/src/main/cpp/CMakeLists.txt index a39be7f92..b6c2545cf 100644 --- a/matrix/matrix-android/matrix-resource-canary/matrix-resource-canary-android/src/main/cpp/CMakeLists.txt +++ b/matrix/matrix-android/matrix-resource-canary/matrix-resource-canary-android/src/main/cpp/CMakeLists.txt @@ -1,4 +1,6 @@ cmake_minimum_required(VERSION 3.10.2) +# 16KB page size alignment for Android +add_link_options(-Wl,-z,max-page-size=16384 -Wl,-z,common-page-size=16384) project(matrix-resource-canary-android) set(CMAKE_CXX_STANDARD 17) diff --git a/matrix/matrix-android/matrix-sqlite-lint/CMakeLists.txt b/matrix/matrix-android/matrix-sqlite-lint/CMakeLists.txt index f7e8c8019..aec4f8363 100644 --- a/matrix/matrix-android/matrix-sqlite-lint/CMakeLists.txt +++ b/matrix/matrix-android/matrix-sqlite-lint/CMakeLists.txt @@ -7,6 +7,8 @@ # cmake_minimum_required(VERSION 3.4.1) +# 16KB page size alignment for Android +add_link_options(-Wl,-z,max-page-size=16384 -Wl,-z,common-page-size=16384) # We called it SQLiteLint which is to find improper usages of SQLite3 project(SQLiteLint) diff --git a/matrix/matrix-android/matrix-sqlite-lint/matrix-sqlite-lint-android-sdk/build.gradle b/matrix/matrix-android/matrix-sqlite-lint/matrix-sqlite-lint-android-sdk/build.gradle index e52670068..453916036 100644 --- a/matrix/matrix-android/matrix-sqlite-lint/matrix-sqlite-lint-android-sdk/build.gradle +++ b/matrix/matrix-android/matrix-sqlite-lint/matrix-sqlite-lint-android-sdk/build.gradle @@ -5,6 +5,7 @@ apply from: rootProject.file('gradle/WeChatNativeDepend.gradle') android { compileSdkVersion rootProject.ext.compileSdkVersion buildToolsVersion rootProject.ext.buildToolsVersion + ndkVersion "27.0.12077973" defaultConfig { minSdkVersion rootProject.ext.minSdkVersion diff --git a/matrix/matrix-android/matrix-trace-canary/CMakeLists.txt b/matrix/matrix-android/matrix-trace-canary/CMakeLists.txt index a914613dc..321c2c182 100644 --- a/matrix/matrix-android/matrix-trace-canary/CMakeLists.txt +++ b/matrix/matrix-android/matrix-trace-canary/CMakeLists.txt @@ -1,4 +1,6 @@ cmake_minimum_required(VERSION 3.4.1) +# 16KB page size alignment for Android +add_link_options(-Wl,-z,max-page-size=16384 -Wl,-z,common-page-size=16384) project(TraceCanary) diff --git a/matrix/matrix-android/matrix-trace-canary/build.gradle b/matrix/matrix-android/matrix-trace-canary/build.gradle index d7bc40620..1d808fd4e 100644 --- a/matrix/matrix-android/matrix-trace-canary/build.gradle +++ b/matrix/matrix-android/matrix-trace-canary/build.gradle @@ -5,6 +5,7 @@ apply from: rootProject.file('gradle/WeChatNativeDepend.gradle') android { compileSdkVersion rootProject.ext.compileSdkVersion buildToolsVersion rootProject.ext.buildToolsVersion + ndkVersion "27.0.12077973" // publishNonDefault true defaultConfig { minSdkVersion rootProject.ext.minSdkVersion @@ -17,7 +18,8 @@ android { cppFlags "-std=gnu++11 -frtti -fexceptions" } ndk { - abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64" + // Only build ARM architectures for 16KB support + abiFilters "armeabi-v7a", "arm64-v8a" } } diff --git a/matrix/matrix-android/matrix-traffic/build.gradle b/matrix/matrix-android/matrix-traffic/build.gradle index 756f133d6..dedd0e900 100644 --- a/matrix/matrix-android/matrix-traffic/build.gradle +++ b/matrix/matrix-android/matrix-traffic/build.gradle @@ -4,6 +4,7 @@ apply from: rootProject.file('gradle/WeChatNativeDepend.gradle') android { compileSdkVersion rootProject.ext.compileSdkVersion + ndkVersion "27.0.12077973" buildToolsVersion rootProject.ext.buildToolsVersion // publishNonDefault true defaultConfig { diff --git a/matrix/matrix-android/settings.gradle b/matrix/matrix-android/settings.gradle index 3204b7166..fa6ef3b41 100644 --- a/matrix/matrix-android/settings.gradle +++ b/matrix/matrix-android/settings.gradle @@ -27,13 +27,13 @@ include ':matrix-memguard' include ':matrix-jectl' include ':matrix-fd' -// Benchmark -include ':test:matrix-backtrace-benchmark' +// Benchmark (disabled for 16KB build) +// include ':test:matrix-backtrace-benchmark' -// TEST -include ':test:test-backtrace' -include ':test:test-memoryhook' -include ':test:test-openglhook' +// TEST (disabled for 16KB build) +// include ':test:test-backtrace' +// include ':test:test-memoryhook' +// include ':test:test-openglhook' include ':matrix-memory-canary' if (gradle.staticLinkCXX()) {