kernel: Bump susfs binary version to 1.5.12
- Removed functionally coupled versions 1.5.10-1.5.11 - Removed `statusMagicMount` status retrieval - Use `getSuSFSFeatures` to replace `CMD_GET_SUSFS_FEATURE_STATUS` for obtaining SUSFS status.
This commit is contained in:
Binary file not shown.
@@ -310,37 +310,6 @@ NativeBridgeNP(getHookType, jstring) {
|
|||||||
return GetEnvironment()->NewStringUTF(env, hook_type);
|
return GetEnvironment()->NewStringUTF(env, hook_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
// SuSFS Related Function Status
|
|
||||||
NativeBridgeNP(getSusfsFeatureStatus, jobject) {
|
|
||||||
struct susfs_feature_status status;
|
|
||||||
bool result = get_susfs_feature_status(&status);
|
|
||||||
|
|
||||||
if (!result) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
jclass cls = GetEnvironment()->FindClass(env, "com/sukisu/ultra/Natives$SusfsFeatureStatus");
|
|
||||||
jmethodID constructor = GetEnvironment()->GetMethodID(env, cls, "<init>", "()V");
|
|
||||||
jobject obj = GetEnvironment()->NewObject(env, cls, constructor);
|
|
||||||
|
|
||||||
SET_BOOLEAN_FIELD(obj, cls, statusSusPath, status.status_sus_path);
|
|
||||||
SET_BOOLEAN_FIELD(obj, cls, statusSusMount, status.status_sus_mount);
|
|
||||||
SET_BOOLEAN_FIELD(obj, cls, statusAutoDefaultMount, status.status_auto_default_mount);
|
|
||||||
SET_BOOLEAN_FIELD(obj, cls, statusAutoBindMount, status.status_auto_bind_mount);
|
|
||||||
SET_BOOLEAN_FIELD(obj, cls, statusSusKstat, status.status_sus_kstat);
|
|
||||||
SET_BOOLEAN_FIELD(obj, cls, statusTryUmount, status.status_try_umount);
|
|
||||||
SET_BOOLEAN_FIELD(obj, cls, statusAutoTryUmountBind, status.status_auto_try_umount_bind);
|
|
||||||
SET_BOOLEAN_FIELD(obj, cls, statusSpoofUname, status.status_spoof_uname);
|
|
||||||
SET_BOOLEAN_FIELD(obj, cls, statusEnableLog, status.status_enable_log);
|
|
||||||
SET_BOOLEAN_FIELD(obj, cls, statusHideSymbols, status.status_hide_symbols);
|
|
||||||
SET_BOOLEAN_FIELD(obj, cls, statusSpoofCmdline, status.status_spoof_cmdline);
|
|
||||||
SET_BOOLEAN_FIELD(obj, cls, statusOpenRedirect, status.status_open_redirect);
|
|
||||||
SET_BOOLEAN_FIELD(obj, cls, statusMagicMount, status.status_magic_mount);
|
|
||||||
SET_BOOLEAN_FIELD(obj, cls, statusSusSu, status.status_sus_su);
|
|
||||||
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
// dynamic manager
|
// dynamic manager
|
||||||
NativeBridge(setDynamicManager, jboolean, jint size, jstring hash) {
|
NativeBridge(setDynamicManager, jboolean, jint size, jstring hash) {
|
||||||
if (!hash) {
|
if (!hash) {
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ extern const char* zako_file_verrcidx2str(uint8_t index);
|
|||||||
|
|
||||||
#define CMD_ENABLE_KPM 100
|
#define CMD_ENABLE_KPM 100
|
||||||
#define CMD_HOOK_TYPE 101
|
#define CMD_HOOK_TYPE 101
|
||||||
#define CMD_GET_SUSFS_FEATURE_STATUS 102
|
|
||||||
#define CMD_DYNAMIC_MANAGER 103
|
#define CMD_DYNAMIC_MANAGER 103
|
||||||
#define CMD_GET_MANAGERS 104
|
#define CMD_GET_MANAGERS 104
|
||||||
#define CMD_ENABLE_UID_SCANNER 105
|
#define CMD_ENABLE_UID_SCANNER 105
|
||||||
@@ -150,14 +149,6 @@ bool get_hook_type(char* hook_type, size_t size) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool get_susfs_feature_status(struct susfs_feature_status* status) {
|
|
||||||
if (status == NULL) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ksuctl(CMD_GET_SUSFS_FEATURE_STATUS, status, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool set_dynamic_manager(unsigned int size, const char* hash) {
|
bool set_dynamic_manager(unsigned int size, const char* hash) {
|
||||||
if (hash == NULL) {
|
if (hash == NULL) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -39,23 +39,6 @@ struct dynamic_manager_user_config {
|
|||||||
char hash[65];
|
char hash[65];
|
||||||
};
|
};
|
||||||
|
|
||||||
// SUSFS Functional State Structures
|
|
||||||
struct susfs_feature_status {
|
|
||||||
bool status_sus_path;
|
|
||||||
bool status_sus_mount;
|
|
||||||
bool status_auto_default_mount;
|
|
||||||
bool status_auto_bind_mount;
|
|
||||||
bool status_sus_kstat;
|
|
||||||
bool status_try_umount;
|
|
||||||
bool status_auto_try_umount_bind;
|
|
||||||
bool status_spoof_uname;
|
|
||||||
bool status_enable_log;
|
|
||||||
bool status_hide_symbols;
|
|
||||||
bool status_spoof_cmdline;
|
|
||||||
bool status_open_redirect;
|
|
||||||
bool status_magic_mount;
|
|
||||||
bool status_sus_su;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct root_profile {
|
struct root_profile {
|
||||||
int32_t uid;
|
int32_t uid;
|
||||||
@@ -125,7 +108,6 @@ bool is_KPM_enable();
|
|||||||
|
|
||||||
bool get_hook_type(char* hook_type, size_t size);
|
bool get_hook_type(char* hook_type, size_t size);
|
||||||
|
|
||||||
bool get_susfs_feature_status(struct susfs_feature_status* status);
|
|
||||||
|
|
||||||
bool set_dynamic_manager(unsigned int size, const char* hash);
|
bool set_dynamic_manager(unsigned int size, const char* hash);
|
||||||
|
|
||||||
|
|||||||
@@ -106,7 +106,6 @@ object Natives {
|
|||||||
* Get SUSFS feature status from kernel
|
* Get SUSFS feature status from kernel
|
||||||
* @return SusfsFeatureStatus object containing all feature states, or null if failed
|
* @return SusfsFeatureStatus object containing all feature states, or null if failed
|
||||||
*/
|
*/
|
||||||
external fun getSusfsFeatureStatus(): SusfsFeatureStatus?
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set dynamic managerature configuration
|
* Set dynamic managerature configuration
|
||||||
@@ -183,27 +182,6 @@ object Natives {
|
|||||||
return isVersionLessThan(getFullVersion(), MINIMAL_SUPPORTED_KERNEL_FULL)
|
return isVersionLessThan(getFullVersion(), MINIMAL_SUPPORTED_KERNEL_FULL)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Immutable
|
|
||||||
@Parcelize
|
|
||||||
@Keep
|
|
||||||
data class SusfsFeatureStatus(
|
|
||||||
val statusSusPath: Boolean = false,
|
|
||||||
val statusSusMount: Boolean = false,
|
|
||||||
val statusAutoDefaultMount: Boolean = false,
|
|
||||||
val statusAutoBindMount: Boolean = false,
|
|
||||||
val statusSusKstat: Boolean = false,
|
|
||||||
val statusTryUmount: Boolean = false,
|
|
||||||
val statusAutoTryUmountBind: Boolean = false,
|
|
||||||
val statusSpoofUname: Boolean = false,
|
|
||||||
val statusEnableLog: Boolean = false,
|
|
||||||
val statusHideSymbols: Boolean = false,
|
|
||||||
val statusSpoofCmdline: Boolean = false,
|
|
||||||
val statusOpenRedirect: Boolean = false,
|
|
||||||
val statusMagicMount: Boolean = false,
|
|
||||||
val statusOverlayfsAutoKstat: Boolean = false,
|
|
||||||
val statusSusSu: Boolean = false
|
|
||||||
) : Parcelable
|
|
||||||
|
|
||||||
@Immutable
|
@Immutable
|
||||||
@Parcelize
|
@Parcelize
|
||||||
@Keep
|
@Keep
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ import com.sukisu.ultra.ui.theme.CardConfig
|
|||||||
import com.sukisu.ultra.ui.susfs.util.SuSFSManager
|
import com.sukisu.ultra.ui.susfs.util.SuSFSManager
|
||||||
import com.sukisu.ultra.ui.susfs.util.SuSFSManager.isSusVersion158
|
import com.sukisu.ultra.ui.susfs.util.SuSFSManager.isSusVersion158
|
||||||
import com.sukisu.ultra.ui.susfs.util.SuSFSManager.isSusVersion159
|
import com.sukisu.ultra.ui.susfs.util.SuSFSManager.isSusVersion159
|
||||||
|
import com.sukisu.ultra.ui.util.getSuSFSVersion
|
||||||
import com.sukisu.ultra.ui.util.isAbDevice
|
import com.sukisu.ultra.ui.util.isAbDevice
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import java.io.File
|
import java.io.File
|
||||||
@@ -168,6 +169,38 @@ fun SuSFSConfigScreen(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var showVersionMismatchDialog by remember { mutableStateOf(false) }
|
||||||
|
|
||||||
|
if (showVersionMismatchDialog) {
|
||||||
|
AlertDialog(
|
||||||
|
onDismissRequest = { showVersionMismatchDialog = false },
|
||||||
|
title = {
|
||||||
|
Text(
|
||||||
|
text = stringResource(R.string.warning),
|
||||||
|
style = MaterialTheme.typography.headlineSmall,
|
||||||
|
fontWeight = FontWeight.Bold
|
||||||
|
)
|
||||||
|
},
|
||||||
|
text = {
|
||||||
|
Text(
|
||||||
|
stringResource(
|
||||||
|
R.string.susfs_version_mismatch,
|
||||||
|
try { getSuSFSVersion() } catch (_: Exception) { "unknown" },
|
||||||
|
SuSFSManager.MAX_SUSFS_VERSION
|
||||||
|
)
|
||||||
|
)
|
||||||
|
},
|
||||||
|
confirmButton = {
|
||||||
|
TextButton(
|
||||||
|
onClick = { showVersionMismatchDialog = false },
|
||||||
|
modifier = Modifier.padding(8.dp)
|
||||||
|
) {
|
||||||
|
Text(stringResource(R.string.confirm))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
// 文件选择器
|
// 文件选择器
|
||||||
val backupFileLauncher = rememberLauncherForActivityResult(
|
val backupFileLauncher = rememberLauncherForActivityResult(
|
||||||
contract = ActivityResultContracts.CreateDocument("application/json")
|
contract = ActivityResultContracts.CreateDocument("application/json")
|
||||||
@@ -253,6 +286,21 @@ fun SuSFSConfigScreen(
|
|||||||
|
|
||||||
// 加载当前配置
|
// 加载当前配置
|
||||||
LaunchedEffect(Unit) {
|
LaunchedEffect(Unit) {
|
||||||
|
coroutineScope.launch {
|
||||||
|
try {
|
||||||
|
val version = getSuSFSVersion()
|
||||||
|
val binaryName = "ksu_susfs_${version.removePrefix("v")}"
|
||||||
|
|
||||||
|
val isBinaryAvailable = try {
|
||||||
|
context.assets.open(binaryName).use { true }
|
||||||
|
} catch (_: Exception) { false }
|
||||||
|
|
||||||
|
if (!isBinaryAvailable) {
|
||||||
|
showVersionMismatchDialog = true
|
||||||
|
}
|
||||||
|
} catch (_: Exception) {
|
||||||
|
}
|
||||||
|
|
||||||
unameValue = SuSFSManager.getUnameValue(context)
|
unameValue = SuSFSManager.getUnameValue(context)
|
||||||
buildTimeValue = SuSFSManager.getBuildTimeValue(context)
|
buildTimeValue = SuSFSManager.getBuildTimeValue(context)
|
||||||
autoStartEnabled = SuSFSManager.isAutoStartEnabled(context)
|
autoStartEnabled = SuSFSManager.isAutoStartEnabled(context)
|
||||||
@@ -273,6 +321,7 @@ fun SuSFSConfigScreen(
|
|||||||
|
|
||||||
loadSlotInfo()
|
loadSlotInfo()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 当切换到启用功能状态标签页时加载数据
|
// 当切换到启用功能状态标签页时加载数据
|
||||||
LaunchedEffect(selectedTab) {
|
LaunchedEffect(selectedTab) {
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import android.os.Build
|
|||||||
import android.util.Log
|
import android.util.Log
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import com.dergoogler.mmrl.platform.Platform.Companion.context
|
import com.dergoogler.mmrl.platform.Platform.Companion.context
|
||||||
import com.sukisu.ultra.Natives
|
|
||||||
import com.sukisu.ultra.R
|
import com.sukisu.ultra.R
|
||||||
import com.topjohnwu.superuser.Shell
|
import com.topjohnwu.superuser.Shell
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
@@ -22,6 +21,7 @@ import java.io.IOException
|
|||||||
import androidx.core.content.edit
|
import androidx.core.content.edit
|
||||||
import com.sukisu.ultra.ui.util.getRootShell
|
import com.sukisu.ultra.ui.util.getRootShell
|
||||||
import com.sukisu.ultra.ui.util.getSuSFSVersion
|
import com.sukisu.ultra.ui.util.getSuSFSVersion
|
||||||
|
import com.sukisu.ultra.ui.util.getSuSFSFeatures
|
||||||
import com.sukisu.ultra.ui.viewmodel.SuperUserViewModel
|
import com.sukisu.ultra.ui.viewmodel.SuperUserViewModel
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.async
|
import kotlinx.coroutines.async
|
||||||
@@ -65,6 +65,7 @@ object SuSFSManager {
|
|||||||
private const val MODULE_PATH = "/data/adb/modules/$MODULE_ID"
|
private const val MODULE_PATH = "/data/adb/modules/$MODULE_ID"
|
||||||
private const val MIN_VERSION_FOR_HIDE_MOUNT = "1.5.8"
|
private const val MIN_VERSION_FOR_HIDE_MOUNT = "1.5.8"
|
||||||
private const val MIN_VERSION_FOR_LOOP_PATH = "1.5.9"
|
private const val MIN_VERSION_FOR_LOOP_PATH = "1.5.9"
|
||||||
|
const val MAX_SUSFS_VERSION = "1.5.12"
|
||||||
private const val BACKUP_FILE_EXTENSION = ".susfs_backup"
|
private const val BACKUP_FILE_EXTENSION = ".susfs_backup"
|
||||||
private const val MEDIA_DATA_PATH = "/data/media/0/Android/data"
|
private const val MEDIA_DATA_PATH = "/data/media/0/Android/data"
|
||||||
private const val CGROUP_UID_PATH_PREFIX = "/sys/fs/cgroup/uid_"
|
private const val CGROUP_UID_PATH_PREFIX = "/sys/fs/cgroup/uid_"
|
||||||
@@ -185,11 +186,23 @@ object SuSFSManager {
|
|||||||
private fun getPrefs(context: Context): SharedPreferences =
|
private fun getPrefs(context: Context): SharedPreferences =
|
||||||
context.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE)
|
context.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE)
|
||||||
|
|
||||||
private fun getSuSFSVersionUse(): String = try {
|
private fun getSuSFSVersionUse(context: Context): String = try {
|
||||||
getSuSFSVersion()
|
val version = getSuSFSVersion()
|
||||||
} catch (_: Exception) { MIN_VERSION_FOR_HIDE_MOUNT }
|
val binaryName = "${SUSFS_BINARY_TARGET_NAME}_${version.removePrefix("v")}"
|
||||||
|
if (isBinaryAvailable(context, binaryName)) {
|
||||||
|
version
|
||||||
|
} else {
|
||||||
|
MAX_SUSFS_VERSION
|
||||||
|
}
|
||||||
|
} catch (_: Exception) {
|
||||||
|
MAX_SUSFS_VERSION
|
||||||
|
}
|
||||||
|
|
||||||
private fun getSuSFSBinaryName(): String = "${SUSFS_BINARY_TARGET_NAME}_${getSuSFSVersionUse().removePrefix("v")}"
|
fun isBinaryAvailable(context: Context, binaryName: String): Boolean = try {
|
||||||
|
context.assets.open(binaryName).use { true }
|
||||||
|
} catch (_: IOException) { false }
|
||||||
|
|
||||||
|
private fun getSuSFSBinaryName(context: Context): String = "${SUSFS_BINARY_TARGET_NAME}_${getSuSFSVersionUse(context).removePrefix("v")}"
|
||||||
|
|
||||||
private fun getSuSFSTargetPath(): String = "/data/adb/ksu/bin/$SUSFS_BINARY_TARGET_NAME"
|
private fun getSuSFSTargetPath(): String = "/data/adb/ksu/bin/$SUSFS_BINARY_TARGET_NAME"
|
||||||
|
|
||||||
@@ -715,7 +728,7 @@ object SuSFSManager {
|
|||||||
// 二进制文件管理
|
// 二进制文件管理
|
||||||
private suspend fun copyBinaryFromAssets(context: Context): String? = withContext(Dispatchers.IO) {
|
private suspend fun copyBinaryFromAssets(context: Context): String? = withContext(Dispatchers.IO) {
|
||||||
try {
|
try {
|
||||||
val binaryName = getSuSFSBinaryName()
|
val binaryName = getSuSFSBinaryName(context)
|
||||||
val targetPath = getSuSFSTargetPath()
|
val targetPath = getSuSFSTargetPath()
|
||||||
val tempFile = File(context.cacheDir, binaryName)
|
val tempFile = File(context.cacheDir, binaryName)
|
||||||
|
|
||||||
@@ -736,7 +749,7 @@ object SuSFSManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun isBinaryAvailable(context: Context): Boolean = try {
|
fun isBinaryAvailable(context: Context): Boolean = try {
|
||||||
context.assets.open(getSuSFSBinaryName()).use { true }
|
context.assets.open(getSuSFSBinaryName(context)).use { true }
|
||||||
} catch (_: IOException) { false }
|
} catch (_: IOException) { false }
|
||||||
|
|
||||||
// 命令执行
|
// 命令执行
|
||||||
@@ -823,9 +836,10 @@ object SuSFSManager {
|
|||||||
// 功能状态获取
|
// 功能状态获取
|
||||||
suspend fun getEnabledFeatures(context: Context): List<EnabledFeature> = withContext(Dispatchers.IO) {
|
suspend fun getEnabledFeatures(context: Context): List<EnabledFeature> = withContext(Dispatchers.IO) {
|
||||||
try {
|
try {
|
||||||
val status = Natives.getSusfsFeatureStatus()
|
val featuresOutput = getSuSFSFeatures()
|
||||||
if (status != null) {
|
|
||||||
parseEnabledFeaturesFromStatus(context, status)
|
if (featuresOutput.isNotBlank() && featuresOutput != "Invalid") {
|
||||||
|
parseEnabledFeaturesFromOutput(context, featuresOutput)
|
||||||
} else {
|
} else {
|
||||||
getDefaultDisabledFeatures(context)
|
getDefaultDisabledFeatures(context)
|
||||||
}
|
}
|
||||||
@@ -835,10 +849,47 @@ object SuSFSManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun parseEnabledFeaturesFromOutput(context: Context, featuresOutput: String): List<EnabledFeature> {
|
||||||
|
val enabledConfigs = featuresOutput.lines()
|
||||||
|
.map { it.trim() }
|
||||||
|
.filter { it.isNotEmpty() }
|
||||||
|
.toSet()
|
||||||
|
|
||||||
|
val featureMap = mapOf(
|
||||||
|
"CONFIG_KSU_SUSFS_SUS_PATH" to context.getString(R.string.sus_path_feature_label),
|
||||||
|
"CONFIG_KSU_SUSFS_SUS_MOUNT" to context.getString(R.string.sus_mount_feature_label),
|
||||||
|
"CONFIG_KSU_SUSFS_TRY_UMOUNT" to context.getString(R.string.try_umount_feature_label),
|
||||||
|
"CONFIG_KSU_SUSFS_SPOOF_UNAME" to context.getString(R.string.spoof_uname_feature_label),
|
||||||
|
"CONFIG_KSU_SUSFS_SPOOF_CMDLINE_OR_BOOTCONFIG" to context.getString(R.string.spoof_cmdline_feature_label),
|
||||||
|
"CONFIG_KSU_SUSFS_OPEN_REDIRECT" to context.getString(R.string.open_redirect_feature_label),
|
||||||
|
"CONFIG_KSU_SUSFS_ENABLE_LOG" to context.getString(R.string.enable_log_feature_label),
|
||||||
|
"CONFIG_KSU_SUSFS_AUTO_ADD_SUS_KSU_DEFAULT_MOUNT" to context.getString(R.string.auto_default_mount_feature_label),
|
||||||
|
"CONFIG_KSU_SUSFS_AUTO_ADD_SUS_BIND_MOUNT" to context.getString(R.string.auto_bind_mount_feature_label),
|
||||||
|
"CONFIG_KSU_SUSFS_AUTO_ADD_TRY_UMOUNT_FOR_BIND_MOUNT" to context.getString(R.string.auto_try_umount_bind_feature_label),
|
||||||
|
"CONFIG_KSU_SUSFS_HIDE_KSU_SUSFS_SYMBOLS" to context.getString(R.string.hide_symbols_feature_label),
|
||||||
|
"CONFIG_KSU_SUSFS_SUS_KSTAT" to context.getString(R.string.sus_kstat_feature_label),
|
||||||
|
"CONFIG_KSU_SUSFS_SUS_SU" to context.getString(R.string.sus_su_feature_label)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
return featureMap.map { (configKey, displayName) ->
|
||||||
|
val isEnabled = enabledConfigs.contains(configKey)
|
||||||
|
|
||||||
|
val statusText = if (isEnabled) {
|
||||||
|
context.getString(R.string.susfs_feature_enabled)
|
||||||
|
} else {
|
||||||
|
context.getString(R.string.susfs_feature_disabled)
|
||||||
|
}
|
||||||
|
|
||||||
|
val canConfigure = displayName == context.getString(R.string.enable_log_feature_label)
|
||||||
|
|
||||||
|
EnabledFeature(displayName, isEnabled, statusText, canConfigure)
|
||||||
|
}.sortedBy { it.name }
|
||||||
|
}
|
||||||
|
|
||||||
private fun getDefaultDisabledFeatures(context: Context): List<EnabledFeature> {
|
private fun getDefaultDisabledFeatures(context: Context): List<EnabledFeature> {
|
||||||
val defaultFeatures = listOf(
|
val defaultFeatures = listOf(
|
||||||
"sus_path_feature_label" to context.getString(R.string.sus_path_feature_label),
|
"sus_path_feature_label" to context.getString(R.string.sus_path_feature_label),
|
||||||
"sus_loop_path_feature_label" to context.getString(R.string.sus_loop_path_feature_label),
|
|
||||||
"sus_mount_feature_label" to context.getString(R.string.sus_mount_feature_label),
|
"sus_mount_feature_label" to context.getString(R.string.sus_mount_feature_label),
|
||||||
"try_umount_feature_label" to context.getString(R.string.try_umount_feature_label),
|
"try_umount_feature_label" to context.getString(R.string.try_umount_feature_label),
|
||||||
"spoof_uname_feature_label" to context.getString(R.string.spoof_uname_feature_label),
|
"spoof_uname_feature_label" to context.getString(R.string.spoof_uname_feature_label),
|
||||||
@@ -850,7 +901,6 @@ object SuSFSManager {
|
|||||||
"auto_try_umount_bind_feature_label" to context.getString(R.string.auto_try_umount_bind_feature_label),
|
"auto_try_umount_bind_feature_label" to context.getString(R.string.auto_try_umount_bind_feature_label),
|
||||||
"hide_symbols_feature_label" to context.getString(R.string.hide_symbols_feature_label),
|
"hide_symbols_feature_label" to context.getString(R.string.hide_symbols_feature_label),
|
||||||
"sus_kstat_feature_label" to context.getString(R.string.sus_kstat_feature_label),
|
"sus_kstat_feature_label" to context.getString(R.string.sus_kstat_feature_label),
|
||||||
"magic_mount_feature_label" to context.getString(R.string.magic_mount_feature_label),
|
|
||||||
"sus_su_feature_label" to context.getString(R.string.sus_su_feature_label)
|
"sus_su_feature_label" to context.getString(R.string.sus_su_feature_label)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -864,31 +914,6 @@ object SuSFSManager {
|
|||||||
}.sortedBy { it.name }
|
}.sortedBy { it.name }
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun parseEnabledFeaturesFromStatus(context: Context, status: Natives.SusfsFeatureStatus): List<EnabledFeature> {
|
|
||||||
val featureList = listOf(
|
|
||||||
Triple("status_sus_path", context.getString(R.string.sus_path_feature_label), status.statusSusPath),
|
|
||||||
Triple("status_sus_mount", context.getString(R.string.sus_mount_feature_label), status.statusSusMount),
|
|
||||||
Triple("status_try_umount", context.getString(R.string.try_umount_feature_label), status.statusTryUmount),
|
|
||||||
Triple("status_spoof_uname", context.getString(R.string.spoof_uname_feature_label), status.statusSpoofUname),
|
|
||||||
Triple("status_spoof_cmdline", context.getString(R.string.spoof_cmdline_feature_label), status.statusSpoofCmdline),
|
|
||||||
Triple("status_open_redirect", context.getString(R.string.open_redirect_feature_label), status.statusOpenRedirect),
|
|
||||||
Triple("status_enable_log", context.getString(R.string.enable_log_feature_label), status.statusEnableLog),
|
|
||||||
Triple("status_auto_default_mount", context.getString(R.string.auto_default_mount_feature_label), status.statusAutoDefaultMount),
|
|
||||||
Triple("status_auto_bind_mount", context.getString(R.string.auto_bind_mount_feature_label), status.statusAutoBindMount),
|
|
||||||
Triple("status_auto_try_umount_bind", context.getString(R.string.auto_try_umount_bind_feature_label), status.statusAutoTryUmountBind),
|
|
||||||
Triple("status_hide_symbols", context.getString(R.string.hide_symbols_feature_label), status.statusHideSymbols),
|
|
||||||
Triple("status_sus_kstat", context.getString(R.string.sus_kstat_feature_label), status.statusSusKstat),
|
|
||||||
Triple("status_magic_mount", context.getString(R.string.magic_mount_feature_label), status.statusMagicMount),
|
|
||||||
Triple("status_sus_su", context.getString(R.string.sus_su_feature_label), status.statusSusSu)
|
|
||||||
)
|
|
||||||
|
|
||||||
return featureList.map { (id, displayName, isEnabled) ->
|
|
||||||
val statusText = if (isEnabled) context.getString(R.string.susfs_feature_enabled) else context.getString(R.string.susfs_feature_disabled)
|
|
||||||
val canConfigure = id == "status_enable_log"
|
|
||||||
EnabledFeature(displayName, isEnabled, statusText, canConfigure)
|
|
||||||
}.sortedBy { it.name }
|
|
||||||
}
|
|
||||||
|
|
||||||
// sus日志开关
|
// sus日志开关
|
||||||
suspend fun setEnableLog(context: Context, enabled: Boolean): Boolean {
|
suspend fun setEnableLog(context: Context, enabled: Boolean): Boolean {
|
||||||
val success = executeSusfsCommand(context, "enable_log ${if (enabled) 1 else 0}")
|
val success = executeSusfsCommand(context, "enable_log ${if (enabled) 1 else 0}")
|
||||||
|
|||||||
@@ -528,8 +528,8 @@ fun getSuSFSVariant(): String {
|
|||||||
|
|
||||||
fun getSuSFSFeatures(): String {
|
fun getSuSFSFeatures(): String {
|
||||||
val shell = getRootShell()
|
val shell = getRootShell()
|
||||||
val result = ShellUtils.fastCmd(shell, "${getSuSFSDaemonPath()} features")
|
val cmd = "${getSuSFSDaemonPath()} features"
|
||||||
return result
|
return runCmd(shell, cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun susfsSUS_SU_0(): String {
|
fun susfsSUS_SU_0(): String {
|
||||||
|
|||||||
@@ -446,7 +446,6 @@ Tanamkan: Secara permanen memasang ke sistem</string>
|
|||||||
<string name="auto_bind_mount_feature_label">Kaitan Bind Otomatis</string>
|
<string name="auto_bind_mount_feature_label">Kaitan Bind Otomatis</string>
|
||||||
<string name="auto_try_umount_bind_feature_label">Coba Lepas Kaitan Bind Otomatis</string>
|
<string name="auto_try_umount_bind_feature_label">Coba Lepas Kaitan Bind Otomatis</string>
|
||||||
<string name="hide_symbols_feature_label">Sembunyikan Simbol KSU SUSFS</string>
|
<string name="hide_symbols_feature_label">Sembunyikan Simbol KSU SUSFS</string>
|
||||||
<string name="magic_mount_feature_label">Dukungan Magic Mount</string>
|
|
||||||
<string name="sus_kstat_feature_label">Dukungan SUS Kstat</string>
|
<string name="sus_kstat_feature_label">Dukungan SUS Kstat</string>
|
||||||
<string name="sus_su_feature_label">Fitur Toggle Mode SUS SU</string>
|
<string name="sus_su_feature_label">Fitur Toggle Mode SUS SU</string>
|
||||||
<!-- 可切换状态 -->
|
<!-- 可切换状态 -->
|
||||||
|
|||||||
@@ -443,7 +443,6 @@
|
|||||||
<string name="auto_bind_mount_feature_label">Pemasangan Bind Otomatis</string>
|
<string name="auto_bind_mount_feature_label">Pemasangan Bind Otomatis</string>
|
||||||
<string name="auto_try_umount_bind_feature_label">Coba Umount Bind Mount Otomatis</string>
|
<string name="auto_try_umount_bind_feature_label">Coba Umount Bind Mount Otomatis</string>
|
||||||
<string name="hide_symbols_feature_label">Sembunyikan Simbol KSU SUSFS</string>
|
<string name="hide_symbols_feature_label">Sembunyikan Simbol KSU SUSFS</string>
|
||||||
<string name="magic_mount_feature_label">Dukungan Pemasangan Ajaib</string>
|
|
||||||
<string name="sus_kstat_feature_label">Dukungan SUS Kstat</string>
|
<string name="sus_kstat_feature_label">Dukungan SUS Kstat</string>
|
||||||
<string name="sus_su_feature_label">Fungsi pengalihan mode SUS SU</string>
|
<string name="sus_su_feature_label">Fungsi pengalihan mode SUS SU</string>
|
||||||
<!-- 可切换状态 -->
|
<!-- 可切换状态 -->
|
||||||
|
|||||||
@@ -443,7 +443,6 @@
|
|||||||
<string name="auto_bind_mount_feature_label">自動でバインドマウント</string>
|
<string name="auto_bind_mount_feature_label">自動でバインドマウント</string>
|
||||||
<string name="auto_try_umount_bind_feature_label">自動でバインドマウントのアンマウントを試す</string>
|
<string name="auto_try_umount_bind_feature_label">自動でバインドマウントのアンマウントを試す</string>
|
||||||
<string name="hide_symbols_feature_label">KSU SUSFS シンボルを非表示</string>
|
<string name="hide_symbols_feature_label">KSU SUSFS シンボルを非表示</string>
|
||||||
<string name="magic_mount_feature_label">Magic Mount の対応</string>
|
|
||||||
<string name="sus_kstat_feature_label">SUS Kstat の対応</string>
|
<string name="sus_kstat_feature_label">SUS Kstat の対応</string>
|
||||||
<string name="sus_su_feature_label">SUS SU モード切り替え機能</string>
|
<string name="sus_su_feature_label">SUS SU モード切り替え機能</string>
|
||||||
<!-- 可切换状态 -->
|
<!-- 可切换状态 -->
|
||||||
|
|||||||
@@ -443,7 +443,6 @@
|
|||||||
<string name="auto_bind_mount_feature_label">Автоматическое бинд монтирование</string>
|
<string name="auto_bind_mount_feature_label">Автоматическое бинд монтирование</string>
|
||||||
<string name="auto_try_umount_bind_feature_label">Автоматически попробовать размонтировать привязать монтировать</string>
|
<string name="auto_try_umount_bind_feature_label">Автоматически попробовать размонтировать привязать монтировать</string>
|
||||||
<string name="hide_symbols_feature_label">Скрытие KSU SUSFS Symbols</string>
|
<string name="hide_symbols_feature_label">Скрытие KSU SUSFS Symbols</string>
|
||||||
<string name="magic_mount_feature_label">Поддержка Magic Mount</string>
|
|
||||||
<string name="sus_kstat_feature_label">Поддержка SUS Kstat</string>
|
<string name="sus_kstat_feature_label">Поддержка SUS Kstat</string>
|
||||||
<string name="sus_su_feature_label">Функция переключения режима SUS SU</string>
|
<string name="sus_su_feature_label">Функция переключения режима SUS SU</string>
|
||||||
<!-- 可切换状态 -->
|
<!-- 可切换状态 -->
|
||||||
|
|||||||
@@ -441,7 +441,6 @@
|
|||||||
<string name="auto_bind_mount_feature_label">Otomatik Bağlama Noktası Bağlama</string>
|
<string name="auto_bind_mount_feature_label">Otomatik Bağlama Noktası Bağlama</string>
|
||||||
<string name="auto_try_umount_bind_feature_label">Otomatik Bağlamayı Kaldırmayı Dene Bağlama</string>
|
<string name="auto_try_umount_bind_feature_label">Otomatik Bağlamayı Kaldırmayı Dene Bağlama</string>
|
||||||
<string name="hide_symbols_feature_label">KSU SUSFS Sembollerini Gizle</string>
|
<string name="hide_symbols_feature_label">KSU SUSFS Sembollerini Gizle</string>
|
||||||
<string name="magic_mount_feature_label">Magic Mount Desteği</string>
|
|
||||||
<string name="sus_kstat_feature_label">SUS Kstat Desteği</string>
|
<string name="sus_kstat_feature_label">SUS Kstat Desteği</string>
|
||||||
<string name="sus_su_feature_label">SUS SU mod değiştirme işlevi</string>
|
<string name="sus_su_feature_label">SUS SU mod değiştirme işlevi</string>
|
||||||
<!-- 可切换状态 -->
|
<!-- 可切换状态 -->
|
||||||
|
|||||||
@@ -441,7 +441,6 @@
|
|||||||
<string name="auto_bind_mount_feature_label">Автоматичне прив\'язане монтування</string>
|
<string name="auto_bind_mount_feature_label">Автоматичне прив\'язане монтування</string>
|
||||||
<string name="auto_try_umount_bind_feature_label">Автоматична спроба відмонтування прив\'язаного монтування</string>
|
<string name="auto_try_umount_bind_feature_label">Автоматична спроба відмонтування прив\'язаного монтування</string>
|
||||||
<string name="hide_symbols_feature_label">Приховати символи KSU SUSFS</string>
|
<string name="hide_symbols_feature_label">Приховати символи KSU SUSFS</string>
|
||||||
<string name="magic_mount_feature_label">Підтримка Magic Mount</string>
|
|
||||||
<string name="sus_kstat_feature_label">Підтримка SUS Kstat</string>
|
<string name="sus_kstat_feature_label">Підтримка SUS Kstat</string>
|
||||||
<string name="sus_su_feature_label">Функція перемикання режиму SUS SU</string>
|
<string name="sus_su_feature_label">Функція перемикання режиму SUS SU</string>
|
||||||
<!-- 可切换状态 -->
|
<!-- 可切换状态 -->
|
||||||
|
|||||||
@@ -441,7 +441,6 @@
|
|||||||
<string name="auto_bind_mount_feature_label">Tự động Bind Mount</string>
|
<string name="auto_bind_mount_feature_label">Tự động Bind Mount</string>
|
||||||
<string name="auto_try_umount_bind_feature_label">Tự động Try Umount Bind Mount</string>
|
<string name="auto_try_umount_bind_feature_label">Tự động Try Umount Bind Mount</string>
|
||||||
<string name="hide_symbols_feature_label">Ẩn biểu tượng KSU SuSFS</string>
|
<string name="hide_symbols_feature_label">Ẩn biểu tượng KSU SuSFS</string>
|
||||||
<string name="magic_mount_feature_label">Hỗ trợ Magic Mount</string>
|
|
||||||
<string name="sus_kstat_feature_label">Hỗ trợ SuS Kstat</string>
|
<string name="sus_kstat_feature_label">Hỗ trợ SuS Kstat</string>
|
||||||
<string name="sus_su_feature_label">Chức năng chuyển đổi chế độ SuS SU</string>
|
<string name="sus_su_feature_label">Chức năng chuyển đổi chế độ SuS SU</string>
|
||||||
<!-- 可切换状态 -->
|
<!-- 可切换状态 -->
|
||||||
|
|||||||
@@ -441,7 +441,6 @@
|
|||||||
<string name="auto_bind_mount_feature_label">自动绑定挂载</string>
|
<string name="auto_bind_mount_feature_label">自动绑定挂载</string>
|
||||||
<string name="auto_try_umount_bind_feature_label">自动尝试卸载绑定挂载</string>
|
<string name="auto_try_umount_bind_feature_label">自动尝试卸载绑定挂载</string>
|
||||||
<string name="hide_symbols_feature_label">隐藏 KSU SuSFS 符号</string>
|
<string name="hide_symbols_feature_label">隐藏 KSU SuSFS 符号</string>
|
||||||
<string name="magic_mount_feature_label">魔法坐骑支持</string>
|
|
||||||
<string name="sus_kstat_feature_label">SuS Kstat 支持</string>
|
<string name="sus_kstat_feature_label">SuS Kstat 支持</string>
|
||||||
<string name="sus_su_feature_label">SuS SU 模式切换功能</string>
|
<string name="sus_su_feature_label">SuS SU 模式切换功能</string>
|
||||||
<!-- 可切换状态 -->
|
<!-- 可切换状态 -->
|
||||||
@@ -559,6 +558,8 @@
|
|||||||
<string name="add_custom_path">其他</string>
|
<string name="add_custom_path">其他</string>
|
||||||
<string name="add_app_path">应用</string>
|
<string name="add_app_path">应用</string>
|
||||||
<string name="susfs_add_app_path">添加应用路径</string>
|
<string name="susfs_add_app_path">添加应用路径</string>
|
||||||
|
<string name="susfs_version_mismatch">SuSFS 库版本不匹配,内核:%1$s vs 管理器:%2$s,建议更新内核或管理器</string>
|
||||||
|
<string name="warning">警告</string>
|
||||||
<string name="search_apps">搜索应用</string>
|
<string name="search_apps">搜索应用</string>
|
||||||
<string name="selected_apps_count">%1$d 个已选应用</string>
|
<string name="selected_apps_count">%1$d 个已选应用</string>
|
||||||
<string name="already_added_apps_count">%1$d 个已添加应用</string>
|
<string name="already_added_apps_count">%1$d 个已添加应用</string>
|
||||||
|
|||||||
@@ -438,7 +438,6 @@
|
|||||||
<string name="auto_bind_mount_feature_label">自動綁定掛載</string>
|
<string name="auto_bind_mount_feature_label">自動綁定掛載</string>
|
||||||
<string name="auto_try_umount_bind_feature_label">自動嘗試卸載綁定掛載</string>
|
<string name="auto_try_umount_bind_feature_label">自動嘗試卸載綁定掛載</string>
|
||||||
<string name="hide_symbols_feature_label">隱藏 KSU SuSFS 符號</string>
|
<string name="hide_symbols_feature_label">隱藏 KSU SuSFS 符號</string>
|
||||||
<string name="magic_mount_feature_label">魔法坐騎支援</string>
|
|
||||||
<string name="sus_kstat_feature_label">SuS Kstat 支援</string>
|
<string name="sus_kstat_feature_label">SuS Kstat 支援</string>
|
||||||
<string name="sus_su_feature_label">SuS SU 模式切換功能</string>
|
<string name="sus_su_feature_label">SuS SU 模式切換功能</string>
|
||||||
<!-- 可切换状态 -->
|
<!-- 可切换状态 -->
|
||||||
|
|||||||
@@ -441,7 +441,6 @@
|
|||||||
<string name="auto_bind_mount_feature_label">自動綁定掛載</string>
|
<string name="auto_bind_mount_feature_label">自動綁定掛載</string>
|
||||||
<string name="auto_try_umount_bind_feature_label">自動嘗試卸載綁定掛載</string>
|
<string name="auto_try_umount_bind_feature_label">自動嘗試卸載綁定掛載</string>
|
||||||
<string name="hide_symbols_feature_label">隱藏 KSU SuSFS 符號</string>
|
<string name="hide_symbols_feature_label">隱藏 KSU SuSFS 符號</string>
|
||||||
<string name="magic_mount_feature_label">魔法掛載支援</string>
|
|
||||||
<string name="sus_kstat_feature_label">SuS 內核統計支援</string>
|
<string name="sus_kstat_feature_label">SuS 內核統計支援</string>
|
||||||
<string name="sus_su_feature_label">SuS SU 模式切換功能</string>
|
<string name="sus_su_feature_label">SuS SU 模式切換功能</string>
|
||||||
<!-- 可切换状态 -->
|
<!-- 可切换状态 -->
|
||||||
|
|||||||
@@ -443,7 +443,6 @@
|
|||||||
<string name="auto_bind_mount_feature_label">Auto Bind Mount</string>
|
<string name="auto_bind_mount_feature_label">Auto Bind Mount</string>
|
||||||
<string name="auto_try_umount_bind_feature_label">Auto Try Umount Bind Mount</string>
|
<string name="auto_try_umount_bind_feature_label">Auto Try Umount Bind Mount</string>
|
||||||
<string name="hide_symbols_feature_label">Hide KSU SUSFS Symbols</string>
|
<string name="hide_symbols_feature_label">Hide KSU SUSFS Symbols</string>
|
||||||
<string name="magic_mount_feature_label">Magic Mount Support</string>
|
|
||||||
<string name="sus_kstat_feature_label">SUS Kstat Support</string>
|
<string name="sus_kstat_feature_label">SUS Kstat Support</string>
|
||||||
<string name="sus_su_feature_label">SUS SU mode switching function</string>
|
<string name="sus_su_feature_label">SUS SU mode switching function</string>
|
||||||
<!-- 可切换状态 -->
|
<!-- 可切换状态 -->
|
||||||
@@ -561,6 +560,8 @@
|
|||||||
<string name="add_custom_path">Other</string>
|
<string name="add_custom_path">Other</string>
|
||||||
<string name="add_app_path">App</string>
|
<string name="add_app_path">App</string>
|
||||||
<string name="susfs_add_app_path">Add App Path</string>
|
<string name="susfs_add_app_path">Add App Path</string>
|
||||||
|
<string name="susfs_version_mismatch">SuSFS library version mismatch, kernel: %1$s vs manager: %2$s, It is recommended to update the kernel or manager</string>
|
||||||
|
<string name="warning">Warning</string>
|
||||||
<string name="search_apps">Search Apps</string>
|
<string name="search_apps">Search Apps</string>
|
||||||
<string name="selected_apps_count">%1$d apps selected</string>
|
<string name="selected_apps_count">%1$d apps selected</string>
|
||||||
<string name="already_added_apps_count">%1$d apps already added</string>
|
<string name="already_added_apps_count">%1$d apps already added</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user