From 9d1b1cebf56d53b3dd045c25ebfb0048375c9535 Mon Sep 17 00:00:00 2001 From: JingMatrix Date: Tue, 24 Nov 2026 17:07:49 +0100 Subject: [PATCH] Update dependencies Submodules: - external/lsplant onto upstream LSPosed/LSPlant master, rebased over our NDK-libc++ and public-build patches, bringing the internal-hook init fixes: the Class::SetStatus inline hook published its entry patch before the backup pointer, so a concurrent VerifyClass -> SetStatus during class loading could branch through an unpublished backup and crash (LSPosed/LSPlant#194, LSPosed/LSPlant#195), plus LSPosed/LSPlant#197 and LSPosed/LSPlant#201. dex_builder pinned to JingMatrix/DexBuilder HEAD. - fmt 12.2.1, commons-lang 3.22.0. Compile SDK: - compileSdk 37 -> 37.2 (via compileSdkMinor). material3 1.5.0, the stable Expressive line, requires API 37.1 or newer. Compose: - compose-bom 2026.11.01, which now ships material3 1.5.0 and compose-ui 1.13.0. Dropped the explicit material3 pin: the BOM supersedes it, so material3 is BOM-governed again. Other: - kotlinx-serialization-json 1.13.0, ktfmt 0.28.0. Toolchain: - Gradle wrapper 9.9.2, AGP 9.5.2, androidx lifecycle 2.11.1, navigation3 1.2.2. - actions/setup-java v6, crowdin/github-action v3. Native build on CMake 4.x: a newer CMake (seen on 4.5) enables `import std` for C++23 targets, but its probe resolves the std module to the host's libstdc++ and cross-compiles it for Android, which the NDK sysroot cannot satisfy. Point the synthesised std target at the NDK's own libc++ module (CMAKE_CXX_STDLIB_MODULES_JSON), so it builds against libc++; this is harmless on CMake versions that skip the synthesis. No pin needed. fmt is kept header-only (fmt-module's source imports std). Clear the compile warnings the bump surfaces, so the build is warning-free: - SearchField moves to the BasicTextField(TextFieldState) overload, keeping its hoisted-String contract via two guarded one-way syncs so callers stay unchanged. The value/onValueChange overload is deprecated in the Compose that material3 1.5.0 pulls in. - VectorApp uses currentWindowAdaptiveInfoV2. - StoreSettings.setUpdateChannel names its parameter channel, matching the override, so the named-argument warning goes away. --- .github/workflows/core.yml | 5 +- .github/workflows/crowdin.yml | 2 +- build.gradle.kts | 23 ++++++- external/CMakeLists.txt | 2 + external/apache/commons-lang | 2 +- external/fmt | 2 +- external/lsplant | 2 +- gradle/libs.versions.toml | 29 ++++----- gradle/wrapper/gradle-wrapper.properties | 2 +- .../org/matrix/vector/ui/SearchField.kt | 62 ++++++++++++------- .../matrix/vector/ui/store/StoreDataSource.kt | 2 +- .../org/matrix/vector/manager/ui/VectorApp.kt | 4 +- 12 files changed, 89 insertions(+), 48 deletions(-) diff --git a/.github/workflows/core.yml b/.github/workflows/core.yml index 89b65713d4..f3adfdb248 100644 --- a/.github/workflows/core.yml +++ b/.github/workflows/core.yml @@ -85,7 +85,7 @@ jobs: printf '%s' "$KEY_STORE" | base64 --decode > key.jks - name: Setup Java - uses: actions/setup-java@v5 + uses: actions/setup-java@v6 with: distribution: temurin java-version: 21 @@ -117,6 +117,9 @@ jobs: - name: Setup Android SDK uses: android-actions/setup-android@v4 + # Drop the SDK's bundled CMake so AGP uses the runner's system CMake, which + # brings the system Ninja (>= 1.11) that C++20 modules need; the SDK's + # CMake ships Ninja 1.10.2, too old to scan modules. - name: Remove Android's cmake shell: bash run: rm -rf $ANDROID_HOME/cmake diff --git a/.github/workflows/crowdin.yml b/.github/workflows/crowdin.yml index ccaf1179cb..e462711433 100644 --- a/.github/workflows/crowdin.yml +++ b/.github/workflows/crowdin.yml @@ -26,7 +26,7 @@ jobs: uses: actions/checkout@v7 - name: crowdin action - uses: crowdin/github-action@v2 + uses: crowdin/github-action@v3 with: upload_translations: true download_translations: false diff --git a/build.gradle.kts b/build.gradle.kts index dc1833ebad..b1a5bd5cc0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,6 +3,7 @@ import com.android.build.api.dsl.CommonExtension import com.android.build.gradle.api.AndroidBasePlugin import com.ncorti.ktfmt.gradle.tasks.KtfmtFormatTask import java.io.ByteArrayOutputStream +import java.io.File import javax.inject.Inject import org.gradle.api.provider.Property import org.gradle.api.provider.ValueSource @@ -226,6 +227,9 @@ val androidTargetSdkVersion = 37 val androidMinSdkVersion = 27 val androidBuildToolsVersion = "37.0.0" val androidCompileSdkVersion = 37 +// Compose material3 1.5.0 (the Expressive line) requires compiling against +// API 37.1 or newer; 37.2 is the newest minor platform installed. +val androidCompileSdkMinorVersion = 2 val androidCompileNdkVersion = "30.0.16248370" val androidSourceCompatibility = JavaVersion.VERSION_21 val androidTargetCompatibility = JavaVersion.VERSION_21 @@ -250,6 +254,8 @@ extra.set("androidBuildToolsVersion", androidBuildToolsVersion) extra.set("androidCompileSdkVersion", androidCompileSdkVersion) +extra.set("androidCompileSdkMinorVersion", androidCompileSdkMinorVersion) + extra.set("androidCompileNdkVersion", androidCompileNdkVersion) extra.set("androidSourceCompatibility", androidSourceCompatibility) @@ -260,6 +266,7 @@ subprojects { plugins.withType(AndroidBasePlugin::class.java) { extensions.configure(CommonExtension::class.java) { compileSdk = androidCompileSdkVersion + compileSdkMinor = androidCompileSdkMinorVersion ndkVersion = androidCompileNdkVersion buildToolsVersion = androidBuildToolsVersion @@ -299,13 +306,27 @@ subprojects { "-DPHMAP_HAVE_SSSE3=0", ) + // A newer CMake (seen on 4.5) turns `import std` on for C++23 targets, but its + // probe resolves the std module to the host's libstdc++ and then cross-compiles it + // for Android, which the NDK sysroot cannot satisfy. Point the synthesised std + // target at the NDK's own libc++ module; harmless on CMake versions that skip it. + val sdkDir = System.getenv("ANDROID_HOME") ?: System.getenv("ANDROID_SDK_ROOT") + val libcxxModulesJson = + sdkDir + ?.let { file("$it/ndk/$androidCompileNdkVersion/toolchains/llvm/prebuilt") } + ?.listFiles() + ?.firstOrNull(File::isDirectory) + ?.resolve("lib/x86_64-unknown-linux-gnu/libc++.modules.json") + ?.takeIf(File::isFile) + val args = - listOf( + listOfNotNull( "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON", "-DVECTOR_ROOT=${rootDir.absolutePath}", // Enforce 16 KB page size alignment for Android 15+ compatibility "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-z,max-page-size=16384", "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-z,max-page-size=16384", + libcxxModulesJson?.let { "-DCMAKE_CXX_STDLIB_MODULES_JSON=$it" }, ) externalNativeBuild { diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 49ad0d3f41..290d784ee3 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -19,6 +19,8 @@ target_include_directories(xz_static PRIVATE ${XZ_INCLUDES}) option(LSPLANT_BUILD_SHARED OFF) option(Plugin.SymbolResolver OFF) option(FMT_INSTALL OFF) +# We use fmt-header-only; fmt-module's source does `import std`, unusable on the NDK. +option(FMT_MODULE OFF) add_subdirectory(dobby) add_subdirectory(fmt) diff --git a/external/apache/commons-lang b/external/apache/commons-lang index 7b6048b7a9..562de6e40e 160000 --- a/external/apache/commons-lang +++ b/external/apache/commons-lang @@ -1 +1 @@ -Subproject commit 7b6048b7a9d1339a12d353cb85b2222df7bf5668 +Subproject commit 562de6e40e0742f471adefcf05bd4b273d995028 diff --git a/external/fmt b/external/fmt index 5da4e9a3fb..208219daff 160000 --- a/external/fmt +++ b/external/fmt @@ -1 +1 @@ -Subproject commit 5da4e9a3fb15626ba92969199061e0169ebc8a00 +Subproject commit 208219daff58f2a7438f6931cc2ddc358acf33ef diff --git a/external/lsplant b/external/lsplant index 7a768e31ff..e3a2903d7a 160000 --- a/external/lsplant +++ b/external/lsplant @@ -1 +1 @@ -Subproject commit 7a768e31ffb2852797631b5140b54f9702a78743 +Subproject commit e3a2903d7ab52fa586320b2f1da97611f504e0e7 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f2ca13ba7d..1889bd5696 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,23 +1,18 @@ [versions] -agp = "9.5.0" +agp = "9.5.2" kotlin = "2.4.21" okhttp = "5.5.1" -ktfmt = "0.27.0" +ktfmt = "0.28.0" coroutines = "1.11.0" -lifecycle = "2.11.0" +lifecycle = "2.11.1" coil = "3.6.3" -# Material 3 Expressive is not in any stable material3 release; the expressive -# APIs graduate through the 1.5.0 line, which has reached rc. Pinned explicitly -# OVER the Compose BOM, which resolves material3 to 1.4.0. -# -# This pin also decides compose-ui and compose-foundation: material3 names its -# own minimum for them and Gradle takes whichever is higher, the BOM's or this -# one's. Check what a material3 bump brings with it. -m3 = "1.5.0-rc01" -nav3 = "1.2.1" +nav3 = "1.2.2" navigationevent = "1.2.0" -# Governs every androidx.compose.* artifact below; none of them pin a version. -compose-bom = "2026.09.00" +# Governs every androidx.compose.* artifact below, material3 included: this BOM +# ships material3 1.5.0 (the Expressive line, now stable), so none of them pin a +# version. Reaching 1.5.0 needs compileSdk 37.1 or newer; the build compiles +# against 37.2 (see androidCompileSdkMinorVersion). +compose-bom = "2026.11.01" [plugins] agp-lib = { id = "com.android.library", version.ref = "agp" } @@ -45,8 +40,8 @@ androidx-compose-ui = { group = "androidx.compose.ui", name = "ui" } androidx-compose-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" } androidx-compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" } androidx-compose-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" } -androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3", version.ref = "m3" } -androidx-compose-material3-adaptive-navigation-suite = { group = "androidx.compose.material3", name = "material3-adaptive-navigation-suite", version.ref = "m3" } +androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3" } +androidx-compose-material3-adaptive-navigation-suite = { group = "androidx.compose.material3", name = "material3-adaptive-navigation-suite" } androidx-compose-material-icons-extended = { group = "androidx.compose.material", name = "material-icons-extended" } # Navigation 3. Stable since Nov 2025; the back stack is a plain observable list @@ -61,7 +56,7 @@ androidx-navigationevent-compose = { group = "androidx.navigationevent", name = coil-compose = { group = "io.coil-kt.coil3", name = "coil-compose", version.ref = "coil" } coil-network-okhttp = { group = "io.coil-kt.coil3", name = "coil-network-okhttp", version.ref = "coil" } -kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version = "1.12.0" } +kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version = "1.13.0" } rikkax-parcelablelist = { module = "dev.rikka.rikkax.parcelablelist:parcelablelist", version = "2.0.1" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 91c4fc64aa..d0d1a39c1f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.8.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.9.2-bin.zip networkTimeout=10000 retries=0 retryBackOffMs=500 diff --git a/manager-ui/src/main/kotlin/org/matrix/vector/ui/SearchField.kt b/manager-ui/src/main/kotlin/org/matrix/vector/ui/SearchField.kt index 9e7d1526ac..8b7efc48c6 100644 --- a/manager-ui/src/main/kotlin/org/matrix/vector/ui/SearchField.kt +++ b/manager-ui/src/main/kotlin/org/matrix/vector/ui/SearchField.kt @@ -7,6 +7,11 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.width import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.text.BasicTextField +import androidx.compose.foundation.text.input.TextFieldDecorator +import androidx.compose.foundation.text.input.TextFieldLineLimits +import androidx.compose.foundation.text.input.clearText +import androidx.compose.foundation.text.input.rememberTextFieldState +import androidx.compose.foundation.text.input.setTextAndPlaceCursorAtEnd import androidx.compose.material.icons.Icons import androidx.compose.material.icons.rounded.Close import androidx.compose.material.icons.rounded.Search @@ -16,6 +21,8 @@ import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Surface import androidx.compose.material3.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.snapshotFlow import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.SolidColor @@ -38,6 +45,19 @@ fun SearchField( clearContentDescription: String = "Clear search", trailing: @Composable () -> Unit = {}, ) { + // The field owns a TextFieldState, but the public contract stays a hoisted String so callers + // keep driving the query from their own ViewModels. Two one-way syncs bridge the two: each + // write is guarded on the values already differing, so a local edit reaches the caller and a + // caller-driven reset (the clear button, a tab switch) reaches the field, but neither bounces + // back into a loop. + val state = rememberTextFieldState(query) + LaunchedEffect(state) { + snapshotFlow { state.text.toString() }.collect { if (it != query) onQueryChange(it) } + } + LaunchedEffect(query) { + if (query != state.text.toString()) state.setTextAndPlaceCursorAtEnd(query) + } + Surface( color = MaterialTheme.colorScheme.surfaceContainerHigh, shape = RoundedCornerShape(28.dp), @@ -52,34 +72,34 @@ fun SearchField( ) Spacer(Modifier.width(12.dp)) BasicTextField( - value = query, - onValueChange = onQueryChange, - singleLine = true, + state = state, + lineLimits = TextFieldLineLimits.SingleLine, textStyle = MaterialTheme.typography.bodyLarge.copy( color = MaterialTheme.colorScheme.onSurface ), cursorBrush = SolidColor(MaterialTheme.colorScheme.primary), modifier = Modifier.weight(1f).padding(vertical = 16.dp), - decorationBox = { inner -> - if (query.isEmpty()) { - Text( - text = placeholder, - style = MaterialTheme.typography.bodyLarge, - color = MaterialTheme.colorScheme.onSurfaceVariant, - // A search field is a fixed-height control, so its hint may never - // wrap: a long localized placeholder that runs to a second line would - // grow the whole bar, breaking the fixed header every panel shares. - // One line, always — the field cannot change shape by language. - maxLines = 1, - overflow = TextOverflow.Ellipsis, - ) - } - inner() - }, + decorator = + TextFieldDecorator { inner -> + if (state.text.isEmpty()) { + Text( + text = placeholder, + style = MaterialTheme.typography.bodyLarge, + color = MaterialTheme.colorScheme.onSurfaceVariant, + // A search field is a fixed-height control, so its hint may never + // wrap: a long localized placeholder that runs to a second line would + // grow the whole bar, breaking the fixed header every panel shares. + // One line, always — the field cannot change shape by language. + maxLines = 1, + overflow = TextOverflow.Ellipsis, + ) + } + inner() + }, ) - if (query.isNotEmpty()) { - IconButton(onClick = { onQueryChange("") }) { + if (state.text.isNotEmpty()) { + IconButton(onClick = { state.clearText() }) { Icon( Icons.Rounded.Close, contentDescription = clearContentDescription, diff --git a/manager-ui/src/main/kotlin/org/matrix/vector/ui/store/StoreDataSource.kt b/manager-ui/src/main/kotlin/org/matrix/vector/ui/store/StoreDataSource.kt index a0a1412268..24ffd7c41d 100644 --- a/manager-ui/src/main/kotlin/org/matrix/vector/ui/store/StoreDataSource.kt +++ b/manager-ui/src/main/kotlin/org/matrix/vector/ui/store/StoreDataSource.kt @@ -42,7 +42,7 @@ interface StoreSettings { /** Store-tracked installs, keyed by package name. */ val storeInstalls: StateFlow> - fun setUpdateChannel(token: String) + fun setUpdateChannel(channel: String) /** Mute or un-mute the available update for [packageName] (the Details screen's options sheet). */ fun setUpdatesMuted(packageName: String, muted: Boolean) diff --git a/manager/src/main/kotlin/org/matrix/vector/manager/ui/VectorApp.kt b/manager/src/main/kotlin/org/matrix/vector/manager/ui/VectorApp.kt index 2d308ef564..65498a362b 100644 --- a/manager/src/main/kotlin/org/matrix/vector/manager/ui/VectorApp.kt +++ b/manager/src/main/kotlin/org/matrix/vector/manager/ui/VectorApp.kt @@ -3,7 +3,7 @@ package org.matrix.vector.manager.ui import androidx.activity.compose.BackHandler import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.material3.adaptive.currentWindowAdaptiveInfo +import androidx.compose.material3.adaptive.currentWindowAdaptiveInfoV2 import androidx.compose.material3.adaptive.navigationsuite.NavigationSuiteScaffold import androidx.compose.material3.adaptive.navigationsuite.NavigationSuiteScaffoldDefaults import androidx.compose.material3.adaptive.navigationsuite.NavigationSuiteType @@ -121,7 +121,7 @@ fun VectorApp() { // the floating setting for as long as it lasts — there is nothing to rearrange otherwise. val suiteType = if (floating && !editing) NavigationSuiteType.None - else NavigationSuiteScaffoldDefaults.navigationSuiteType(currentWindowAdaptiveInfo()) + else NavigationSuiteScaffoldDefaults.navigationSuiteType(currentWindowAdaptiveInfoV2()) NavigationSuiteScaffold( navigationItems = {