From 6fd03f37f73ea2aab046b412e3a0652e0568d640 Mon Sep 17 00:00:00 2001 From: Denozordec Date: Fri, 9 Oct 2026 23:59:09 +0700 Subject: [PATCH] android: toolchain AGP 9.1.1 / Gradle 9.3.1 / Kotlin 2.2.21 / compileSdk 37, BOM 2026.09.00 + material3 1.5.0-beta01 Built-in Kotlin (kotlin-android removed), Java 11 compile options (compose 1.12), proguard-android-optimize.txt (the non-optimize file is rejected by AGP 9), ExposedDropdownMenu import, minSdk 23 kept via tools:overrideLibrary for material3 1.5 libs that declare minSdk 24. -PshortNdkCommands for deep worktree paths. Co-Authored-By: Claude Opus 5.5 --- src/frontends/android/app/build.gradle | 28 +++++++++---------- .../android/app/src/main/AndroidManifest.xml | 3 ++ .../android/ui/compose/ProfileFormScreen.kt | 7 +++-- src/frontends/android/build.gradle | 6 ++-- src/frontends/android/gradle.properties | 1 - .../gradle/wrapper/gradle-wrapper.properties | 2 +- 6 files changed, 25 insertions(+), 22 deletions(-) diff --git a/src/frontends/android/app/build.gradle b/src/frontends/android/app/build.gradle index 586bdb8c5..431f58385 100644 --- a/src/frontends/android/app/build.gradle +++ b/src/frontends/android/app/build.gradle @@ -1,5 +1,4 @@ apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' apply plugin: 'org.jetbrains.kotlin.plugin.compose' /* Optional .env next to this project: S3/update settings and signing (see .env.example). @@ -42,9 +41,9 @@ android { defaultConfig { applicationId "one.shx.strongswan.ext" - compileSdk = 36 - minSdkVersion 23 - targetSdkVersion 36 + compileSdk = 37 + minSdk = 23 + targetSdk = 36 versionCode 159 versionName "2.14.6" @@ -78,6 +77,10 @@ android { externalNativeBuild { ndkBuild { arguments '-j' + Runtime.runtime.availableProcessors() + /* deep checkout paths (e.g. git worktrees) overflow the Windows command line; opt in with -PshortNdkCommands */ + if (project.hasProperty('shortNdkCommands')) { + arguments 'APP_SHORT_COMMANDS=true', 'LOCAL_SHORT_COMMANDS=true' + } abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64' } } @@ -114,7 +117,7 @@ android { Smoke-test a release build on a device before publishing. */ minifyEnabled true shrinkResources true - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.txt' if (keystoreFile) { signingConfig signingConfigs.release } else { @@ -131,11 +134,8 @@ android { } } compileOptions { - targetCompatibility 1.8 - sourceCompatibility 1.8 - } - kotlinOptions { - jvmTarget = '1.8' + targetCompatibility JavaVersion.VERSION_11 + sourceCompatibility JavaVersion.VERSION_11 } buildFeatures { compose true @@ -158,15 +158,15 @@ dependencies { /* BOM 2026.06.01 = compose-ui 1.11.4. The Expressive API (MaterialExpressiveTheme, MotionScheme.expressive, LoadingIndicator, MaterialShapes) lives only in material3 1.5.0-alpha/beta, so material3 is pinned explicitly. - 1.5.0-alpha18 is the newest line that still builds with AGP 8.13 / compileSdk 36: + 1.5.0-beta01 is the newest line that still builds with AGP 8.13 / compileSdk 36: alpha19+ (and 1.5.0-beta01, BOM 2026.09.00 = compose 1.12) require AGP 9.1 and compileSdk 37. Unpin once those are adopted and 1.5.0 is stable. */ - def composeBom = platform('androidx.compose:compose-bom:2026.06.01') + def composeBom = platform('androidx.compose:compose-bom:2026.09.00') implementation composeBom implementation 'androidx.compose.ui:ui' - implementation 'androidx.compose.material3:material3:1.5.0-alpha18' + implementation 'androidx.compose.material3:material3:1.5.0-beta01' /* adaptive-navigation-suite (NavigationSuiteScaffold) requires minSdk 23 */ - implementation 'androidx.compose.material3:material3-adaptive-navigation-suite:1.5.0-alpha18' + implementation 'androidx.compose.material3:material3-adaptive-navigation-suite:1.5.0-beta01' implementation 'androidx.compose.material:material-icons-extended' implementation 'androidx.activity:activity-compose:1.11.0' diff --git a/src/frontends/android/app/src/main/AndroidManifest.xml b/src/frontends/android/app/src/main/AndroidManifest.xml index 4c4f1405f..40f2b91ac 100644 --- a/src/frontends/android/app/src/main/AndroidManifest.xml +++ b/src/frontends/android/app/src/main/AndroidManifest.xml @@ -19,6 +19,9 @@ + + + diff --git a/src/frontends/android/app/src/main/java/org/strongswan/android/ui/compose/ProfileFormScreen.kt b/src/frontends/android/app/src/main/java/org/strongswan/android/ui/compose/ProfileFormScreen.kt index 69db58d8a..3687f5387 100644 --- a/src/frontends/android/app/src/main/java/org/strongswan/android/ui/compose/ProfileFormScreen.kt +++ b/src/frontends/android/app/src/main/java/org/strongswan/android/ui/compose/ProfileFormScreen.kt @@ -47,9 +47,10 @@ import androidx.compose.material3.Button import androidx.compose.material3.Checkbox import androidx.compose.material3.DropdownMenuItem import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.ExposedDropdownMenu import androidx.compose.material3.ExposedDropdownMenuBox import androidx.compose.material3.ExposedDropdownMenuDefaults -import androidx.compose.material3.MenuAnchorType +import androidx.compose.material3.ExposedDropdownMenuAnchorType import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.Icon import androidx.compose.material3.IconButton @@ -411,7 +412,7 @@ fun ProfileFormScreen( enabled = enabled, label = { Text(stringResource(R.string.profile_vpn_type_label)) }, trailingIcon = { ExposedDropdownMenuDefaults.TrailingIcon(typeExpanded) }, - modifier = Modifier.fillMaxWidth().menuAnchor(MenuAnchorType.PrimaryNotEditable), + modifier = Modifier.fillMaxWidth().menuAnchor(ExposedDropdownMenuAnchorType.PrimaryNotEditable), ) ExposedDropdownMenu(expanded = typeExpanded, onDismissRequest = { typeExpanded = false }) { VpnType.values().forEachIndexed { index, type -> @@ -575,7 +576,7 @@ fun ProfileFormScreen( enabled = enabled, label = { Text(stringResource(R.string.profile_select_apps)) }, trailingIcon = { ExposedDropdownMenuDefaults.TrailingIcon(appsExpanded) }, - modifier = Modifier.fillMaxWidth().menuAnchor(MenuAnchorType.PrimaryNotEditable), + modifier = Modifier.fillMaxWidth().menuAnchor(ExposedDropdownMenuAnchorType.PrimaryNotEditable), ) ExposedDropdownMenu(expanded = appsExpanded, onDismissRequest = { appsExpanded = false }) { SelectedAppsHandling.values().forEachIndexed { index, handling -> diff --git a/src/frontends/android/build.gradle b/src/frontends/android/build.gradle index 559f02cc5..f7c497a8d 100644 --- a/src/frontends/android/build.gradle +++ b/src/frontends/android/build.gradle @@ -4,9 +4,9 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:8.13.0' - classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:2.1.20' - classpath 'org.jetbrains.kotlin:compose-compiler-gradle-plugin:2.1.20' + classpath 'com.android.tools.build:gradle:9.1.1' + classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:2.2.21' + classpath 'org.jetbrains.kotlin:compose-compiler-gradle-plugin:2.2.21' } } diff --git a/src/frontends/android/gradle.properties b/src/frontends/android/gradle.properties index efd49da5e..04d2e29c1 100644 --- a/src/frontends/android/gradle.properties +++ b/src/frontends/android/gradle.properties @@ -1,5 +1,4 @@ android.enableJetifier=false -android.nonFinalResIds=false android.nonTransitiveRClass=false android.useAndroidX=true org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8 diff --git a/src/frontends/android/gradle/wrapper/gradle-wrapper.properties b/src/frontends/android/gradle/wrapper/gradle-wrapper.properties index 917b2e631..272eab16c 100644 --- a/src/frontends/android/gradle/wrapper/gradle-wrapper.properties +++ b/src/frontends/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-8.13-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-all.zip