diff --git a/docs/README-en.md b/docs/README-en.md index feafdd20..1a860092 100644 --- a/docs/README-en.md +++ b/docs/README-en.md @@ -15,19 +15,30 @@ Android device root solution based on [KernelSU](https://github.com/KernelSU/Ker ## How to add -Using the susfs-dev branch (integrated susfs with support for non-GKI devices) +Using the susfs-stable or susfs-dev branch (integrated susfs with support for non-GKI devices) + +``` +curl -LSs "https://raw.githubusercontent.com/ShirkNeko/KernelSU/main/kernel/setup.sh" | bash -s susfs-stable +``` + ``` curl -LSs "https://raw.githubusercontent.com/ShirkNeko/KernelSU/main/kernel/setup.sh" | bash -s susfs-dev ``` -Use main branching (no longer with support for non-GKI devices) +Use main branching +``` +curl -LSs "https://raw.githubusercontent.com/ShirkNeko/KernelSU/main/kernel/setup.sh" | bash -s main +``` + +Use dev branching(With support for non-GKI devices) ``` curl -LSs "https://raw.githubusercontent.com/ShirkNeko/KernelSU/main/kernel/setup.sh" | bash -s main ``` ## How to use integrated susfs -Use the susfs-dev branch directly without any patching +1. Use the susfs-dev branch directly without any patching +2. Manually patch susfs using a dev branch that supports non-GKI devices. ## More links @@ -83,6 +94,7 @@ Note: You only need to fill in the first two kernel versions, such as 5.10, 5.15 - [Ktouls](https://github.com/Ktouls) Thanks so much for bringing me support - [zaoqi123](https://github.com/zaoqi123) It's not a bad idea to buy me a milk tea - [wswzgdg](https://github.com/wswzgdg) Many thanks for supporting this project +- [yspbwx2010](https://github.com/yspbwx2010) Many thanks diff --git a/docs/README.md b/docs/README.md index 90e7a0f6..9e081c66 100644 --- a/docs/README.md +++ b/docs/README.md @@ -15,20 +15,30 @@ ## 如何添加 在内核源码的根目录下执行以下命令: -使用 susfs-dev 分支(已集成susfs,带非GKI设备的支持) +使用 susfs-stable 或者 susfs-dev 分支(已集成susfs,带非GKI设备的支持) +``` +curl -LSs "https://raw.githubusercontent.com/ShirkNeko/KernelSU/main/kernel/setup.sh" | bash -s susfs-stable +``` + ``` curl -LSs "https://raw.githubusercontent.com/ShirkNeko/KernelSU/main/kernel/setup.sh" | bash -s susfs-dev ``` -使用 main 分支(不再带非GKI设备的支持) + +使用 main 分支 ``` curl -LSs "https://raw.githubusercontent.com/ShirkNeko/KernelSU/main/kernel/setup.sh" | bash -s main ``` + +使用 dev 分支(带非GKI设备的支持) +``` +curl -LSs "https://raw.githubusercontent.com/ShirkNeko/KernelSU/main/kernel/setup.sh" | bash -s main +``` ## 如何集成 susfs -1. 直接使用 susfs-dev 分支,不需要再集成 susfs - +1. 直接使用 susfs-stable 或者 susfs-dev 分支,不需要再集成 susfs +2. 使用支持非GKI设备的 dev 分支,手动补丁 susfs ## 钩子方法 - 此部分引用自 [rsuntk 的钩子方法](https://github.com/rsuntk/KernelSU) @@ -72,7 +82,7 @@ curl -LSs "https://raw.githubusercontent.com/ShirkNeko/KernelSU/main/kernel/setu 1. 基于内核的 `su` 和 root 访问管理 2. 基于 5ec1cff 的 [Magic Mount](https://github.com/5ec1cff/KernelSU) 的模块系统 3. [App Profile](https://kernelsu.org/guide/app-profile.html):将 root 权限锁在笼子里 -4. 恢复对非 GKI 2.0 内核的支持(仅限susfs-dev和未进行susfs补丁的dev分支) +4. 恢复对非 GKI 2.0 内核的支持 5. 更多自定义功能 @@ -85,6 +95,7 @@ curl -LSs "https://raw.githubusercontent.com/ShirkNeko/KernelSU/main/kernel/setu - [Ktouls](https://github.com/Ktouls) 非常感谢你给我带来的支持 - [zaoqi123](https://github.com/zaoqi123) 请我喝奶茶也不错 - [wswzgdg](https://github.com/wswzgdg) 非常感谢对此项目的支持 +- [yspbwx2010](https://github.com/yspbwx2010) 非常感谢 diff --git a/manager/app/src/main/java/shirkneko/zako/sukisu/ui/screen/Home.kt b/manager/app/src/main/java/shirkneko/zako/sukisu/ui/screen/Home.kt index 852f6079..5e0c162d 100644 --- a/manager/app/src/main/java/shirkneko/zako/sukisu/ui/screen/Home.kt +++ b/manager/app/src/main/java/shirkneko/zako/sukisu/ui/screen/Home.kt @@ -335,16 +335,18 @@ private fun StatusCard( Spacer(modifier = Modifier.height(4.dp)) val suSFS = getSuSFS() - val translatedStatus = when (suSFS) { - "Supported" -> stringResource(R.string.status_supported) - "Not Supported" -> stringResource(R.string.status_not_supported) - else -> stringResource(R.string.status_unknown) - } + if (lkmMode != true) { + val translatedStatus = when (suSFS) { + "Supported" -> stringResource(R.string.status_supported) + "Not Supported" -> stringResource(R.string.status_not_supported) + else -> stringResource(R.string.status_unknown) + } - Text( - text = stringResource(R.string.home_susfs, translatedStatus), - style = MaterialTheme.typography.bodyMedium - ) + Text( + text = stringResource(R.string.home_susfs, translatedStatus), + style = MaterialTheme.typography.bodyMedium + ) + } } } diff --git a/manager/app/src/main/java/shirkneko/zako/sukisu/ui/screen/Module.kt b/manager/app/src/main/java/shirkneko/zako/sukisu/ui/screen/Module.kt index f0e58baa..3286925b 100644 --- a/manager/app/src/main/java/shirkneko/zako/sukisu/ui/screen/Module.kt +++ b/manager/app/src/main/java/shirkneko/zako/sukisu/ui/screen/Module.kt @@ -346,7 +346,11 @@ fun ModuleScreen(navigator: DestinationsNavigator) { floatingActionButton = { if (!hideInstallButton) { val moduleInstall = stringResource(id = R.string.module_install) - val cardColor = MaterialTheme.colorScheme.secondaryContainer + val cardColor = if (!ThemeConfig.useDynamicColor) { + ThemeConfig.currentTheme.ButtonContrast + } else { + MaterialTheme.colorScheme.secondaryContainer + } ExtendedFloatingActionButton( onClick = { selectZipLauncher.launch( diff --git a/manager/app/src/main/java/shirkneko/zako/sukisu/ui/screen/Settings.kt b/manager/app/src/main/java/shirkneko/zako/sukisu/ui/screen/Settings.kt index 91188050..c17482ef 100644 --- a/manager/app/src/main/java/shirkneko/zako/sukisu/ui/screen/Settings.kt +++ b/manager/app/src/main/java/shirkneko/zako/sukisu/ui/screen/Settings.kt @@ -140,7 +140,6 @@ fun SettingScreen(navigator: DestinationsNavigator) { loadingDialog.hide() snackBarHost.showSnackbar(context.getString(R.string.log_saved)) } - // endregion } // region 配置项列表 // 配置文件模板入口 @@ -218,12 +217,12 @@ fun SettingScreen(navigator: DestinationsNavigator) { prefs.edit { putBoolean("enable_web_debugging", it) } enableWebDebugging = it } - // endregion + // 更多设置 val newButtonTitle = stringResource(id = R.string.more_settings) ListItem( leadingContent = { Icon( - Icons.Filled.ExpandMore, + Icons.Filled.Settings, contentDescription = newButtonTitle ) }, diff --git a/manager/app/src/main/java/shirkneko/zako/sukisu/ui/screen/Template.kt b/manager/app/src/main/java/shirkneko/zako/sukisu/ui/screen/Template.kt index f0af0ea3..3ba1dd79 100644 --- a/manager/app/src/main/java/shirkneko/zako/sukisu/ui/screen/Template.kt +++ b/manager/app/src/main/java/shirkneko/zako/sukisu/ui/screen/Template.kt @@ -60,6 +60,7 @@ import com.ramcosta.composedestinations.result.getOr import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import shirkneko.zako.sukisu.R +import shirkneko.zako.sukisu.ui.theme.ThemeConfig import shirkneko.zako.sukisu.ui.viewmodel.TemplateViewModel /** @@ -77,7 +78,11 @@ fun AppProfileTemplateScreen( val viewModel = viewModel() val scope = rememberCoroutineScope() val scrollBehavior = TopAppBarDefaults.pinnedScrollBehavior(rememberTopAppBarState()) - val cardColor = MaterialTheme.colorScheme.secondaryContainer + val cardColor = if (!ThemeConfig.useDynamicColor) { + ThemeConfig.currentTheme.ButtonContrast + } else { + MaterialTheme.colorScheme.secondaryContainer + } LaunchedEffect(Unit) { if (viewModel.templateList.isEmpty()) { diff --git a/manager/app/src/main/java/shirkneko/zako/sukisu/ui/theme/Theme.kt b/manager/app/src/main/java/shirkneko/zako/sukisu/ui/theme/Theme.kt index 41e52161..4ac64ad5 100644 --- a/manager/app/src/main/java/shirkneko/zako/sukisu/ui/theme/Theme.kt +++ b/manager/app/src/main/java/shirkneko/zako/sukisu/ui/theme/Theme.kt @@ -43,23 +43,23 @@ object ThemeConfig { @Composable private fun getDarkColorScheme() = darkColorScheme( primary = ThemeConfig.currentTheme.Primary.copy(alpha = 0.8f), - onPrimary = Color.White, + onPrimary = mixColors(ThemeConfig.currentTheme.Primary, Color.White, 0.2f), primaryContainer = ThemeConfig.currentTheme.PrimaryContainer.copy(alpha = 0.15f), - onPrimaryContainer = Color.White, + onPrimaryContainer = mixColors(ThemeConfig.currentTheme.Primary, Color.White, 0.2f), secondary = ThemeConfig.currentTheme.Secondary.copy(alpha = 0.8f), - onSecondary = Color.White, + onSecondary = mixColors(ThemeConfig.currentTheme.Secondary, Color.White, 0.2f), secondaryContainer = ThemeConfig.currentTheme.SecondaryContainer.copy(alpha = 0.15f), - onSecondaryContainer = Color.White, + onSecondaryContainer = mixColors(ThemeConfig.currentTheme.Secondary, Color.White, 0.2f), tertiary = ThemeConfig.currentTheme.Tertiary.copy(alpha = 0.8f), - onTertiary = Color.White, + onTertiary = mixColors(ThemeConfig.currentTheme.Tertiary, Color.White, 0.2f), tertiaryContainer = ThemeConfig.currentTheme.TertiaryContainer.copy(alpha = 0.15f), - onTertiaryContainer = Color.White, + onTertiaryContainer = mixColors(ThemeConfig.currentTheme.Tertiary, Color.White, 0.2f), background = Color.Transparent, surface = Color.Transparent, - onBackground = Color.White.copy(alpha = 0.87f), - onSurface = Color.White.copy(alpha = 0.87f), + onBackground = mixColors(ThemeConfig.currentTheme.Primary, Color.White, 0.1f), + onSurface = mixColors(ThemeConfig.currentTheme.Primary, Color.White, 0.1f), surfaceVariant = Color(0xFF2F2F2F), - onSurfaceVariant = Color.White.copy(alpha = 0.78f), + onSurfaceVariant = mixColors(ThemeConfig.currentTheme.Primary, Color.White, 0.2f), outline = Color.White.copy(alpha = 0.12f), outlineVariant = Color.White.copy(alpha = 0.12f) ) @@ -339,4 +339,12 @@ private fun adjustColor(color: Color): Color { luminance = maxLuminance } return color.copy(luminance) +} + +private fun mixColors(color1: Color, color2: Color, ratio: Float): Color { + val r = (color1.red * ratio + color2.red * (1 - ratio)) + val g = (color1.green * ratio + color2.green * (1 - ratio)) + val b = (color1.blue * ratio + color2.blue * (1 - ratio)) + val a = (color1.alpha * ratio + color2.alpha * (1 - ratio)) + return Color(r, g, b, a) } \ No newline at end of file