Revert "manager: Removed SUSFS_UMOUNT_FOR_ZYGOTE_ISO_SERVICE which are no longer used in susfs 1.5.10."

This reverts commit 475b3998a1.

- bump susfs version 1.5.10
This commit is contained in:
ShirkNeko
2025-09-30 23:08:34 +08:00
parent c950705044
commit e552163d9e
14 changed files with 154 additions and 0 deletions

View File

@@ -392,16 +392,72 @@ fun SusMountsContent(
@Composable
fun TryUmountContent(
tryUmounts: Set<String>,
umountForZygoteIsoService: Boolean,
isLoading: Boolean,
onAddUmount: () -> 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(

View File

@@ -101,6 +101,8 @@ 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>()) }
@@ -254,6 +256,7 @@ fun SuSFSConfigScreen(
hideSusMountsForAllProcs = SuSFSManager.getHideSusMountsForAllProcs(context)
enableHideBl = SuSFSManager.getEnableHideBl(context)
enableCleanupResidue = SuSFSManager.getEnableCleanupResidue(context)
umountForZygoteIsoService = SuSFSManager.getUmountForZygoteIsoService(context)
enableAvcLogSpoofing = SuSFSManager.getEnableAvcLogSpoofing(context)
loadSlotInfo()
@@ -424,6 +427,7 @@ fun SuSFSConfigScreen(
hideSusMountsForAllProcs = SuSFSManager.getHideSusMountsForAllProcs(context)
enableHideBl = SuSFSManager.getEnableHideBl(context)
enableCleanupResidue = SuSFSManager.getEnableCleanupResidue(context)
umountForZygoteIsoService = SuSFSManager.getUmountForZygoteIsoService(context)
enableAvcLogSpoofing = SuSFSManager.getEnableAvcLogSpoofing(context)
}
isLoading = false
@@ -1259,6 +1263,7 @@ fun SuSFSConfigScreen(
SuSFSTab.TRY_UMOUNT -> {
TryUmountContent(
tryUmounts = tryUmounts,
umountForZygoteIsoService = umountForZygoteIsoService,
isLoading = isLoading,
onAddUmount = { showAddUmountDialog = true },
onRemoveUmount = { umountEntry ->
@@ -1273,6 +1278,16 @@ 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,6 +48,7 @@ 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"
@@ -157,6 +158,7 @@ object SuSFSManager {
val support158: Boolean,
val enableHideBl: Boolean,
val enableCleanupResidue: Boolean,
val umountForZygoteIsoService: Boolean,
val enableAvcLogSpoofing: Boolean
) {
/**
@@ -266,6 +268,7 @@ object SuSFSManager {
support158 = isSusVersion158(),
enableHideBl = getEnableHideBl(context),
enableCleanupResidue = getEnableCleanupResidue(context),
umountForZygoteIsoService = getUmountForZygoteIsoService(context),
enableAvcLogSpoofing = getEnableAvcLogSpoofing(context)
)
}
@@ -329,6 +332,13 @@ 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) }
@@ -527,6 +537,7 @@ 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),
)
}
@@ -1197,6 +1208,29 @@ object SuSFSManager {
}
}
// 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,6 +392,8 @@ object ScriptGenerator {
appendLine()
}
generateUmountZygoteIsoServiceSection(config.umountForZygoteIsoService, config.support158)
// 添加AVC日志欺骗设置
generateAvcLogSpoofingSection(config.enableAvcLogSpoofing)
@@ -399,6 +401,17 @@ 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脚本内容
*/

View File

@@ -552,6 +552,10 @@
<string name="kstat_config_updated">Pembaruan konfigurasi Kstat</string>
<string name="kstat_path_updated">Pembaruan jalur Kstat</string>
<string name="susfs_update_full_clone">Pembaruan full clone Susfs</string>
<string name="umount_zygote_iso_service">Lepas Layanan Isolasi Zygote</string>
<string name="umount_zygote_iso_service_description">Aktifkan opsi ini untuk melepaskan titik pemasangan layanan isolasi Zygote saat sistem mulai</string>
<string name="umount_zygote_iso_service_enabled">Lepas layanan isolasi Zygote diaktifkan</string>
<string name="umount_zygote_iso_service_disabled">Lepas layanan isolasi Zygote dinonaktifkan</string>
<string name="app_paths_section">Jalur Aplikasi</string>
<string name="other_paths_section">Jalur lainnya</string>
<string name="add_custom_path">Lainnya</string>

View File

@@ -552,6 +552,10 @@
<string name="kstat_config_updated">Kstat の構成を更新</string>
<string name="kstat_path_updated">Kstat のパスを更新</string>
<string name="susfs_update_full_clone">フルクローンの SuSFS を更新</string>
<string name="umount_zygote_iso_service">Zygote 分離サービスをアンマウント</string>
<string name="umount_zygote_iso_service_description">このオプションを有効化すると、システムの起動時に Zygote 分離サービスのマウントポイントがアンマウントされます。</string>
<string name="umount_zygote_iso_service_enabled">Zygote 分離サービスのアンマウントが有効です</string>
<string name="umount_zygote_iso_service_disabled">Zygote 分離サービスのアンマウントが無効です</string>
<string name="app_paths_section">アプリのパス</string>
<string name="other_paths_section">その他のパス</string>
<string name="add_custom_path">その他</string>

View File

@@ -552,6 +552,10 @@
<string name="kstat_config_updated">Обновить конфиг Kstat</string>
<string name="kstat_path_updated">Обновить путь Kstat</string>
<string name="susfs_update_full_clone">Полное обновление клона SuSFS</string>
<string name="umount_zygote_iso_service">Размонтировать сервис изоляции Zygote</string>
<string name="umount_zygote_iso_service_description">Включите эту опцию, чтобы размонтировать точки монтирования Zygote при запуске системы</string>
<string name="umount_zygote_iso_service_enabled">Размонтирование служб Zygote включено</string>
<string name="umount_zygote_iso_service_disabled">Размонтирование служб Zygote выключено</string>
<string name="app_paths_section">Путь к приложению</string>
<string name="other_paths_section">Другие пути</string>
<string name="add_custom_path">Другое</string>

View File

@@ -550,6 +550,10 @@
<string name="kstat_config_updated">Kstat yapılandırması güncellendi</string>
<string name="kstat_path_updated">Kstat yolu güncellendi</string>
<string name="susfs_update_full_clone">Susfs tam klon güncellemesi</string>
<string name="umount_zygote_iso_service">Zygote İzolasyon Servisi Bağlantısını Kes</string>
<string name="umount_zygote_iso_service_description">Sistem başlangıcında Zygote izolasyon servisi bağlama noktalarının bağlantısını kesmek için bu seçeneği etkinleştirin</string>
<string name="umount_zygote_iso_service_enabled">Zygote izolasyon servisi bağlantı kesme etkinleştirildi</string>
<string name="umount_zygote_iso_service_disabled">Zygote izolasyon servisi bağlantı kesme devre dışı bırakıldı</string>
<string name="app_paths_section">Uygulama Yolu</string>
<string name="other_paths_section">Diğer yollar</string>
<string name="add_custom_path">Diğer</string>

View File

@@ -550,6 +550,10 @@
<string name="kstat_config_updated">Cập nhật cấu hình Kstat</string>
<string name="kstat_path_updated">Cập nhật Đường dẫn Kstat</string>
<string name="susfs_update_full_clone">Cập nhật bản sao SuSFS đầy đủ</string>
<string name="umount_zygote_iso_service">Umount dịch vụ cô lập Zygote</string>
<string name="umount_zygote_iso_service_description">Umount các điểm dịch vụ cô lập Zygote khi khởi động hệ thống</string>
<string name="umount_zygote_iso_service_enabled">Umount dịch vụ cô lập Zygote đã bật</string>
<string name="umount_zygote_iso_service_disabled">Umount dịch vụ cô lập Zygote đã tắt</string>
<string name="app_paths_section">Đường dẫn ứng dụng</string>
<string name="other_paths_section">Đường dẫn khác</string>
<string name="add_custom_path">Khác</string>

View File

@@ -550,6 +550,10 @@
<string name="kstat_config_updated">Kstat 配置更新</string>
<string name="kstat_path_updated">Kstat 路径更新</string>
<string name="susfs_update_full_clone">Susfs 完整克隆更新</string>
<string name="umount_zygote_iso_service">卸载 Zygote 隔离服务</string>
<string name="umount_zygote_iso_service_description">启用此选项将在系统启动时卸载 Zygote 隔离服务挂载点</string>
<string name="umount_zygote_iso_service_enabled">Zygote 隔离服务卸载已启用</string>
<string name="umount_zygote_iso_service_disabled">Zygote 隔离服务卸载已禁用</string>
<string name="app_paths_section">应用路径</string>
<string name="other_paths_section">其他路径</string>
<string name="add_custom_path">其他</string>

View File

@@ -547,6 +547,10 @@
<string name="kstat_config_updated">Kstat 配置更新</string>
<string name="kstat_path_updated">Kstat 路徑更新</string>
<string name="susfs_update_full_clone">Susfs 完整克隆更新</string>
<string name="umount_zygote_iso_service">解除安裝 Zygote 隔離服務</string>
<string name="umount_zygote_iso_service_description">啟用此選項將喺系統啟動時解除安裝 Zygote 隔離服務掛載點</string>
<string name="umount_zygote_iso_service_enabled">Zygote 隔離服務解除安裝已啟用</string>
<string name="umount_zygote_iso_service_disabled">Zygote 隔離服務解除安裝已禁用</string>
<string name="app_paths_section">應用路徑</string>
<string name="other_paths_section">其他路徑</string>
<string name="add_custom_path">其他</string>

View File

@@ -550,6 +550,10 @@
<string name="kstat_config_updated">Kstat 配置已更新</string>
<string name="kstat_path_updated">Kstat 路徑已更新</string>
<string name="susfs_update_full_clone">Susfs 完整複製更新</string>
<string name="umount_zygote_iso_service">卸載 Zygote 隔離服務</string>
<string name="umount_zygote_iso_service_description">啟用此選項將在系統啟動時卸載 Zygote 隔離服務掛載點</string>
<string name="umount_zygote_iso_service_enabled">Zygote 隔離服務卸載已啟用</string>
<string name="umount_zygote_iso_service_disabled">Zygote 隔離服務卸載已停用</string>
<string name="app_paths_section">應用路徑</string>
<string name="other_paths_section">其他路徑</string>
<string name="add_custom_path">其他</string>

View File

@@ -552,6 +552,10 @@
<string name="kstat_config_updated">Kstat config update</string>
<string name="kstat_path_updated">Kstat path update</string>
<string name="susfs_update_full_clone">Susfs update full clone</string>
<string name="umount_zygote_iso_service">Unmount Zygote Isolation Service</string>
<string name="umount_zygote_iso_service_description">Enable this option to unmount Zygote isolation service mount points at system startup</string>
<string name="umount_zygote_iso_service_enabled">Zygote isolation service unmount enabled</string>
<string name="umount_zygote_iso_service_disabled">Zygote isolation service unmount disabled</string>
<string name="app_paths_section">Application Path</string>
<string name="other_paths_section">Other paths</string>
<string name="add_custom_path">Other</string>