[skip ci]: Adding a check for LKM mode to the KPM info card
This commit is contained in:
@@ -20,6 +20,8 @@ import androidx.navigation.compose.rememberNavController
|
||||
import com.ramcosta.composedestinations.DestinationsNavHost
|
||||
import com.ramcosta.composedestinations.animations.NavHostAnimatedDestinationStyle
|
||||
import com.ramcosta.composedestinations.generated.NavGraphs
|
||||
import com.ramcosta.composedestinations.spec.NavHostGraphSpec
|
||||
import com.ramcosta.composedestinations.spec.RouteOrDirection
|
||||
import com.ramcosta.composedestinations.utils.isRouteOnBackStackAsState
|
||||
import com.ramcosta.composedestinations.utils.rememberDestinationsNavigator
|
||||
import io.zako.zako.UltraToolInstall
|
||||
@@ -65,7 +67,7 @@ class MainActivity : ComponentActivity() {
|
||||
) {
|
||||
DestinationsNavHost(
|
||||
modifier = Modifier.padding(innerPadding),
|
||||
navGraph = NavGraphs.root,
|
||||
navGraph = NavGraphs.root as NavHostGraphSpec,
|
||||
navController = navController,
|
||||
defaultTransitions = object : NavHostAnimatedDestinationStyle() {
|
||||
override val enterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition
|
||||
@@ -112,7 +114,7 @@ private fun BottomBar(navController: NavHostController) {
|
||||
navigator.popBackStack(destination.direction, false)
|
||||
}
|
||||
navigator.navigate(destination.direction) {
|
||||
popUpTo(NavGraphs.root) {
|
||||
popUpTo(NavGraphs.root as RouteOrDirection) {
|
||||
saveState = true
|
||||
}
|
||||
launchSingleTop = true
|
||||
@@ -128,7 +130,7 @@ private fun BottomBar(navController: NavHostController) {
|
||||
},
|
||||
label = { Text(stringResource(destination.label)) },
|
||||
alwaysShowLabel = false,
|
||||
colors = androidx.compose.material3.NavigationBarItemDefaults.colors(
|
||||
colors = NavigationBarItemDefaults.colors(
|
||||
unselectedTextColor = MaterialTheme.colorScheme.onSurfaceVariant
|
||||
)
|
||||
)
|
||||
@@ -143,7 +145,7 @@ private fun BottomBar(navController: NavHostController) {
|
||||
navigator.popBackStack(destination.direction, false)
|
||||
}
|
||||
navigator.navigate(destination.direction) {
|
||||
popUpTo(NavGraphs.root) {
|
||||
popUpTo(NavGraphs.root as RouteOrDirection) {
|
||||
saveState = true
|
||||
}
|
||||
launchSingleTop = true
|
||||
|
||||
@@ -561,6 +561,7 @@ fun DonateCard() {
|
||||
|
||||
@Composable
|
||||
private fun InfoCard() {
|
||||
val lkmMode = Natives.isLkmMode
|
||||
val context = LocalContext.current
|
||||
val isSimpleMode = LocalContext.current.getSharedPreferences("settings", Context.MODE_PRIVATE)
|
||||
.getBoolean("is_simple_mode", false)
|
||||
@@ -617,22 +618,24 @@ private fun InfoCard() {
|
||||
|
||||
|
||||
if (!isSimpleMode) {
|
||||
val kpmVersion = getKpmVersion()
|
||||
var displayVersion: String
|
||||
val isKpmConfigured = checkKpmConfigured()
|
||||
if (lkmMode != true) {
|
||||
val kpmVersion = getKpmVersion()
|
||||
var displayVersion: String
|
||||
val isKpmConfigured = checkKpmConfigured()
|
||||
|
||||
if (kpmVersion.isEmpty() || kpmVersion.startsWith("Error")) {
|
||||
val statusText = if (isKpmConfigured) {
|
||||
stringResource(R.string.kernel_patched)
|
||||
if (kpmVersion.isEmpty() || kpmVersion.startsWith("Error")) {
|
||||
val statusText = if (isKpmConfigured) {
|
||||
stringResource(R.string.kernel_patched)
|
||||
} else {
|
||||
stringResource(R.string.kernel_not_enabled)
|
||||
}
|
||||
displayVersion = "${stringResource(R.string.not_supported)} ($statusText)"
|
||||
} else {
|
||||
stringResource(R.string.kernel_not_enabled)
|
||||
displayVersion = "${stringResource(R.string.supported)} ($kpmVersion)"
|
||||
}
|
||||
displayVersion = "${stringResource(R.string.not_supported)} ($statusText)"
|
||||
} else {
|
||||
displayVersion = "${stringResource(R.string.supported)} ($kpmVersion)"
|
||||
Spacer(Modifier.height(16.dp))
|
||||
InfoCardItem(stringResource(R.string.home_kpm_version), displayVersion)
|
||||
}
|
||||
Spacer(Modifier.height(16.dp))
|
||||
InfoCardItem(stringResource(R.string.home_kpm_version), displayVersion)
|
||||
}
|
||||
|
||||
val isHideSusfsStatus = LocalContext.current.getSharedPreferences("settings", Context.MODE_PRIVATE)
|
||||
|
||||
Reference in New Issue
Block a user