diff --git a/manager/app/src/main/java/com/rifsxd/ksunext/ui/screen/Home.kt b/manager/app/src/main/java/com/rifsxd/ksunext/ui/screen/Home.kt index 83a9fb6a..32a9b131 100644 --- a/manager/app/src/main/java/com/rifsxd/ksunext/ui/screen/Home.kt +++ b/manager/app/src/main/java/com/rifsxd/ksunext/ui/screen/Home.kt @@ -268,14 +268,14 @@ private fun StatusCard( text = stringResource(R.string.home_module_count, getModuleCount()), style = MaterialTheme.typography.bodyMedium ) - Spacer(Modifier.height(4.dp)) - val suSFS = getSuSFS() - if (suSFS == "Supported") { - Text( - text = stringResource(R.string.home_susfs, getSuSFS()), - style = MaterialTheme.typography.bodyMedium - ) - } + // Spacer(Modifier.height(4.dp)) + // val suSFS = getSuSFS() + // if (suSFS == "Supported") { + // Text( + // text = stringResource(R.string.home_susfs, getSuSFS()), + // style = MaterialTheme.typography.bodyMedium + // ) + // } } } @@ -399,7 +399,7 @@ private fun InfoCard() { val managerVersion = getManagerVersion(context) InfoCardItem( label = stringResource(R.string.home_manager_version), - content = "${managerVersion.first}-next (${managerVersion.second})", + content = "${managerVersion.first} (${managerVersion.second})", icon = painterResource(R.drawable.ic_ksu_next), ) @@ -409,19 +409,26 @@ private fun InfoCard() { content = getSELinuxStatus(), icon = Icons.Filled.Security, ) - - Spacer(Modifier.height(16.dp)) - val isSUS_SU = getSuSFSFeatures() == "CONFIG_KSU_SUSFS_SUS_SU" - val suSFS = getSuSFS() - if (suSFS == "Supported") { - val susSUMode = if (isSUS_SU) "| SuS SU mode: ${susfsSUS_SU_Mode()}" else "" - InfoCardItem( - label = stringResource(R.string.home_susfs_version), - content = "${getSuSFSVersion()} (${getSuSFSVariant()}) $susSUMode", - icon = painterResource(R.drawable.ic_sus), - ) - } + Spacer(Modifier.height(16.dp)) + InfoCardItem( + label = stringResource(R.string.home_module_mount), + content = stringResource(R.string.home_magic_mount), + icon = Icons.Filled.SettingsSuggest, + ) + + // Spacer(Modifier.height(16.dp)) + // val isSUS_SU = getSuSFSFeatures() == "CONFIG_KSU_SUSFS_SUS_SU" + // val suSFS = getSuSFS() + + // if (suSFS == "Supported") { + // val susSUMode = if (isSUS_SU) "| SuS SU mode: ${susfsSUS_SU_Mode()}" else "" + // InfoCardItem( + // label = stringResource(R.string.home_susfs_version), + // content = "${getSuSFSVersion()} (${getSuSFSVariant()}) $susSUMode", + // icon = painterResource(R.drawable.ic_sus), + // ) + // } } } } diff --git a/manager/app/src/main/java/com/rifsxd/ksunext/ui/screen/Module.kt b/manager/app/src/main/java/com/rifsxd/ksunext/ui/screen/Module.kt index 34df8b70..60de555b 100644 --- a/manager/app/src/main/java/com/rifsxd/ksunext/ui/screen/Module.kt +++ b/manager/app/src/main/java/com/rifsxd/ksunext/ui/screen/Module.kt @@ -416,7 +416,7 @@ private fun ModuleList( val success = loadingDialog.withLoading { withContext(Dispatchers.IO) { - uninstallModule(module.id) + uninstallModule(module.dirId) } } @@ -456,7 +456,7 @@ private fun ModuleList( val success = loadingDialog.withLoading { withContext(Dispatchers.IO) { - restoreModule(module.id) + restoreModule(module.dirId) } } @@ -489,7 +489,7 @@ private fun ModuleList( }, ) { when { - !viewModel.isOverlayAvailable -> { + !viewModel.isDummy -> { item { Box( modifier = Modifier.fillParentMaxSize(), @@ -542,7 +542,7 @@ private fun ModuleList( scope.launch { val success = loadingDialog.withLoading { withContext(Dispatchers.IO) { - toggleModule(module.id, !isChecked) + toggleModule(module.dirId, !isChecked) } } if (success) { @@ -705,7 +705,7 @@ fun ModuleItem( FilledTonalButton( modifier = Modifier.defaultMinSize(52.dp, 32.dp), onClick = { - navigator.navigate(ExecuteModuleActionScreenDestination(module.id)) + navigator.navigate(ExecuteModuleActionScreenDestination(module.dirId)) viewModel.markNeedRefresh() }, contentPadding = ButtonDefaults.TextButtonContentPadding @@ -840,7 +840,8 @@ fun ModuleItemPreview() { remove = false, updateJson = "", hasWebUi = false, - hasActionScript = false + hasActionScript = false, + dirId = "dirId" ) ModuleItem(EmptyDestinationsNavigator, module, true, "", {}, {}, {}, {}, {}) } \ No newline at end of file diff --git a/manager/app/src/main/java/com/rifsxd/ksunext/ui/screen/Settings.kt b/manager/app/src/main/java/com/rifsxd/ksunext/ui/screen/Settings.kt index 9ddf3d91..be797445 100644 --- a/manager/app/src/main/java/com/rifsxd/ksunext/ui/screen/Settings.kt +++ b/manager/app/src/main/java/com/rifsxd/ksunext/ui/screen/Settings.kt @@ -160,31 +160,31 @@ fun SettingScreen(navigator: DestinationsNavigator) { val prefs = context.getSharedPreferences("settings", Context.MODE_PRIVATE) - val isSUS_SU = getSuSFSFeatures() - if (isSUS_SU == "CONFIG_KSU_SUSFS_SUS_SU") { - var isEnabled by rememberSaveable { - mutableStateOf(susfsSUS_SU_Mode() == "2") - } + // val isSUS_SU = getSuSFSFeatures() + // if (isSUS_SU == "CONFIG_KSU_SUSFS_SUS_SU") { + // var isEnabled by rememberSaveable { + // mutableStateOf(susfsSUS_SU_Mode() == "2") + // } - LaunchedEffect(Unit) { - isEnabled = susfsSUS_SU_Mode() == "2" - } + // LaunchedEffect(Unit) { + // isEnabled = susfsSUS_SU_Mode() == "2" + // } - SwitchItem( - icon = Icons.Filled.VisibilityOff, - title = stringResource(id = R.string.settings_susfs_toggle), - summary = stringResource(id = R.string.settings_susfs_toggle_summary), - checked = isEnabled - ) { - if (it) { - susfsSUS_SU_2() - } else { - susfsSUS_SU_0() - } - prefs.edit().putBoolean("enable_sus_su", it).apply() - isEnabled = it - } - } + // SwitchItem( + // icon = Icons.Filled.VisibilityOff, + // title = stringResource(id = R.string.settings_susfs_toggle), + // summary = stringResource(id = R.string.settings_susfs_toggle_summary), + // checked = isEnabled + // ) { + // if (it) { + // susfsSUS_SU_2() + // } else { + // susfsSUS_SU_0() + // } + // prefs.edit().putBoolean("enable_sus_su", it).apply() + // isEnabled = it + // } + // } var checkUpdate by rememberSaveable { mutableStateOf( diff --git a/manager/app/src/main/java/com/rifsxd/ksunext/ui/util/KsuCli.kt b/manager/app/src/main/java/com/rifsxd/ksunext/ui/util/KsuCli.kt index 78ca4003..4a3f57b4 100644 --- a/manager/app/src/main/java/com/rifsxd/ksunext/ui/util/KsuCli.kt +++ b/manager/app/src/main/java/com/rifsxd/ksunext/ui/util/KsuCli.kt @@ -120,50 +120,50 @@ fun getModuleCount(): Int { }.getOrElse { return 0 } } -private fun getSuSFSDaemonPath(): String { - return ksuApp.applicationInfo.nativeLibraryDir + File.separator + "libsusfsd.so" -} +// private fun getSuSFSDaemonPath(): String { +// return ksuApp.applicationInfo.nativeLibraryDir + File.separator + "libsusfsd.so" +// } -fun getSuSFS(): String { - val shell = getRootShell() - val result = ShellUtils.fastCmd(shell, "${getSuSFSDaemonPath()} support") - return result -} +// fun getSuSFS(): String { +// val shell = getRootShell() +// val result = ShellUtils.fastCmd(shell, "${getSuSFSDaemonPath()} support") +// return result +// } -fun getSuSFSVersion(): String { - val shell = getRootShell() - val result = ShellUtils.fastCmd(shell, "${getSuSFSDaemonPath()} version") - return result -} +// fun getSuSFSVersion(): String { +// val shell = getRootShell() +// val result = ShellUtils.fastCmd(shell, "${getSuSFSDaemonPath()} version") +// return result +// } -fun getSuSFSVariant(): String { - val shell = getRootShell() - val result = ShellUtils.fastCmd(shell, "${getSuSFSDaemonPath()} variant") - return result -} -fun getSuSFSFeatures(): String { - val shell = getRootShell() - val result = ShellUtils.fastCmd(shell, "${getSuSFSDaemonPath()} features") - return result -} +// fun getSuSFSVariant(): String { +// val shell = getRootShell() +// val result = ShellUtils.fastCmd(shell, "${getSuSFSDaemonPath()} variant") +// return result +// } +// fun getSuSFSFeatures(): String { +// val shell = getRootShell() +// val result = ShellUtils.fastCmd(shell, "${getSuSFSDaemonPath()} features") +// return result +// } -fun susfsSUS_SU_0(): String { - val shell = getRootShell() - val result = ShellUtils.fastCmd(shell, "${getSuSFSDaemonPath()} sus_su 0") - return result -} +// fun susfsSUS_SU_0(): String { +// val shell = getRootShell() +// val result = ShellUtils.fastCmd(shell, "${getSuSFSDaemonPath()} sus_su 0") +// return result +// } -fun susfsSUS_SU_2(): String { - val shell = getRootShell() - val result = ShellUtils.fastCmd(shell, "${getSuSFSDaemonPath()} sus_su 2") - return result -} +// fun susfsSUS_SU_2(): String { +// val shell = getRootShell() +// val result = ShellUtils.fastCmd(shell, "${getSuSFSDaemonPath()} sus_su 2") +// return result +// } -fun susfsSUS_SU_Mode(): String { - val shell = getRootShell() - val result = ShellUtils.fastCmd(shell, "${getSuSFSDaemonPath()} sus_su mode") - return result -} +// fun susfsSUS_SU_Mode(): String { +// val shell = getRootShell() +// val result = ShellUtils.fastCmd(shell, "${getSuSFSDaemonPath()} sus_su mode") +// return result +// } fun getSuperuserCount(): Int { return Natives.allowList.size @@ -403,10 +403,12 @@ suspend fun getSupportedKmis(): List = withContext(Dispatchers.IO) { out.filter { it.isNotBlank() }.map { it.trim() } } -fun overlayFsAvailable(): Boolean { - val shell = getRootShell() - // check /proc/filesystems - return ShellUtils.fastCmdResult(shell, "cat /proc/filesystems | grep overlay") +fun hasDummy(): Boolean { +//fun overlayFsAvailable(): Boolean { + // val shell = getRootShell() + // // check /proc/filesystems + // return ShellUtils.fastCmdResult(shell, "cat /proc/filesystems | grep overlay") + return true } fun hasMagisk(): Boolean { diff --git a/manager/app/src/main/java/com/rifsxd/ksunext/ui/viewmodel/ModuleViewModel.kt b/manager/app/src/main/java/com/rifsxd/ksunext/ui/viewmodel/ModuleViewModel.kt index d9c1efaa..73442eef 100644 --- a/manager/app/src/main/java/com/rifsxd/ksunext/ui/viewmodel/ModuleViewModel.kt +++ b/manager/app/src/main/java/com/rifsxd/ksunext/ui/viewmodel/ModuleViewModel.kt @@ -11,7 +11,7 @@ import androidx.lifecycle.viewModelScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import com.rifsxd.ksunext.ui.util.listModules -import com.rifsxd.ksunext.ui.util.overlayFsAvailable +import com.rifsxd.ksunext.ui.util.hasDummy import org.json.JSONArray import org.json.JSONObject @@ -35,6 +35,7 @@ class ModuleViewModel : ViewModel() { val updateJson: String, val hasWebUi: Boolean, val hasActionScript: Boolean, + val dirId: String ) data class ModuleUpdateInfo( @@ -44,7 +45,7 @@ class ModuleViewModel : ViewModel() { val changelog: String, ) - var isOverlayAvailable by mutableStateOf(overlayFsAvailable()) + var isDummy by mutableStateOf(hasDummy()) private set var isRefreshing by mutableStateOf(false) @@ -79,7 +80,7 @@ class ModuleViewModel : ViewModel() { val start = SystemClock.elapsedRealtime() kotlin.runCatching { - isOverlayAvailable = overlayFsAvailable() + isDummy = hasDummy() val result = listModules() @@ -102,7 +103,8 @@ class ModuleViewModel : ViewModel() { obj.getBoolean("remove"), obj.optString("updateJson"), obj.optBoolean("web"), - obj.optBoolean("action") + obj.optBoolean("action"), + obj.getString("dir_id") ) }.toList() isNeedRefresh = false diff --git a/manager/app/src/main/res/values-in/strings.xml b/manager/app/src/main/res/values-in/strings.xml index 0f551990..6f6e5da4 100644 --- a/manager/app/src/main/res/values-in/strings.xml +++ b/manager/app/src/main/res/values-in/strings.xml @@ -63,6 +63,8 @@ Mode aman Reboot agar berfungsi Konflik dengan Magisk, fungsi modul ditiadakan! + Modul Sistem + Magic Mount 🔥 Pembangunan Next https://github.com/rifsxd/KernelSU-Next Next cabang eksperimental. Lihat di GitHub! diff --git a/manager/app/src/main/res/values-zh-rCN/strings.xml b/manager/app/src/main/res/values-zh-rCN/strings.xml index 926a9a16..2a9256ec 100644 --- a/manager/app/src/main/res/values-zh-rCN/strings.xml +++ b/manager/app/src/main/res/values-zh-rCN/strings.xml @@ -64,6 +64,8 @@ 发送日志 安全模式 重启生效 + 模組系統 + 魔法坐騎 因与Magisk有冲突,所有模块不可用! 🔥 Next 构建 https://github.com/rifsxd/KernelSU-Next diff --git a/manager/app/src/main/res/values/strings.xml b/manager/app/src/main/res/values/strings.xml index 494f5e2d..51d69f49 100644 --- a/manager/app/src/main/res/values/strings.xml +++ b/manager/app/src/main/res/values/strings.xml @@ -18,13 +18,13 @@ Modules: %d KernelSU Next v2 signature not found in kernel! [ !KSU_NEXT || != size/hash ] Ask your kernel developer to integrate KernelSU Next! - Kernel + Kernel Version SuSFS: %s SuSFS SuS SU - Android - Manager - SELinux + Android Version + Manager Version + SELinux Mode Disabled Enforcing Permissive @@ -33,7 +33,7 @@ Failed to enable module: %s Failed to disable module: %s No module installed - Module + Module System Confirm Installation Do you want to continue installing module %1$s? Sort (Action First) @@ -66,6 +66,8 @@ Safe mode Reboot to take effect Modules are unavailable due to a conflict with Magisk! + Module System + Magic Mount 🔥 Next Build https://github.com/rifsxd/KernelSU-Next Next experimental branch. Check it out on GitHub!