diff --git a/app/src/main/java/vegabobo/dsusideloader/ui/screen/settings/SettingsScreen.kt b/app/src/main/java/vegabobo/dsusideloader/ui/screen/settings/SettingsScreen.kt index 1fbb160..5969148 100644 --- a/app/src/main/java/vegabobo/dsusideloader/ui/screen/settings/SettingsScreen.kt +++ b/app/src/main/java/vegabobo/dsusideloader/ui/screen/settings/SettingsScreen.kt @@ -17,6 +17,7 @@ import vegabobo.dsusideloader.ui.components.PreferenceItem import vegabobo.dsusideloader.ui.components.Title import vegabobo.dsusideloader.ui.components.TopBar import vegabobo.dsusideloader.ui.screen.Destinations +import vegabobo.dsusideloader.util.OperationMode import vegabobo.dsusideloader.util.collectAsStateWithLifecycle @OptIn(ExperimentalMaterial3Api::class) @@ -89,13 +90,15 @@ fun Settings( settingsViewModel.togglePreference(AppPrefs.DISABLE_STORAGE_CHECK, !it) }, ) - PreferenceItem( - title = stringResource(id = R.string.full_logcat_logging_title), - description = stringResource(id = R.string.full_logcat_logging_description), - showToggle = true, - isChecked = uiState.preferences[AppPrefs.FULL_LOGCAT_LOGGING]!!, - onClick = { settingsViewModel.togglePreference(AppPrefs.FULL_LOGCAT_LOGGING, !it) }, - ) + if (settingsViewModel.getOperationMode() != OperationMode.ADB) { + PreferenceItem( + title = stringResource(id = R.string.full_logcat_logging_title), + description = stringResource(id = R.string.full_logcat_logging_description), + showToggle = true, + isChecked = uiState.preferences[AppPrefs.FULL_LOGCAT_LOGGING]!!, + onClick = { settingsViewModel.togglePreference(AppPrefs.FULL_LOGCAT_LOGGING, !it) }, + ) + } } Title(title = stringResource(id = R.string.other)) diff --git a/app/src/main/java/vegabobo/dsusideloader/ui/screen/settings/SettingsViewModel.kt b/app/src/main/java/vegabobo/dsusideloader/ui/screen/settings/SettingsViewModel.kt index 01431df..6ea4565 100644 --- a/app/src/main/java/vegabobo/dsusideloader/ui/screen/settings/SettingsViewModel.kt +++ b/app/src/main/java/vegabobo/dsusideloader/ui/screen/settings/SettingsViewModel.kt @@ -16,6 +16,7 @@ import kotlinx.coroutines.launch import vegabobo.dsusideloader.core.BaseViewModel import vegabobo.dsusideloader.model.Session import vegabobo.dsusideloader.preferences.AppPrefs +import vegabobo.dsusideloader.util.OperationMode import vegabobo.dsusideloader.util.OperationModeUtils @HiltViewModel @@ -71,6 +72,10 @@ class SettingsViewModel @Inject constructor( return OperationModeUtils.getOperationModeAsString(session.getOperationMode()) } + fun getOperationMode(): OperationMode { + return session.getOperationMode() + } + fun checkDevOpt() { viewModelScope.launch { val isDevOptEnabled = readBoolPref(AppPrefs.DEVELOPER_OPTIONS)