From a58e9292054ebca3a8f11ac16d00a5963b6933dc Mon Sep 17 00:00:00 2001 From: weishu Date: Tue, 6 Jun 2023 16:37:14 +0800 Subject: [PATCH] manager: Default selinux context should be "u:r:su:s0" --- manager/app/src/main/java/me/weishu/kernelsu/Natives.kt | 2 +- .../kernelsu/ui/component/profile/RootProfileConfig.kt | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/manager/app/src/main/java/me/weishu/kernelsu/Natives.kt b/manager/app/src/main/java/me/weishu/kernelsu/Natives.kt index aae64a1d..2afb97ba 100644 --- a/manager/app/src/main/java/me/weishu/kernelsu/Natives.kt +++ b/manager/app/src/main/java/me/weishu/kernelsu/Natives.kt @@ -87,7 +87,7 @@ object Natives { val gid: Int = 0, val groups: List = mutableListOf(), val capabilities: List = mutableListOf(), - val context: String = "su", + val context: String = "u:r:su:s0", val namespace: Int = Namespace.Inherited.ordinal, val nonRootUseDefault: Boolean = true, diff --git a/manager/app/src/main/java/me/weishu/kernelsu/ui/component/profile/RootProfileConfig.kt b/manager/app/src/main/java/me/weishu/kernelsu/ui/component/profile/RootProfileConfig.kt index f4c3861a..d6b2ce53 100644 --- a/manager/app/src/main/java/me/weishu/kernelsu/ui/component/profile/RootProfileConfig.kt +++ b/manager/app/src/main/java/me/weishu/kernelsu/ui/component/profile/RootProfileConfig.kt @@ -162,10 +162,18 @@ fun RootProfileConfig( } ListItem(headlineContent = { + val keyboardController = LocalSoftwareKeyboardController.current OutlinedTextField( modifier = Modifier.fillMaxWidth(), label = { Text("SELinux context") }, value = profile.context, + keyboardOptions = KeyboardOptions( + keyboardType = KeyboardType.Ascii, + imeAction = ImeAction.Done, + ), + keyboardActions = KeyboardActions(onDone = { + keyboardController?.hide() + }), onValueChange = { onProfileChange(profile.copy(context = it, rootUseDefault = false)) }