manager: Show module conflict state with Magisk
This commit is contained in:
@@ -103,6 +103,12 @@ fun ModuleScreen(navigator: DestinationsNavigator) {
|
||||
}
|
||||
return@Scaffold
|
||||
}
|
||||
if (hasMagisk()) {
|
||||
Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
|
||||
Text(stringResource(R.string.module_magisk_conflict))
|
||||
}
|
||||
return@Scaffold
|
||||
}
|
||||
SwipeRefresh(
|
||||
state = swipeState, onRefresh = {
|
||||
scope.launch { viewModel.fetchModuleList() }
|
||||
|
||||
@@ -108,4 +108,10 @@ fun overlayFsAvailable(): Boolean {
|
||||
val shell = createRootShell()
|
||||
// check /proc/filesystems
|
||||
return ShellUtils.fastCmdResult(shell, "cat /proc/filesystems | grep overlay")
|
||||
}
|
||||
|
||||
fun hasMagisk(): Boolean {
|
||||
val shell = createRootShell()
|
||||
val result = shell.newJob().add("nsenter --mount=/proc/1/ns/mnt which magisk").exec()
|
||||
return result.isSuccess
|
||||
}
|
||||
Reference in New Issue
Block a user