manager: Update susfs binary version
- Add switches and descriptions for new AVC log spoofing in basic settings
This commit is contained in:
@@ -136,6 +136,7 @@ fun SuSFSConfigScreen(
|
||||
var executeInPostFsData by remember { mutableStateOf(false) }
|
||||
var enableHideBl by remember { mutableStateOf(true) }
|
||||
var enableCleanupResidue by remember { mutableStateOf(false) }
|
||||
var enableAvcLogSpoofing by remember { mutableStateOf(false) }
|
||||
|
||||
// 槽位信息相关状态
|
||||
var slotInfoList by remember { mutableStateOf(emptyList<SuSFSManager.SlotInfo>()) }
|
||||
@@ -311,6 +312,7 @@ fun SuSFSConfigScreen(
|
||||
enableHideBl = SuSFSManager.getEnableHideBl(context)
|
||||
enableCleanupResidue = SuSFSManager.getEnableCleanupResidue(context)
|
||||
umountForZygoteIsoService = SuSFSManager.getUmountForZygoteIsoService(context)
|
||||
enableAvcLogSpoofing = SuSFSManager.getEnableAvcLogSpoofing(context)
|
||||
|
||||
loadSlotInfo()
|
||||
}
|
||||
@@ -481,6 +483,7 @@ fun SuSFSConfigScreen(
|
||||
enableHideBl = SuSFSManager.getEnableHideBl(context)
|
||||
enableCleanupResidue = SuSFSManager.getEnableCleanupResidue(context)
|
||||
umountForZygoteIsoService = SuSFSManager.getUmountForZygoteIsoService(context)
|
||||
enableAvcLogSpoofing = SuSFSManager.getEnableAvcLogSpoofing(context)
|
||||
}
|
||||
isLoading = false
|
||||
showRestoreConfirmDialog = false
|
||||
@@ -946,6 +949,7 @@ fun SuSFSConfigScreen(
|
||||
SuSFSManager.saveExecuteInPostFsData(context, executeInPostFsData)
|
||||
SuSFSManager.saveEnableHideBl(context, enableHideBl)
|
||||
SuSFSManager.saveEnableCleanupResidue(context, enableCleanupResidue)
|
||||
SuSFSManager.saveEnableAvcLogSpoofing(context, enableAvcLogSpoofing)
|
||||
}
|
||||
isLoading = false
|
||||
}
|
||||
@@ -1237,6 +1241,17 @@ fun SuSFSConfigScreen(
|
||||
SuSFSManager.configureAutoStart(context, true)
|
||||
}
|
||||
}
|
||||
},
|
||||
enableAvcLogSpoofing = enableAvcLogSpoofing,
|
||||
onEnableAvcLogSpoofingChange = { enabled ->
|
||||
coroutineScope.launch {
|
||||
isLoading = true
|
||||
val success = SuSFSManager.setEnableAvcLogSpoofing(context, enabled)
|
||||
if (success) {
|
||||
enableAvcLogSpoofing = enabled
|
||||
}
|
||||
isLoading = false
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
@@ -1456,10 +1471,13 @@ private fun BasicSettingsContent(
|
||||
enableHideBl: Boolean,
|
||||
onEnableHideBlChange: (Boolean) -> Unit,
|
||||
enableCleanupResidue: Boolean,
|
||||
onEnableCleanupResidueChange: (Boolean) -> Unit
|
||||
onEnableCleanupResidueChange: (Boolean) -> Unit,
|
||||
enableAvcLogSpoofing: Boolean,
|
||||
onEnableAvcLogSpoofingChange: (Boolean) -> Unit
|
||||
) {
|
||||
var scriptLocationExpanded by remember { mutableStateOf(false) }
|
||||
val isAbDevice = isAbDevice()
|
||||
val isSusVersion159 = isSusVersion159()
|
||||
|
||||
Column(
|
||||
modifier = Modifier
|
||||
@@ -1769,6 +1787,66 @@ private fun BasicSettingsContent(
|
||||
}
|
||||
}
|
||||
|
||||
// AVC日志欺骗开关(仅在1.5.9+版本显示)
|
||||
if (isSusVersion159) {
|
||||
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.VisibilityOff,
|
||||
contentDescription = null,
|
||||
tint = MaterialTheme.colorScheme.primary,
|
||||
modifier = Modifier.size(18.dp)
|
||||
)
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Text(
|
||||
text = stringResource(R.string.avc_log_spoofing),
|
||||
style = MaterialTheme.typography.titleMedium,
|
||||
fontWeight = FontWeight.Medium,
|
||||
color = MaterialTheme.colorScheme.onSurface
|
||||
)
|
||||
}
|
||||
Spacer(modifier = Modifier.height(6.dp))
|
||||
Text(
|
||||
text = stringResource(R.string.avc_log_spoofing_description),
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
lineHeight = 14.sp
|
||||
)
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
Text(
|
||||
text = stringResource(R.string.avc_log_spoofing_warning),
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = MaterialTheme.colorScheme.secondary,
|
||||
lineHeight = 12.sp
|
||||
)
|
||||
}
|
||||
Switch(
|
||||
checked = enableAvcLogSpoofing,
|
||||
onCheckedChange = onEnableAvcLogSpoofingChange,
|
||||
enabled = !isLoading
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 槽位信息按钮
|
||||
if (isAbDevice) {
|
||||
Card(
|
||||
|
||||
@@ -49,6 +49,7 @@ object SuSFSManager {
|
||||
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"
|
||||
|
||||
|
||||
// 常量
|
||||
@@ -156,7 +157,8 @@ object SuSFSManager {
|
||||
val support158: Boolean,
|
||||
val enableHideBl: Boolean,
|
||||
val enableCleanupResidue: Boolean,
|
||||
val umountForZygoteIsoService: Boolean
|
||||
val umountForZygoteIsoService: Boolean,
|
||||
val enableAvcLogSpoofing: Boolean
|
||||
) {
|
||||
/**
|
||||
* 检查是否有需要自启动的配置
|
||||
@@ -232,7 +234,7 @@ object SuSFSManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查是否支持循环路径功能(1.5.9+)
|
||||
* 检查是否支持循环路径和AVC日志欺骗等功能(1.5.9+)
|
||||
*/
|
||||
fun isSusVersion159(): Boolean {
|
||||
return try {
|
||||
@@ -266,6 +268,7 @@ object SuSFSManager {
|
||||
enableHideBl = getEnableHideBl(context),
|
||||
enableCleanupResidue = getEnableCleanupResidue(context),
|
||||
umountForZygoteIsoService = getUmountForZygoteIsoService(context),
|
||||
enableAvcLogSpoofing = getEnableAvcLogSpoofing(context)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -335,6 +338,13 @@ object SuSFSManager {
|
||||
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) }
|
||||
|
||||
fun getEnableAvcLogSpoofing(context: Context): Boolean =
|
||||
getPrefs(context).getBoolean(KEY_ENABLE_AVC_LOG_SPOOFING, false)
|
||||
|
||||
|
||||
// 路径和配置管理
|
||||
fun saveSusPaths(context: Context, paths: Set<String>) =
|
||||
@@ -502,6 +512,7 @@ object SuSFSManager {
|
||||
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),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -858,6 +869,25 @@ object SuSFSManager {
|
||||
return success
|
||||
}
|
||||
|
||||
// AVC日志欺骗开关
|
||||
suspend fun setEnableAvcLogSpoofing(context: Context, enabled: Boolean): Boolean {
|
||||
if (!isSusVersion159()) {
|
||||
return false
|
||||
}
|
||||
|
||||
val success = executeSusfsCommand(context, "enable_avc_log_spoofing ${if (enabled) 1 else 0}")
|
||||
if (success) {
|
||||
saveEnableAvcLogSpoofing(context, enabled)
|
||||
if (isAutoStartEnabled(context)) updateMagiskModule(context)
|
||||
showToast(context, if (enabled)
|
||||
context.getString(R.string.avc_log_spoofing_enabled)
|
||||
else
|
||||
context.getString(R.string.avc_log_spoofing_disabled)
|
||||
)
|
||||
}
|
||||
return success
|
||||
}
|
||||
|
||||
// SUS挂载隐藏控制
|
||||
suspend fun setHideSusMountsForAllProcs(context: Context, hideForAll: Boolean): Boolean {
|
||||
if (!isSusVersion158()) {
|
||||
|
||||
@@ -117,6 +117,14 @@ object ScriptGenerator {
|
||||
appendLine()
|
||||
}
|
||||
|
||||
private fun StringBuilder.generateAvcLogSpoofingSection(enableAvcLogSpoofing: Boolean) {
|
||||
appendLine("# 设置AVC日志欺骗状态")
|
||||
val avcLogValue = if (enableAvcLogSpoofing) 1 else 0
|
||||
appendLine("\"${'$'}SUSFS_BIN\" enable_avc_log_spoofing $avcLogValue")
|
||||
appendLine("echo \"$(get_current_time): AVC日志欺骗功能设置为: ${if (enableAvcLogSpoofing) "启用" else "禁用"}\" >> \"${'$'}LOG_FILE\"")
|
||||
appendLine()
|
||||
}
|
||||
|
||||
private fun StringBuilder.generateSusPathsSection(susPaths: Set<String>) {
|
||||
if (susPaths.isNotEmpty()) {
|
||||
appendLine("# 添加SUS路径")
|
||||
@@ -386,6 +394,9 @@ object ScriptGenerator {
|
||||
|
||||
generateUmountZygoteIsoServiceSection(config.umountForZygoteIsoService, config.support158)
|
||||
|
||||
// 添加AVC日志欺骗设置
|
||||
generateAvcLogSpoofingSection(config.enableAvcLogSpoofing)
|
||||
|
||||
appendLine("echo \"$(get_current_time): Post-FS-Data脚本执行完成\" >> \"${'$'}LOG_FILE\"")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user