Skip to content

Commit 1130a0c

Browse files
committed
SuperUserScreen: Fix unable to configure exclude for dis-allow root apps
Signed-off-by: GarfieldHan <[email protected]>
1 parent f89c4d9 commit 1130a0c

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

app/src/main/java/me/bmax/apatch/ui/screen/SuperUser.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ import coil.compose.AsyncImage
4949
import coil.request.ImageRequest
5050
import com.ramcosta.composedestinations.annotation.Destination
5151
import kotlinx.coroutines.launch
52-
import me.bmax.apatch.APApplication
5352
import me.bmax.apatch.Natives
5453
import me.bmax.apatch.R
5554
import me.bmax.apatch.ui.component.SearchAppBar
@@ -214,12 +213,11 @@ private fun AppItem(
214213

215214
@Composable
216215
fun EditUser(app: SuperUserViewModel.AppInfo) {
217-
val _viahook = app.config.profile.scontext.isEmpty()
218-
var viahook by remember { mutableStateOf(_viahook) }
216+
//var viahook by remember { mutableStateOf(app.config.profile.scontext.isEmpty()) }
219217
var exclude by remember { mutableIntStateOf(app.config.exclude) }
220218

221219
Column(modifier = Modifier.padding(start = 24.dp, end = 24.dp)) {
222-
SwitchItem(
220+
/*SwitchItem(
223221
icon = Icons.Filled.Security,
224222
title = "SU Thread",
225223
summary = "bypass selinux via hooks",
@@ -230,7 +228,7 @@ fun EditUser(app: SuperUserViewModel.AppInfo) {
230228
else app.config.profile.scontext = APApplication.MAGISK_SCONTEXT
231229
PkgConfig.changeConfig(app.config)
232230
},
233-
)
231+
)*/
234232
SwitchItem(
235233
icon = Icons.Filled.Security,
236234
title = stringResource(id = R.string.su_pkg_excluded_setting_title),

app/src/main/java/me/bmax/apatch/util/PkgConfig.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ object PkgConfig {
8181
val configs = readConfigs()
8282
val pkg = config.pkg
8383
val uid = config.profile.uid
84-
if (config.allow == 0) {
84+
if (config.allow == 0 && configs[pkg] != null) {
8585
// revoke all uid
8686
val toRemove = configs.filter { it.key == pkg || it.value.profile.uid == uid }
8787
toRemove.forEach {

0 commit comments

Comments
 (0)