diff --git a/manager/app/src/main/java/com/rifsxd/ksunext/ui/screen/ExecuteModuleAction.kt b/manager/app/src/main/java/com/rifsxd/ksunext/ui/screen/ExecuteModuleAction.kt index a11f9d2f..bbc65713 100644 --- a/manager/app/src/main/java/com/rifsxd/ksunext/ui/screen/ExecuteModuleAction.kt +++ b/manager/app/src/main/java/com/rifsxd/ksunext/ui/screen/ExecuteModuleAction.kt @@ -1,5 +1,6 @@ package com.rifsxd.ksunext.ui.screen +import android.content.Context import android.os.Environment import androidx.activity.compose.BackHandler import androidx.compose.foundation.layout.Column @@ -35,6 +36,7 @@ import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.input.key.Key import androidx.compose.ui.input.key.key import androidx.compose.ui.platform.LocalView @@ -69,6 +71,11 @@ fun ExecuteModuleActionScreen(navigator: DestinationsNavigator, moduleId: String var actionResult: Boolean var isActionRunning by rememberSaveable { mutableStateOf(true) } + val context = LocalContext.current + // Read developer options from SharedPreferences + val prefs = context.getSharedPreferences("settings", Context.MODE_PRIVATE) + val developerOptionsEnabled = prefs.getBoolean("enable_developer_options", false) + val view = LocalView.current DisposableEffect(isActionRunning) { view.keepScreenOn = isActionRunning @@ -158,7 +165,7 @@ fun ExecuteModuleActionScreen(navigator: DestinationsNavigator, moduleId: String } Text( modifier = Modifier.padding(8.dp), - text = text, + text = if (developerOptionsEnabled) logContent.toString() else text, fontSize = MaterialTheme.typography.bodySmall.fontSize, fontFamily = FontFamily.Monospace, lineHeight = MaterialTheme.typography.bodySmall.lineHeight, diff --git a/manager/app/src/main/java/com/rifsxd/ksunext/ui/screen/Flash.kt b/manager/app/src/main/java/com/rifsxd/ksunext/ui/screen/Flash.kt index fb1547cc..efa0f42e 100644 --- a/manager/app/src/main/java/com/rifsxd/ksunext/ui/screen/Flash.kt +++ b/manager/app/src/main/java/com/rifsxd/ksunext/ui/screen/Flash.kt @@ -1,5 +1,6 @@ package com.rifsxd.ksunext.ui.screen +import android.content.Context import android.net.Uri import android.os.Environment import android.os.Parcelable @@ -45,6 +46,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.input.key.Key import androidx.compose.ui.input.key.key import androidx.compose.ui.input.nestedscroll.nestedScroll +import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalView import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontFamily @@ -119,6 +121,11 @@ fun FlashScreen(navigator: DestinationsNavigator, flashIt: FlashIt) { mutableStateOf(FlashingStatus.FLASHING) } + val context = LocalContext.current + + val prefs = context.getSharedPreferences("settings", Context.MODE_PRIVATE) + val developerOptionsEnabled = prefs.getBoolean("enable_developer_options", false) + val view = LocalView.current DisposableEffect(flashing) { view.keepScreenOn = flashing == FlashingStatus.FLASHING @@ -237,7 +244,7 @@ fun FlashScreen(navigator: DestinationsNavigator, flashIt: FlashIt) { } Text( modifier = Modifier.padding(8.dp), - text = text, + text = if (developerOptionsEnabled) logContent.toString() else text, fontSize = MaterialTheme.typography.bodySmall.fontSize, fontFamily = FontFamily.Monospace, lineHeight = MaterialTheme.typography.bodySmall.lineHeight,