From b3b7ef1cb3ba0088f548bea873c986eda774876e Mon Sep 17 00:00:00 2001 From: Rifat Azad Date: Tue, 24 Jun 2025 09:26:14 +0600 Subject: [PATCH] manager: dont show developer options and banner toggle when ksuversion is null --- .../rifsxd/ksunext/ui/screen/Customization.kt | 18 +++++++------ .../com/rifsxd/ksunext/ui/screen/Settings.kt | 26 ++++++++++--------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/manager/app/src/main/java/com/rifsxd/ksunext/ui/screen/Customization.kt b/manager/app/src/main/java/com/rifsxd/ksunext/ui/screen/Customization.kt index 802ff374..3c0be7c2 100644 --- a/manager/app/src/main/java/com/rifsxd/ksunext/ui/screen/Customization.kt +++ b/manager/app/src/main/java/com/rifsxd/ksunext/ui/screen/Customization.kt @@ -95,14 +95,16 @@ fun CustomizationScreen(navigator: DestinationsNavigator) { prefs.getBoolean("use_banner", true) ) } - SwitchItem( - icon = Icons.Filled.ViewCarousel, - title = stringResource(id = R.string.settings_banner), - summary = stringResource(id = R.string.settings_banner_summary), - checked = useBanner - ) { - prefs.edit().putBoolean("use_banner", it).apply() - useBanner = it + if (ksuVersion != null) { + SwitchItem( + icon = Icons.Filled.ViewCarousel, + title = stringResource(id = R.string.settings_banner), + summary = stringResource(id = R.string.settings_banner_summary), + checked = useBanner + ) { + prefs.edit().putBoolean("use_banner", it).apply() + useBanner = it + } } var enableAmoled by rememberSaveable { diff --git a/manager/app/src/main/java/com/rifsxd/ksunext/ui/screen/Settings.kt b/manager/app/src/main/java/com/rifsxd/ksunext/ui/screen/Settings.kt index 6f40d505..6599c2fc 100644 --- a/manager/app/src/main/java/com/rifsxd/ksunext/ui/screen/Settings.kt +++ b/manager/app/src/main/java/com/rifsxd/ksunext/ui/screen/Settings.kt @@ -349,18 +349,20 @@ fun SettingScreen(navigator: DestinationsNavigator) { } val developer = stringResource(id = R.string.developer) - ListItem( - leadingContent = { - Icon( - Icons.Filled.DeveloperBoard, - developer - ) - }, - headlineContent = { Text(developer) }, - modifier = Modifier.clickable { - navigator.navigate(DeveloperScreenDestination) - } - ) + if (ksuVersion != null) { + ListItem( + leadingContent = { + Icon( + Icons.Filled.DeveloperBoard, + developer + ) + }, + headlineContent = { Text(developer) }, + modifier = Modifier.clickable { + navigator.navigate(DeveloperScreenDestination) + } + ) + } val lkmMode = Natives.version >= Natives.MINIMAL_SUPPORTED_KERNEL_LKM && Natives.isLkmMode if (lkmMode) {