manager: Removed SUSFS_UMOUNT_FOR_ZYGOTE_ISO_SERVICE and SUSFS_RUN_UMOUNT_FOR_CURRENT_MNT_NS, which are no longer used in susfs 1.5.10.

- bump susfs version 1.5.10
This commit is contained in:
ShirkNeko
2025-09-25 21:57:31 +08:00
parent 23ed4384e6
commit 475b3998a1
15 changed files with 0 additions and 237 deletions

View File

@@ -392,73 +392,17 @@ fun SusMountsContent(
@Composable
fun TryUmountContent(
tryUmounts: Set<String>,
umountForZygoteIsoService: Boolean,
isLoading: Boolean,
onAddUmount: () -> Unit,
onRunUmount: () -> Unit,
onRemoveUmount: (String) -> Unit,
onEditUmount: ((String) -> Unit)? = null,
onToggleUmountForZygoteIsoService: (Boolean) -> Unit
) {
Box(modifier = Modifier.fillMaxSize()) {
LazyColumn(
modifier = Modifier.fillMaxSize(),
verticalArrangement = Arrangement.spacedBy(12.dp)
) {
if (isSusVersion158()) {
item {
Card(
modifier = Modifier.fillMaxWidth(),
colors = CardDefaults.cardColors(
containerColor = MaterialTheme.colorScheme.surface
),
shape = RoundedCornerShape(12.dp)
) {
Row(
modifier = Modifier
.fillMaxWidth()
.padding(12.dp),
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically
) {
Column(
modifier = Modifier.weight(1f)
) {
Row(
verticalAlignment = Alignment.CenterVertically
) {
Icon(
imageVector = Icons.Default.Security,
contentDescription = null,
tint = MaterialTheme.colorScheme.primary,
modifier = Modifier.size(18.dp)
)
Spacer(modifier = Modifier.width(8.dp))
Text(
text = stringResource(R.string.umount_zygote_iso_service),
style = MaterialTheme.typography.titleMedium,
fontWeight = FontWeight.Medium,
color = MaterialTheme.colorScheme.onSurface
)
}
Spacer(modifier = Modifier.height(6.dp))
Text(
text = stringResource(R.string.umount_zygote_iso_service_description),
style = MaterialTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.onSurfaceVariant,
lineHeight = 14.sp
)
}
Switch(
checked = umountForZygoteIsoService,
onCheckedChange = onToggleUmountForZygoteIsoService,
enabled = !isLoading
)
}
}
}
}
if (tryUmounts.isEmpty()) {
item {
EmptyStateCard(
@@ -509,24 +453,6 @@ fun TryUmountContent(
Spacer(modifier = Modifier.width(8.dp))
Text(text = stringResource(R.string.add))
}
if (tryUmounts.isNotEmpty()) {
Button(
onClick = onRunUmount,
modifier = Modifier
.weight(1f)
.height(48.dp),
shape = RoundedCornerShape(8.dp)
) {
Icon(
imageVector = Icons.Default.PlayArrow,
contentDescription = null,
modifier = Modifier.size(24.dp)
)
Spacer(modifier = Modifier.width(8.dp))
Text(text = stringResource(R.string.susfs_run))
}
}
}
}
}

View File

@@ -101,8 +101,6 @@ fun SuSFSConfigScreen(
// SUS挂载隐藏控制状态
var hideSusMountsForAllProcs by remember { mutableStateOf(true) }
var umountForZygoteIsoService by remember { mutableStateOf(false) }
// Kstat配置相关状态
var kstatConfigs by remember { mutableStateOf(emptySet<String>()) }
var addKstatPaths by remember { mutableStateOf(emptySet<String>()) }
@@ -257,7 +255,6 @@ fun SuSFSConfigScreen(
hideSusMountsForAllProcs = SuSFSManager.getHideSusMountsForAllProcs(context)
enableHideBl = SuSFSManager.getEnableHideBl(context)
enableCleanupResidue = SuSFSManager.getEnableCleanupResidue(context)
umountForZygoteIsoService = SuSFSManager.getUmountForZygoteIsoService(context)
enableAvcLogSpoofing = SuSFSManager.getEnableAvcLogSpoofing(context)
loadSlotInfo()
@@ -428,7 +425,6 @@ fun SuSFSConfigScreen(
hideSusMountsForAllProcs = SuSFSManager.getHideSusMountsForAllProcs(context)
enableHideBl = SuSFSManager.getEnableHideBl(context)
enableCleanupResidue = SuSFSManager.getEnableCleanupResidue(context)
umountForZygoteIsoService = SuSFSManager.getUmountForZygoteIsoService(context)
enableAvcLogSpoofing = SuSFSManager.getEnableAvcLogSpoofing(context)
}
isLoading = false
@@ -680,22 +676,6 @@ fun SuSFSConfigScreen(
)
// 确认对话框
ConfirmDialog(
showDialog = showRunUmountDialog,
onDismiss = { showRunUmountDialog = false },
onConfirm = {
coroutineScope.launch {
isLoading = true
SuSFSManager.runTryUmount(context)
isLoading = false
showRunUmountDialog = false
}
},
titleRes = R.string.susfs_run_umount_confirm_title,
messageRes = R.string.susfs_run_umount_confirm_message,
isLoading = isLoading
)
ConfirmDialog(
showDialog = showConfirmReset,
onDismiss = { showConfirmReset = false },
@@ -1280,7 +1260,6 @@ fun SuSFSConfigScreen(
SuSFSTab.TRY_UMOUNT -> {
TryUmountContent(
tryUmounts = tryUmounts,
umountForZygoteIsoService = umountForZygoteIsoService,
isLoading = isLoading,
onAddUmount = { showAddUmountDialog = true },
onRunUmount = { showRunUmountDialog = true },
@@ -1296,16 +1275,6 @@ fun SuSFSConfigScreen(
onEditUmount = { umountEntry ->
editingUmount = umountEntry
showAddUmountDialog = true
},
onToggleUmountForZygoteIsoService = { enabled ->
coroutineScope.launch {
isLoading = true
val success = SuSFSManager.setUmountForZygoteIsoService(context, enabled)
if (success) {
umountForZygoteIsoService = enabled
}
isLoading = false
}
}
)
}

View File

@@ -48,7 +48,6 @@ object SuSFSManager {
private const val KEY_HIDE_SUS_MOUNTS_FOR_ALL_PROCS = "hide_sus_mounts_for_all_procs"
private const val KEY_ENABLE_CLEANUP_RESIDUE = "enable_cleanup_residue"
private const val KEY_ENABLE_HIDE_BL = "enable_hide_bl"
private const val KEY_UMOUNT_FOR_ZYGOTE_ISO_SERVICE = "umount_for_zygote_iso_service"
private const val KEY_ENABLE_AVC_LOG_SPOOFING = "enable_avc_log_spoofing"
@@ -158,7 +157,6 @@ object SuSFSManager {
val support158: Boolean,
val enableHideBl: Boolean,
val enableCleanupResidue: Boolean,
val umountForZygoteIsoService: Boolean,
val enableAvcLogSpoofing: Boolean
) {
/**
@@ -268,7 +266,6 @@ object SuSFSManager {
support158 = isSusVersion158(),
enableHideBl = getEnableHideBl(context),
enableCleanupResidue = getEnableCleanupResidue(context),
umountForZygoteIsoService = getUmountForZygoteIsoService(context),
enableAvcLogSpoofing = getEnableAvcLogSpoofing(context)
)
}
@@ -332,13 +329,6 @@ object SuSFSManager {
fun getEnableCleanupResidue(context: Context): Boolean =
getPrefs(context).getBoolean(KEY_ENABLE_CLEANUP_RESIDUE, false)
// Zygote隔离服务卸载控制
fun saveUmountForZygoteIsoService(context: Context, enabled: Boolean) =
getPrefs(context).edit { putBoolean(KEY_UMOUNT_FOR_ZYGOTE_ISO_SERVICE, enabled) }
fun getUmountForZygoteIsoService(context: Context): Boolean =
getPrefs(context).getBoolean(KEY_UMOUNT_FOR_ZYGOTE_ISO_SERVICE, false)
// AVC日志欺骗配置
fun saveEnableAvcLogSpoofing(context: Context, enabled: Boolean) =
getPrefs(context).edit { putBoolean(KEY_ENABLE_AVC_LOG_SPOOFING, enabled) }
@@ -537,7 +527,6 @@ object SuSFSManager {
KEY_HIDE_SUS_MOUNTS_FOR_ALL_PROCS to getHideSusMountsForAllProcs(context),
KEY_ENABLE_HIDE_BL to getEnableHideBl(context),
KEY_ENABLE_CLEANUP_RESIDUE to getEnableCleanupResidue(context),
KEY_UMOUNT_FOR_ZYGOTE_ISO_SERVICE to getUmountForZygoteIsoService(context),
KEY_ENABLE_AVC_LOG_SPOOFING to getEnableAvcLogSpoofing(context),
)
}
@@ -1208,31 +1197,6 @@ object SuSFSManager {
}
}
suspend fun runTryUmount(context: Context): Boolean = executeSusfsCommand(context, "run_try_umount")
// Zygote隔离服务卸载控制
suspend fun setUmountForZygoteIsoService(context: Context, enabled: Boolean): Boolean {
if (!isSusVersion158()) {
return false
}
val result = executeSusfsCommandWithOutput(context, "umount_for_zygote_iso_service ${if (enabled) 1 else 0}")
val success = result.isSuccess && result.output.isEmpty()
if (success) {
saveUmountForZygoteIsoService(context, enabled)
if (isAutoStartEnabled(context)) updateMagiskModule(context)
showToast(context, if (enabled)
context.getString(R.string.umount_zygote_iso_service_enabled)
else
context.getString(R.string.umount_zygote_iso_service_disabled)
)
} else {
showToast(context, context.getString(R.string.susfs_command_failed))
}
return success
}
// 添加kstat配置
suspend fun addKstatStatically(context: Context, path: String, ino: String, dev: String, nlink: String,
size: String, atime: String, atimeNsec: String, mtime: String, mtimeNsec: String,

View File

@@ -392,8 +392,6 @@ object ScriptGenerator {
appendLine()
}
generateUmountZygoteIsoServiceSection(config.umountForZygoteIsoService, config.support158)
// 添加AVC日志欺骗设置
generateAvcLogSpoofingSection(config.enableAvcLogSpoofing)
@@ -401,17 +399,6 @@ object ScriptGenerator {
}
}
// 添加新的生成方法
private fun StringBuilder.generateUmountZygoteIsoServiceSection(umountForZygoteIsoService: Boolean, support158: Boolean) {
if (support158) {
appendLine("# 设置Zygote隔离服务卸载状态")
val umountValue = if (umountForZygoteIsoService) 1 else 0
appendLine("\"${'$'}SUSFS_BIN\" umount_for_zygote_iso_service $umountValue")
appendLine("echo \"$(get_current_time): Zygote隔离服务卸载设置为: ${if (umountForZygoteIsoService) "启用" else "禁用"}\" >> \"${'$'}LOG_FILE\"")
appendLine()
}
}
/**
* 生成post-mount.sh脚本内容
*/