diff --git a/.github/workflows/build-manager.yml b/.github/workflows/build-manager.yml index ccbaf66f56da..5a26eaabe1de 100644 --- a/.github/workflows/build-manager.yml +++ b/.github/workflows/build-manager.yml @@ -137,8 +137,8 @@ jobs: pack_ksuinit: true build-manager: - needs: [generate-key] - if: always() && needs.generate-key.result == 'success' + needs: [generate-key, build-ksud] + if: always() && needs.generate-key.result == 'success' && needs.build-ksud.result == 'success' runs-on: ubuntu-latest defaults: run: @@ -190,14 +190,43 @@ jobs: - name: Setup Android SDK uses: android-actions/setup-android@v4 + - name: Download ARM64 ksud for JNI packaging + uses: actions/download-artifact@v8 + with: + name: ksud-aarch64-linux-android + path: manager/app/src/main/jniLibs/arm64-v8a + + - name: Download x86_64 ksud for JNI packaging + uses: actions/download-artifact@v8 + with: + name: ksud-x86_64-linux-android + path: manager/app/src/main/jniLibs/x86_64 + + - name: Prepare required JNI binaries + run: | + mv app/src/main/jniLibs/arm64-v8a/ksud app/src/main/jniLibs/arm64-v8a/libksud.so + mv app/src/main/jniLibs/x86_64/ksud app/src/main/jniLibs/x86_64/libksud.so + test -s app/src/main/jniLibs/arm64-v8a/libksud.so + test -s app/src/main/jniLibs/x86_64/libksud.so + - name: Build with Gradle run: | if [ "${{ github.event_name }}" = "pull_request" ] || [ "${{ github.event_name }}" = "workflow_dispatch" ]; then - ./gradlew clean assembleRelease -PIS_PR_BUILD=true + ./gradlew clean assembleRelease testDebugUnitTest -PIS_PR_BUILD=true else - ./gradlew clean assembleRelease + ./gradlew clean assembleRelease testDebugUnitTest fi + - name: Upload Manager unit test reports + if: always() + uses: actions/upload-artifact@v7 + with: + name: manager-unit-tests + path: | + manager/app/build/test-results/testDebugUnitTest/ + manager/app/build/reports/tests/testDebugUnitTest/ + if-no-files-found: warn + - name: Upload build artifact if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' || (github.event_name != 'pull_request' && github.event_name != 'workflow_dispatch' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev')) || github.ref_type == 'tag' }} uses: actions/upload-artifact@v7 diff --git a/.github/workflows/ksud-extra.yml b/.github/workflows/ksud-extra.yml index 5ac45f577a55..b509baa4b54b 100644 --- a/.github/workflows/ksud-extra.yml +++ b/.github/workflows/ksud-extra.yml @@ -63,7 +63,7 @@ jobs: userspace/ksud/src/lkm_image_bootstrap.S - name: Build ksud - run: CROSS_NO_WARNINGS=0 cross build --target ${{ inputs.target }} --release --manifest-path ./userspace/ksud/Cargo.toml + run: CROSS_NO_WARNINGS=0 cross build --locked --target ${{ inputs.target }} --release --manifest-path ./userspace/ksud/Cargo.toml - name: Upload ksud artifact uses: actions/upload-artifact@v7 diff --git a/.github/workflows/ksud.yml b/.github/workflows/ksud.yml index 1790551e29f5..7487f562794b 100644 --- a/.github/workflows/ksud.yml +++ b/.github/workflows/ksud.yml @@ -61,6 +61,22 @@ jobs: with: ndk-version: r29 + - name: Install Android check tool + if: inputs.target == 'aarch64-linux-android' + run: cargo install cargo-ndk --version 4.1.2 --locked + + - name: Check Android compilation, lints and format + if: inputs.target == 'aarch64-linux-android' + working-directory: userspace/ksud + env: + ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} + run: | + source ../../.github/scripts/setup-rust-build.sh aarch64-linux-android 26 + cargo ndk -t arm64-v8a --platform 26 check --locked + cargo ndk -t arm64-v8a --platform 26 clippy --locked -- -D warnings + cargo fmt + git diff --exit-code -- '*.rs' + - name: Build ksud env: ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} @@ -72,7 +88,7 @@ jobs: fi echo "KSU_PACKAGE_NAME=${KSU_PACKAGE_NAME:-default}" source .github/scripts/setup-rust-build.sh ${{ inputs.target }} 26 - cargo build --target $TRIPLE --release --manifest-path ./userspace/ksud/Cargo.toml + cargo build --locked --target $TRIPLE --release --manifest-path ./userspace/ksud/Cargo.toml - name: Upload ksud artifact uses: actions/upload-artifact@v7 diff --git a/.github/workflows/ksuinit.yml b/.github/workflows/ksuinit.yml index 998ffa932c8b..94433b73306d 100644 --- a/.github/workflows/ksuinit.yml +++ b/.github/workflows/ksuinit.yml @@ -38,7 +38,7 @@ jobs: BUILTINS="$($CLANG_PATH --print-resource-dir)/lib/linux/libclang_rt.builtins-aarch64-android.a" test -f "$BUILTINS" export RUSTFLAGS="-C target-feature=+crt-static -C link-arg=-Wl,-z,max-page-size=16384 -C link-arg=-Wno-unused-command-line-argument -C link-arg=$BUILTINS" - cargo build --package ksuinit --target=aarch64-linux-android --release + cargo build --locked --package ksuinit --target=aarch64-linux-android --release - name: Upload ksuinit artifact uses: actions/upload-artifact@v7 @@ -54,7 +54,10 @@ jobs: BUILTINS="$($CLANG_PATH --print-resource-dir)/lib/linux/libclang_rt.builtins-x86_64-android.a" test -f "$BUILTINS" export RUSTFLAGS="-C target-feature=+crt-static -C link-arg=-Wl,-z,max-page-size=16384 -C link-arg=-Wno-unused-command-line-argument -C link-arg=$BUILTINS" - cargo build --package ksuinit --target=x86_64-linux-android --release + cargo build --locked --package ksuinit --target=x86_64-linux-android --release + + - name: Run loader and contract host regressions + run: cargo test --locked --package ksuinit --package ksu-contracts --lib - name: Upload x64 ksuinit artifact uses: actions/upload-artifact@v7 diff --git a/Cargo.lock b/Cargo.lock index 3ff8dffa4777..86c4fb3de963 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5,7 +5,7 @@ version = 4 [[package]] name = "adb_client" version = "3.1.1" -source = "git+https://github.com/Kernel-SU/adb_client#d97a966435bebaa55017834869dec08150826aa7" +source = "git+https://github.com/5ec1cff/adb_client?rev=d97a966435bebaa55017834869dec08150826aa7#d97a966435bebaa55017834869dec08150826aa7" dependencies = [ "byteorder", "log", @@ -927,7 +927,7 @@ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" [[package]] name = "java-properties" version = "2.0.0" -source = "git+https://github.com/Kernel-SU/java-properties.git?branch=master#42a4aa941b70ded2dd3be9e9f892471023e70229" +source = "git+https://github.com/MySU-org/java-properties.git?rev=42a4aa941b70ded2dd3be9e9f892471023e70229#42a4aa941b70ded2dd3be9e9f892471023e70229" dependencies = [ "encoding_rs", "lazy_static", @@ -1369,7 +1369,7 @@ dependencies = [ [[package]] name = "prop-rs" version = "0.2.0" -source = "git+https://github.com/Kernel-SU/ksu_props?rev=6f5723105d8d4cacad31d83d343defbf032c7b33#6f5723105d8d4cacad31d83d343defbf032c7b33" +source = "git+https://github.com/MySU-org/ksu_props?rev=6f5723105d8d4cacad31d83d343defbf032c7b33#6f5723105d8d4cacad31d83d343defbf032c7b33" dependencies = [ "prost", ] @@ -1377,7 +1377,7 @@ dependencies = [ [[package]] name = "prop-rs-android" version = "0.2.0" -source = "git+https://github.com/Kernel-SU/ksu_props?rev=6f5723105d8d4cacad31d83d343defbf032c7b33#6f5723105d8d4cacad31d83d343defbf032c7b33" +source = "git+https://github.com/MySU-org/ksu_props?rev=6f5723105d8d4cacad31d83d343defbf032c7b33#6f5723105d8d4cacad31d83d343defbf032c7b33" dependencies = [ "libc", "log", @@ -1547,7 +1547,7 @@ checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d" [[package]] name = "rustix" version = "0.38.34" -source = "git+https://github.com/Kernel-SU/rustix.git?rev=4a53fbc#4a53fbc7cb7a07cabe87125cc21dbc27db316259" +source = "git+https://github.com/MySU-org/rustix.git?rev=4a53fbc7cb7a07cabe87125cc21dbc27db316259#4a53fbc7cb7a07cabe87125cc21dbc27db316259" dependencies = [ "bitflags 2.13.1", "errno 0.3.14", diff --git a/docs/superpowers/plans/2026-10-14-manager-expressive-review.md b/docs/superpowers/plans/2026-10-14-manager-expressive-review.md new file mode 100644 index 000000000000..d4da761fd774 --- /dev/null +++ b/docs/superpowers/plans/2026-10-14-manager-expressive-review.md @@ -0,0 +1,83 @@ +# Manager Expressive review + +User direction: audit Material 3 Expressive, prefer native components; GKI is +not a mandatory eligibility label. Preserve exact target/module validation. + +## Implementation plan + +- [x] Remove kernel-version-based GKI gating from home/install/environment UI; + report absent/unrecognized KernelSU without claiming unsupported hardware. +- [x] Use native Expressive theme defaults, paired color roles, accessible native + toggle semantics and labelled search actions; retain native navigation/sheets. +- [ ] Check changed behavior with focused tests and required Manager build. +- [ ] Record findings, validation outcomes and physical visual-review limits. +- [ ] Restore unreachable Rust dependency sources with unchanged commit pins; + complete the full CI chain before producing the APK, as selected by the user. + +## Findings and validation + +Corrected: non-GKI version heuristic incorrectly produced an unsupported hero, +failed environment verdict and hidden direct install; native working mode was +suppressed. Missing KernelSU/Manager access now remains unknown; Built-in and +LKM describe actual mode. Direct install availability follows root availability; +the patcher's exact image/module contracts still decide compatibility. + +Corrected: Switch rows lacked switch semantics; preset rows had independent +row and radio click actions. Native toggleable/selectable roles now provide one +logical action per row; radio groups expose group semantics. Search close/clear +actions have localized descriptions. Native Expressive typography defaults +replace the theme override; theme colors no longer animate through arbitrary +global spring values. The update card uses its matching on-container color. +Module preview identity text uses remaining width and wraps at larger fonts. + +Existing native scaffold/app bars, navigation, search, dialogs, segmented controls, +text fields and ModalBottomSheet are retained; no replacement control library, +dependency upgrade, public API, IOCTL, kernel/loader code or policy bypass added. + +Local checks: git diff --check passes; edited English/Chinese resources parse +and have no duplicate string names. Manager Gradle 9.7.0 downloaded successfully, +but clean assembleRelease testDebugUnitTest stopped during configuration because +Android SDK is absent. No local compilation/test success is claimed. +User requested GitHub Actions. Existing Build Manager now waits for ksud and +places both JNI binaries before Gradle, runs existing unit tests, and uploads +test reports. PR workflow builds use a separate test package/signer and do not +prove production Manager authorization on the installed Canary candidate. + +Visual limits: captured installed-app frame was partly covered by a user video +overlay and does not represent the modified build. No full visual/font/TalkBack/ +rotation/reduced-motion acceptance is claimed. Device evidence stays local. + +## Rust build-chain repair + +First PR CI run 38460711816 failed before Manager compilation: the fixed +Kernel-SU/adb_client source was unreachable. All four Kernel-SU dependency +repositories return 404 through authenticated API reads. User chose to repair +the full build chain rather than use an old daemon merely for UI compilation. + +Recovered the exact existing commit objects from public repositories: + +| Dependency | Reachable source | Unchanged commit | +| --- | --- | --- | +| adb_client | 5ec1cff/adb_client | d97a966435bebaa55017834869dec08150826aa7 | +| java-properties | MySU-org/java-properties | 42a4aa941b70ded2dd3be9e9f892471023e70229 | +| prop-rs / prop-rs-android | MySU-org/ksu_props | 6f5723105d8d4cacad31d83d343defbf032c7b33 | +| ksuinit rustix | MySU-org/rustix | 4a53fbc7cb7a07cabe87125cc21dbc27db316259 | + +Only source URLs and explicit full rev selectors change in manifests/lockfile; +crate versions, checksums, features and dependency edges are preserved. Source +commit objects were found by exact SHA, not selected from a moving default branch. +CI Rust builds now use --locked, ARM64 checks run cargo ndk check, clippy and fmt +in sequence, and loader/contract host regressions run before publishing artifacts. + +Local cargo ndk check/clippy were attempted but cargo-ndk and NDK are absent; +cargo fmt succeeded outside the sandbox after access denial inside it. Android +compilation/lint evidence must come from the full CI run, not plain host checks. + +Context7 is unavailable in this session. Primary references inspected: +https://developer.android.com/develop/ui/compose/designsystems/material3 +https://developer.android.com/develop/ui/compose/accessibility/api-defaults +https://developer.android.com/jetpack/androidx/releases/compose-material3 +https://m3.material.io/blog/building-with-m3-expressive (JS-only response). +Keep Material 3 1.5.0-alpha26 pinned. Native components already in use include +LargeFlexibleTopAppBar, ShortNavigationBar, WideNavigationRail, SearchBar, +SegmentedListItem, Switch, OutlinedTextField, AlertDialog and ModalBottomSheet. diff --git a/docs/superpowers/specs/2026-10-12-manager-material3-expressive-native.md b/docs/superpowers/specs/2026-10-12-manager-material3-expressive-native.md index 875aae0d2425..3ea54b72ade1 100644 --- a/docs/superpowers/specs/2026-10-12-manager-material3-expressive-native.md +++ b/docs/superpowers/specs/2026-10-12-manager-material3-expressive-native.md @@ -5,6 +5,14 @@ Manager code and local build/tests completed, physical-device acceptance pending Scope: Android phone/tablet Manager, including experimental-loader settings and operation screens. Wear OS components are not used for this application. +2026-10-14 review: GKI is not a mandatory UI eligibility condition. A kernel +version heuristic must not label the device unsupported, hide installation +choices or suppress the actual working mode. Missing Manager access is an +unknown installation/authorization state. Integrated mode is labelled Built-in; +LKM remains LKM. Selected image/module identity, page size, API, ABI, signature +and recovery requirements retain their own validation; this UI policy does not +claim support for arbitrary non-GKI targets. + This is the authoritative visual direction, superseding the restrained iOS-style presentation in the earlier Manager plan and the custom-helper-first policy in the older Expressive UI system. Repository and loader verification requirements diff --git a/manager/app/src/main/java/me/weishu/kernelsu/data/repository/EnvCheckRepositoryImpl.kt b/manager/app/src/main/java/me/weishu/kernelsu/data/repository/EnvCheckRepositoryImpl.kt index 1c4a1048fde1..dd3f3f75205e 100644 --- a/manager/app/src/main/java/me/weishu/kernelsu/data/repository/EnvCheckRepositoryImpl.kt +++ b/manager/app/src/main/java/me/weishu/kernelsu/data/repository/EnvCheckRepositoryImpl.kt @@ -5,7 +5,6 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import me.weishu.kernelsu.Natives import me.weishu.kernelsu.R -import me.weishu.kernelsu.getKernelVersion import me.weishu.kernelsu.data.model.EnvCheckGroup import me.weishu.kernelsu.data.model.EnvCheckItem import me.weishu.kernelsu.data.model.EnvCheckReport @@ -49,7 +48,6 @@ class EnvCheckRepositoryImpl( private fun rootItems(): List { val ksuVersion = runCatching { Natives.version }.getOrNull()?.takeIf { it > 0 } - val kernel = getKernelVersion() val ksuTitle = str(R.string.env_check_item_kernelsu) return buildList { when { @@ -63,22 +61,13 @@ class EnvCheckRepositoryImpl( raw = ksuVersion.toString(), ) ) - kernel.isGKI() -> add( - item( - id = "root_not_installed", - group = EnvCheckGroup.Root, - title = ksuTitle, - detail = str(R.string.env_check_root_not_installed), - severity = EnvCheckSeverity.Fail, - ) - ) else -> add( item( - id = "root_unsupported", + id = "root_not_detected", group = EnvCheckGroup.Root, title = ksuTitle, - detail = str(R.string.env_check_root_unsupported), - severity = EnvCheckSeverity.Fail, + detail = str(R.string.home_not_detected_summary), + severity = EnvCheckSeverity.Unknown, ) ) } @@ -91,10 +80,10 @@ class EnvCheckRepositoryImpl( title = str(R.string.env_check_item_working_mode), detail = when (lkm) { true -> str(R.string.env_check_mode_lkm) - false -> str(R.string.env_check_mode_gki) + false -> str(R.string.working_mode_builtin) null -> str(R.string.env_check_unknown) }, - severity = if (lkm == false) EnvCheckSeverity.Warn else EnvCheckSeverity.Pass, + severity = if (lkm == null) EnvCheckSeverity.Unknown else EnvCheckSeverity.Pass, raw = lkm?.toString().orEmpty(), ) ) diff --git a/manager/app/src/main/java/me/weishu/kernelsu/ui/component/material/ExpressiveCards.kt b/manager/app/src/main/java/me/weishu/kernelsu/ui/component/material/ExpressiveCards.kt index da1706a146b6..95d0b7f134b7 100644 --- a/manager/app/src/main/java/me/weishu/kernelsu/ui/component/material/ExpressiveCards.kt +++ b/manager/app/src/main/java/me/weishu/kernelsu/ui/component/material/ExpressiveCards.kt @@ -22,7 +22,6 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.vector.ImageVector -import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp @@ -67,8 +66,7 @@ fun ExpressiveHeroCard( } Text( text = title, - style = MaterialTheme.typography.headlineSmall, - fontWeight = FontWeight.Medium, + style = MaterialTheme.typography.headlineSmallEmphasized, ) if (tags != null) { Spacer(Modifier.height(8.dp)) diff --git a/manager/app/src/main/java/me/weishu/kernelsu/ui/component/material/SearchBar.kt b/manager/app/src/main/java/me/weishu/kernelsu/ui/component/material/SearchBar.kt index 67c632b8a1a4..af998480bc87 100644 --- a/manager/app/src/main/java/me/weishu/kernelsu/ui/component/material/SearchBar.kt +++ b/manager/app/src/main/java/me/weishu/kernelsu/ui/component/material/SearchBar.kt @@ -51,6 +51,8 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.platform.LocalFocusManager import androidx.compose.ui.platform.LocalSoftwareKeyboardController +import androidx.compose.ui.res.stringResource +import me.weishu.kernelsu.R import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp import kotlinx.coroutines.flow.distinctUntilChanged @@ -160,7 +162,7 @@ fun SearchAppBar( contentColor = MaterialTheme.colorScheme.onSurfaceVariant, ), ) { - Icon(Icons.AutoMirrored.Rounded.ArrowBack, null) + Icon(Icons.AutoMirrored.Rounded.ArrowBack, stringResource(R.string.search_close)) } } else { Icon(Icons.Filled.Search, null) @@ -170,7 +172,7 @@ fun SearchAppBar( if (isSearchExpanded && currentQuery.isNotEmpty()) { IconButton( onClick = { clearSearchText() }, - content = { Icon(Icons.Filled.Close, null) } + content = { Icon(Icons.Filled.Close, stringResource(R.string.search_clear)) } ) } }, diff --git a/manager/app/src/main/java/me/weishu/kernelsu/ui/component/material/SegmentedList.kt b/manager/app/src/main/java/me/weishu/kernelsu/ui/component/material/SegmentedList.kt index 45f8835fc76b..d37ca8fc2c46 100644 --- a/manager/app/src/main/java/me/weishu/kernelsu/ui/component/material/SegmentedList.kt +++ b/manager/app/src/main/java/me/weishu/kernelsu/ui/component/material/SegmentedList.kt @@ -4,6 +4,7 @@ import androidx.compose.animation.core.animateDpAsState import androidx.compose.animation.core.animateFloatAsState import androidx.compose.animation.core.spring import androidx.compose.foundation.interaction.MutableInteractionSource +import androidx.compose.foundation.selection.toggleable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column @@ -44,6 +45,8 @@ import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.semantics.Role import androidx.compose.ui.focus.FocusRequester import androidx.compose.ui.focus.focusRequester import androidx.compose.ui.focus.onFocusChanged @@ -210,7 +213,7 @@ fun SegmentedListItem( trailingContent: @Composable (() -> Unit)? = null, ) { if (onClick == null && onLongClick == null) { - androidx.compose.material3.ListItem(modifier = modifier, headlineContent = headlineContent, + androidx.compose.material3.ListItem(modifier = modifier, colors = colors, headlineContent = headlineContent, overlineContent = overlineContent, supportingContent = supportingContent, leadingContent = leadingContent, trailingContent = trailingContent) return @@ -312,9 +315,15 @@ fun SegmentedSwitchItem( val interactionSource = remember { MutableInteractionSource() } SegmentedListItem( - onClick = { + modifier = Modifier.clip( + (LocalListItemShapes.current ?: ListItemDefaults.segmentedShapes(0, 1)).shape + ).toggleable( + value = checked, + enabled = enabled, + role = Role.Switch, + ) { haptic.performHapticFeedback(HapticFeedbackType.VirtualKey) - onCheckedChange(!checked) + onCheckedChange(it) }, enabled = enabled, interactionSource = interactionSource, diff --git a/manager/app/src/main/java/me/weishu/kernelsu/ui/component/module/ModuleSheetHost.kt b/manager/app/src/main/java/me/weishu/kernelsu/ui/component/module/ModuleSheetHost.kt index 9d1813481d4c..595578327ef7 100644 --- a/manager/app/src/main/java/me/weishu/kernelsu/ui/component/module/ModuleSheetHost.kt +++ b/manager/app/src/main/java/me/weishu/kernelsu/ui/component/module/ModuleSheetHost.kt @@ -86,7 +86,7 @@ fun ModuleSheetHost(onViewDetails: (RepoModuleArg) -> Unit) { item { Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(16.dp)) { ModuleArtwork(module.iconUrl, null, Modifier.size(64.dp)) - Column { + Column(Modifier.weight(1f)) { Text(module.moduleName.ifBlank { module.moduleId }, style = MaterialTheme.typography.headlineSmall) Text(module.authors, style = MaterialTheme.typography.bodyMedium) } diff --git a/manager/app/src/main/java/me/weishu/kernelsu/ui/screen/experimentalloader/ExperimentalLoaderSettingsScreen.kt b/manager/app/src/main/java/me/weishu/kernelsu/ui/screen/experimentalloader/ExperimentalLoaderSettingsScreen.kt index e7dcdeaa9a8c..b0d578b050a4 100644 --- a/manager/app/src/main/java/me/weishu/kernelsu/ui/screen/experimentalloader/ExperimentalLoaderSettingsScreen.kt +++ b/manager/app/src/main/java/me/weishu/kernelsu/ui/screen/experimentalloader/ExperimentalLoaderSettingsScreen.kt @@ -3,7 +3,9 @@ package me.weishu.kernelsu.ui.screen.experimentalloader import android.util.AtomicFile import androidx.activity.compose.rememberLauncherForActivityResult import androidx.activity.result.contract.ActivityResultContracts -import androidx.compose.foundation.clickable +import androidx.compose.foundation.selection.selectable +import androidx.compose.foundation.selection.selectableGroup +import androidx.compose.foundation.selection.toggleable import androidx.compose.foundation.layout.* import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.material.icons.Icons @@ -11,6 +13,7 @@ import androidx.compose.material.icons.automirrored.outlined.ArrowBack import androidx.compose.material3.* import androidx.compose.runtime.* import androidx.compose.ui.Modifier +import androidx.compose.ui.semantics.Role import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp @@ -95,23 +98,30 @@ fun ExperimentalLoaderSettingsScreen() { } item { Text(stringResource(R.string.loader_preferences_preset), style = MaterialTheme.typography.titleLarge) - listOf("balanced", "lean", "diagnostic").forEach { name -> - ListItem(modifier = Modifier.clickable(enabled = ready && !saving) { draft = draft.withPreset(name) }, - headlineContent = { Text(stringResource(when(name) { "balanced" -> R.string.loader_preferences_balanced; "lean" -> R.string.loader_preferences_lean; else -> R.string.loader_preferences_diagnostic })) }, trailingContent = { RadioButton(selected = draft.preset == name, - enabled = ready && !saving, onClick = { draft = draft.withPreset(name) }) }) + Column(Modifier.selectableGroup()) { + listOf("balanced", "lean", "diagnostic").forEach { name -> + PreferenceRadioItem( + label = stringResource(when(name) { "balanced" -> R.string.loader_preferences_balanced; "lean" -> R.string.loader_preferences_lean; else -> R.string.loader_preferences_diagnostic }), + selected = draft.preset == name, enabled = ready && !saving, + onClick = { draft = draft.withPreset(name) }, + ) + } } } item { - ListItem(headlineContent = { Text(stringResource(R.string.loader_preferences_capture)) }, + ListItem(modifier = Modifier.toggleable(value = effective["kernel_log"] == "true", + enabled = ready && !saving, role = Role.Switch, + onValueChange = { set("kernel_log", it.toString()) }), + headlineContent = { Text(stringResource(R.string.loader_preferences_capture)) }, trailingContent = { Switch(effective["kernel_log"] == "true", enabled = ready && !saving, - onCheckedChange = { set("kernel_log", it.toString()) }) }) + onCheckedChange = null) }) Text(stringResource(R.string.loader_preferences_buffer), style = MaterialTheme.typography.titleMedium) if (androidx.compose.ui.platform.LocalDensity.current.fontScale > 1.3f) { - listOf("8", "16", "32", "64").forEach { value -> - ListItem(headlineContent = { Text("$value KiB") }, trailingContent = { - RadioButton(selected = effective["io_buffer_kib"] == value, enabled = ready && !saving, - onClick = { set("io_buffer_kib", value) }) - }) + Column(Modifier.selectableGroup()) { + listOf("8", "16", "32", "64").forEach { value -> + PreferenceRadioItem(label = "$value KiB", selected = effective["io_buffer_kib"] == value, + enabled = ready && !saving, onClick = { set("io_buffer_kib", value) }) + } } } else SingleChoiceSegmentedButtonRow { listOf("8", "16", "32", "64").forEachIndexed { index, value -> @@ -123,16 +133,20 @@ fun ExperimentalLoaderSettingsScreen() { } item { Text(stringResource(R.string.loader_preferences_output), style = MaterialTheme.typography.titleMedium) - listOf("json", "text").forEach { value -> - ListItem(headlineContent = { Text(if (value == "json") "JSON" else stringResource(R.string.loader_preferences_text)) }, - trailingContent = { RadioButton(selected = effective["output"] == value, enabled = ready && !saving, - onClick = { set("output", value) }) }) + Column(Modifier.selectableGroup()) { + listOf("json", "text").forEach { value -> + PreferenceRadioItem(label = if (value == "json") "JSON" else stringResource(R.string.loader_preferences_text), + selected = effective["output"] == value, enabled = ready && !saving, + onClick = { set("output", value) }) + } } Text(stringResource(R.string.loader_preferences_verbosity), style = MaterialTheme.typography.titleMedium) - listOf("error", "normal", "debug").forEach { value -> - ListItem(headlineContent = { Text(stringResource(when(value) { "error" -> R.string.loader_preferences_error; "normal" -> R.string.loader_preferences_normal; else -> R.string.loader_preferences_debug })) }, - trailingContent = { RadioButton(selected = effective["verbosity"] == value, enabled = ready && !saving, - onClick = { set("verbosity", value) }) }) + Column(Modifier.selectableGroup()) { + listOf("error", "normal", "debug").forEach { value -> + PreferenceRadioItem(label = stringResource(when(value) { "error" -> R.string.loader_preferences_error; "normal" -> R.string.loader_preferences_normal; else -> R.string.loader_preferences_debug }), + selected = effective["verbosity"] == value, enabled = ready && !saving, + onClick = { set("verbosity", value) }) + } } Text(stringResource(R.string.loader_preferences_log_limit, effective["log_limit_kib"]!!.toInt())) Slider(value = effective["log_limit_kib"]!!.toFloat(), onValueChange = { set("log_limit_kib", it.toInt().toString()) }, @@ -191,3 +205,12 @@ fun ExperimentalLoaderSettingsScreen() { } } } + +@Composable +private fun PreferenceRadioItem(label: String, selected: Boolean, enabled: Boolean, onClick: () -> Unit) { + ListItem( + modifier = Modifier.selectable(selected = selected, enabled = enabled, role = Role.RadioButton, onClick = onClick), + headlineContent = { Text(label) }, + trailingContent = { RadioButton(selected = selected, enabled = enabled, onClick = null) }, + ) +} diff --git a/manager/app/src/main/java/me/weishu/kernelsu/ui/screen/home/HomeMaterial.kt b/manager/app/src/main/java/me/weishu/kernelsu/ui/screen/home/HomeMaterial.kt index 264589696e10..04a2bba274ad 100644 --- a/manager/app/src/main/java/me/weishu/kernelsu/ui/screen/home/HomeMaterial.kt +++ b/manager/app/src/main/java/me/weishu/kernelsu/ui/screen/home/HomeMaterial.kt @@ -23,7 +23,6 @@ import androidx.compose.foundation.layout.size import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.outlined.Block import androidx.compose.material.icons.outlined.CheckCircle import androidx.compose.material.icons.outlined.Download import androidx.compose.material.icons.outlined.HealthAndSafety @@ -32,6 +31,7 @@ import androidx.compose.material.icons.outlined.OpenInNew import androidx.compose.material.icons.outlined.SystemUpdateAlt import androidx.compose.material.icons.outlined.Warning import androidx.compose.material3.CircularProgressIndicator +import androidx.compose.material3.contentColorFor import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.LargeFlexibleTopAppBar import androidx.compose.material3.MaterialTheme @@ -103,9 +103,6 @@ fun HomePagerMaterial( WarningCard(stringResource(id = R.string.home_pr_kernel_warning), level = WarningLevel.Notice) } // Version mismatch is already reflected on the status hero — skip duplicate notice. - if (state.showGkiWarning) { - WarningCard(stringResource(id = R.string.home_gki_warning), level = WarningLevel.Notice) - } if (state.showUAPIMisMatchWarning) { WarningCard( stringResource( @@ -187,6 +184,7 @@ private fun HuskyUpdateCard( } else { MaterialTheme.colorScheme.surfaceBright } + val contentColor = contentColorFor(containerColor) val otaTitle = stringResource(R.string.husky_ota_slot_title) val otaSummary = stringResource(R.string.husky_ota_slot_summary) @@ -196,6 +194,7 @@ private fun HuskyUpdateCard( TonalCard( shape = MaterialTheme.shapes.extraLarge, containerColor = containerColor, + contentColor = contentColor, ) { Column( modifier = Modifier @@ -214,7 +213,7 @@ private fun HuskyUpdateCard( Text( text = lkmSummary, style = MaterialTheme.typography.bodyMedium, - color = MaterialTheme.colorScheme.onSurfaceVariant, + color = contentColor, maxLines = 6, overflow = TextOverflow.Ellipsis, ) @@ -295,7 +294,7 @@ private fun HuskyUpdateCard( Text( text = otaSummary, style = MaterialTheme.typography.bodyMedium, - color = MaterialTheme.colorScheme.onSurfaceVariant, + color = contentColor, ) ExpressivePrimaryBar( label = otaAction, @@ -387,20 +386,19 @@ private fun StatusCard( actions: HomeActions, ) { val ksuActive = state.ksuVersion != null - val notInstalled = !ksuActive && state.kernelVersion.isGKI() + val notInstalled = !ksuActive val versionMismatch = state.showVersionMismatchWarning val containerColor = when { versionMismatch -> MaterialTheme.colorScheme.tertiaryContainer ksuActive -> MaterialTheme.colorScheme.secondaryContainer - else -> MaterialTheme.colorScheme.errorContainer + else -> MaterialTheme.colorScheme.surfaceContainerHigh } val statusIcon = when { versionMismatch -> Icons.Outlined.Warning ksuActive -> Icons.Outlined.CheckCircle - notInstalled -> Icons.Outlined.Warning - else -> Icons.Outlined.Block + else -> Icons.Outlined.Info } val statusTitle = when { versionMismatch -> stringResource( @@ -409,8 +407,7 @@ private fun StatusCard( state.ksuVersion ?: 0, ) ksuActive -> stringResource(R.string.home_working) - notInstalled -> stringResource(R.string.home_not_installed) - else -> stringResource(R.string.home_unsupported) + else -> stringResource(R.string.home_not_detected) } val statusSummary = when { versionMismatch -> stringResource( @@ -418,14 +415,13 @@ private fun StatusCard( "${state.ksuVersion}-${state.kernelUAPIVersion}", ) ksuActive -> stringResource(R.string.home_working_version, "${state.ksuVersion}-${state.kernelUAPIVersion}") - notInstalled -> stringResource(R.string.home_click_to_install) - else -> stringResource(R.string.home_unsupported_reason) + else -> stringResource(R.string.home_not_detected_summary) } val workingMode = if (ksuActive) { when (state.lkmMode) { null -> "" true -> "LKM" - else -> "GKI" + else -> stringResource(R.string.working_mode_builtin) } } else "" @@ -486,7 +482,6 @@ private fun EnvSummaryCard( summary = summary, icon = Icons.Outlined.HealthAndSafety, containerColor = containerColor, - onClick = actions.onOpenEnvCheck, footer = { Column(verticalArrangement = Arrangement.spacedBy(8.dp)) { if (state.envAlignAvailable) { diff --git a/manager/app/src/main/java/me/weishu/kernelsu/ui/screen/home/HomeUiState.kt b/manager/app/src/main/java/me/weishu/kernelsu/ui/screen/home/HomeUiState.kt index 3391ed1149ef..c2d9a66756e2 100644 --- a/manager/app/src/main/java/me/weishu/kernelsu/ui/screen/home/HomeUiState.kt +++ b/manager/app/src/main/java/me/weishu/kernelsu/ui/screen/home/HomeUiState.kt @@ -44,9 +44,6 @@ data class HomeUiState( val isFullFeatured: Boolean get() = isManager && !requiresNewKernel && isRootAvailable - val showGkiWarning: Boolean - get() = ksuVersion != null && lkmMode == false - val showRequireKernelWarning: Boolean get() = isManager && requiresNewKernel diff --git a/manager/app/src/main/java/me/weishu/kernelsu/ui/screen/install/InstallScreen.kt b/manager/app/src/main/java/me/weishu/kernelsu/ui/screen/install/InstallScreen.kt index f512333cb060..bdca489ba6f5 100644 --- a/manager/app/src/main/java/me/weishu/kernelsu/ui/screen/install/InstallScreen.kt +++ b/manager/app/src/main/java/me/weishu/kernelsu/ui/screen/install/InstallScreen.kt @@ -23,7 +23,6 @@ import kotlinx.coroutines.CancellationException import kotlinx.coroutines.Job import kotlinx.coroutines.launch import me.weishu.kernelsu.R -import me.weishu.kernelsu.getKernelVersion import me.weishu.kernelsu.ui.component.choosekmidialog.ChooseKmiDialog import me.weishu.kernelsu.ui.component.dialog.DownloadDialog import me.weishu.kernelsu.ui.component.dialog.rememberLoadingDialog @@ -67,13 +66,11 @@ fun InstallScreen() { val defaultPartition by produceState(initialValue = "") { value = getDefaultPartition() } val rootAvailable by produceState(initialValue = false) { value = rootAvailable() } val isAbDevice by produceState(initialValue = false) { value = isAbDevice() } - val isGkiDevice by produceState(initialValue = false) { value = getKernelVersion().isGKI() } - val selectFileTip = stringResource(id = R.string.select_file_tip, defaultPartition) - val selectFileTipNoGki = stringResource(id = R.string.select_file_tip_nogki) val downloadFileMsg = stringResource(id = R.string.download_dialog_msg) - val selectFileSummary = if (isGkiDevice) selectFileTip else selectFileTipNoGki - val canDirectInstall = rootAvailable && isGkiDevice + val selectFileSummary = selectFileTip + // Eligibility is checked against the selected image/module by the patcher. + val canDirectInstall = rootAvailable LaunchedEffect(canDirectInstall, installMethod) { when { installMethod is InstallMethod.DownloadFile -> { @@ -88,7 +85,6 @@ fun InstallScreen() { val installMethodOptions = remember( rootAvailable, isAbDevice, - isGkiDevice, selectFileSummary, advancedOptionsShown, installMethod, @@ -227,7 +223,7 @@ fun InstallScreen() { ) { if (it.resultCode == Activity.RESULT_OK) { it.data?.data?.let { uri -> - installMethod = InstallMethod.SelectFile(uri, summary = if (isGkiDevice) selectFileTip else selectFileTipNoGki) + installMethod = InstallMethod.SelectFile(uri, summary = selectFileSummary) } } } diff --git a/manager/app/src/main/java/me/weishu/kernelsu/ui/theme/MaterialTheme.kt b/manager/app/src/main/java/me/weishu/kernelsu/ui/theme/MaterialTheme.kt index 0a6a4e0fb004..0459e3375c32 100644 --- a/manager/app/src/main/java/me/weishu/kernelsu/ui/theme/MaterialTheme.kt +++ b/manager/app/src/main/java/me/weishu/kernelsu/ui/theme/MaterialTheme.kt @@ -37,12 +37,9 @@ fun MaterialKernelSUTheme( } } - val animatedColorScheme = colorScheme.animateAsState() - MaterialExpressiveTheme( - colorScheme = animatedColorScheme, + colorScheme = colorScheme, motionScheme = MotionScheme.expressive(), - typography = Typography, content = { MonetColorsProvider.UpdateCss(colorScheme) content() diff --git a/manager/app/src/main/java/me/weishu/kernelsu/ui/viewmodel/HomeViewModel.kt b/manager/app/src/main/java/me/weishu/kernelsu/ui/viewmodel/HomeViewModel.kt index 9e386713e4f6..ee254b7c8c84 100644 --- a/manager/app/src/main/java/me/weishu/kernelsu/ui/viewmodel/HomeViewModel.kt +++ b/manager/app/src/main/java/me/weishu/kernelsu/ui/viewmodel/HomeViewModel.kt @@ -251,7 +251,7 @@ class HomeViewModel( val ksuVersion = if (isManager) Natives.version else null val kernelUAPIVersion = if (isManager) Natives.kernelUAPIVersion else null val managerUAPIVersion = Natives.managerUAPIVersion - val lkmMode = ksuVersion?.let { if (kernelVersion.isGKI()) Natives.isLkmMode else null } + val lkmMode = ksuVersion?.let { Natives.isLkmMode } val isRootAvailable = rootAvailable() val managerVersion = getManagerVersion(ksuApp) diff --git a/manager/app/src/main/res/values-zh-rCN/strings.xml b/manager/app/src/main/res/values-zh-rCN/strings.xml index 8a23fe131ef6..5570d913eff4 100644 --- a/manager/app/src/main/res/values-zh-rCN/strings.xml +++ b/manager/app/src/main/res/values-zh-rCN/strings.xml @@ -1,5 +1,10 @@ + 未检测到 KernelSU + 请检查安装情况与管理器授权。兼容性需要根据目标镜像和模块核验,GKI 并非必要条件。 + 内置 + 关闭搜索 + 清空搜索 主页 未安装 点击安装 diff --git a/manager/app/src/main/res/values/strings.xml b/manager/app/src/main/res/values/strings.xml index 15071cb86bdb..630d15ff8a4c 100644 --- a/manager/app/src/main/res/values/strings.xml +++ b/manager/app/src/main/res/values/strings.xml @@ -1,5 +1,10 @@ + KernelSU not detected + Check installation and Manager authorization. Compatibility must be checked against the target image and module; GKI is not a requirement. + Built-in + Close search + Clear search Home Not installed Tap to install diff --git a/userspace/ksud/Cargo.toml b/userspace/ksud/Cargo.toml index 4928d6679e59..96b432156375 100644 --- a/userspace/ksud/Cargo.toml +++ b/userspace/ksud/Cargo.toml @@ -43,7 +43,7 @@ zip-extensions = { version = "0.14", features = [ "lzma", "xz", ], default-features = false } -java-properties = { git = "https://github.com/Kernel-SU/java-properties.git", branch = "master", default-features = false } +java-properties = { git = "https://github.com/MySU-org/java-properties.git", rev = "42a4aa941b70ded2dd3be9e9f892471023e70229", default-features = false } serde_json = "1" encoding_rs = "0.8" humansize = "2" @@ -55,8 +55,8 @@ nom = "8" derive-new = "0.7" getopts = "0.2" ksuinit = { path = "../ksuinit" } -adb_client = { git = "https://github.com/Kernel-SU/adb_client" } -prop-rs-android = { git = "https://github.com/Kernel-SU/ksu_props", rev = "6f5723105d8d4cacad31d83d343defbf032c7b33" } +adb_client = { git = "https://github.com/5ec1cff/adb_client", rev = "d97a966435bebaa55017834869dec08150826aa7" } +prop-rs-android = { git = "https://github.com/MySU-org/ksu_props", rev = "6f5723105d8d4cacad31d83d343defbf032c7b33" } [build-dependencies] bindgen = "0.72" diff --git a/userspace/ksuinit/Cargo.toml b/userspace/ksuinit/Cargo.toml index b7ce9eabdc25..d9731d8c0636 100644 --- a/userspace/ksuinit/Cargo.toml +++ b/userspace/ksuinit/Cargo.toml @@ -13,7 +13,7 @@ scroll = "0.13" anyhow.workspace = true ksu-contracts = { path = "../ksu-contracts" } -rustix = { git = "https://github.com/Kernel-SU/rustix.git", rev = "4a53fbc", features = ["mount", "fs", "runtime", "system", "process"] } +rustix = { git = "https://github.com/MySU-org/rustix.git", rev = "4a53fbc7cb7a07cabe87125cc21dbc27db316259", features = ["mount", "fs", "runtime", "system", "process"] } syscalls = { version = "0.8", default-features = false, features = [ "aarch64",