manager: improved mount system info fetching logic

This commit is contained in:
rifsxd
2025-04-02 15:45:20 +06:00
parent 02dbb7d0f7
commit 5cec5aa656
19 changed files with 28 additions and 24 deletions

View File

@@ -446,15 +446,11 @@ private fun InfoCard() {
Spacer(Modifier.height(16.dp)) Spacer(Modifier.height(16.dp))
InfoCardItem( InfoCardItem(
label = stringResource(R.string.home_module_mount), label = stringResource(R.string.home_mount_system),
content = when { content = currentMountSystem().ifEmpty { stringResource(R.string.unavailable) },
ksuVersion == null -> stringResource(R.string.unavailable)
useOverlayFs -> stringResource(R.string.home_overlayfs_mount)
else -> stringResource(R.string.home_magic_mount)
},
icon = Icons.Filled.SettingsSuggest, icon = Icons.Filled.SettingsSuggest,
) )
Spacer(Modifier.height(16.dp))
val suSFS = getSuSFS() val suSFS = getSuSFS()
if (suSFS == "Supported") { if (suSFS == "Supported") {
val isSUS_SU = getSuSFSFeatures() == "CONFIG_KSU_SUSFS_SUS_SU" val isSUS_SU = getSuSFSFeatures() == "CONFIG_KSU_SUSFS_SUS_SU"
@@ -463,6 +459,7 @@ private fun InfoCard() {
val modeString = if (mode == "2") stringResource(R.string.enabled) else stringResource(R.string.disabled) val modeString = if (mode == "2") stringResource(R.string.enabled) else stringResource(R.string.disabled)
"| SuS SU: $modeString" "| SuS SU: $modeString"
} else "" } else ""
Spacer(Modifier.height(16.dp))
InfoCardItem( InfoCardItem(
label = stringResource(R.string.home_susfs_version), label = stringResource(R.string.home_susfs_version),
content = "${getSuSFSVersion()} (${getSuSFSVariant()}) $susSUMode", content = "${getSuSFSVersion()} (${getSuSFSVariant()}) $susSUMode",

View File

@@ -600,6 +600,13 @@ fun susfsSUS_SU_Mode(): String {
return result return result
} }
fun currentMountSystem(): String {
val shell = getRootShell()
val cmd = "module mount"
val result = ShellUtils.fastCmd(shell, "${getKsuDaemonPath()} $cmd").trim()
return result.substringAfter(":").substringAfter(" ").trim()
}
fun setAppProfileTemplate(id: String, template: String): Boolean { fun setAppProfileTemplate(id: String, template: String): Boolean {
val shell = getRootShell() val shell = getRootShell()
val escapedTemplate = template.replace("\"", "\\\"") val escapedTemplate = template.replace("\"", "\\\"")

View File

@@ -74,7 +74,7 @@
<string name="safe_mode">وضع الأمان</string> <string name="safe_mode">وضع الأمان</string>
<string name="reboot_to_apply">إعادة التشغيل لتطبيق التغييرات</string> <string name="reboot_to_apply">إعادة التشغيل لتطبيق التغييرات</string>
<string name="module_magisk_conflict">الإضافات غير متاحة بسبب تعارض مع Magisk!</string> <string name="module_magisk_conflict">الإضافات غير متاحة بسبب تعارض مع Magisk!</string>
<string name="home_module_mount">نظام الإضافات</string> <string name="home_mount_system">نظام الإضافات</string>
<string name="home_magic_mount">Mount السحري</string> <string name="home_magic_mount">Mount السحري</string>
<string name="home_overlayfs_mount">OverlayFS</string> <string name="home_overlayfs_mount">OverlayFS</string>
<string name="unavailable">غير متاح</string> <string name="unavailable">غير متاح</string>

View File

@@ -71,7 +71,7 @@
<string name="safe_mode">Безопасен режим</string> <string name="safe_mode">Безопасен режим</string>
<string name="reboot_to_apply">Рестартирайте, за да влязат в сила промените</string> <string name="reboot_to_apply">Рестартирайте, за да влязат в сила промените</string>
<string name="module_magisk_conflict">Модулите не са налични поради конфликт с Magisk!</string> <string name="module_magisk_conflict">Модулите не са налични поради конфликт с Magisk!</string>
<string name="home_module_mount">Модулна система</string> <string name="home_mount_system">Модулна система</string>
<string name="home_magic_mount">Magic Mount</string> <string name="home_magic_mount">Magic Mount</string>
<string name="home_overlayfs_mount">OverlayFS</string> <string name="home_overlayfs_mount">OverlayFS</string>
<string name="unavailable">Недостъпно</string> <string name="unavailable">Недостъпно</string>

View File

@@ -71,7 +71,7 @@
<string name="safe_mode">Abgesicherter Modus</string> <string name="safe_mode">Abgesicherter Modus</string>
<string name="reboot_to_apply">Neustart, um wirksam zu werden</string> <string name="reboot_to_apply">Neustart, um wirksam zu werden</string>
<string name="module_magisk_conflict">Die Module sind aufgrund eines Konflikts mit Magisk nicht verfügbar!</string> <string name="module_magisk_conflict">Die Module sind aufgrund eines Konflikts mit Magisk nicht verfügbar!</string>
<string name="home_module_mount">Modul system</string> <string name="home_mount_system">Modul system</string>
<string name="home_magic_mount">Magic Mount</string> <string name="home_magic_mount">Magic Mount</string>
<string name="home_overlayfs_mount">OverlayFS</string> <string name="home_overlayfs_mount">OverlayFS</string>
<string name="unavailable">Nicht verfügbar</string> <string name="unavailable">Nicht verfügbar</string>

View File

@@ -67,7 +67,7 @@
<string name="safe_mode">Mode sécurisé</string> <string name="safe_mode">Mode sécurisé</string>
<string name="reboot_to_apply">Redémarrer pour appliquer les changements</string> <string name="reboot_to_apply">Redémarrer pour appliquer les changements</string>
<string name="module_magisk_conflict">Les modules sont indisponibles en raison d\'un conflit avec Magisk!</string> <string name="module_magisk_conflict">Les modules sont indisponibles en raison d\'un conflit avec Magisk!</string>
<string name="home_module_mount">Système de module</string> <string name="home_mount_system">Système de module</string>
<string name="home_magic_mount">Magic Mount</string> <string name="home_magic_mount">Magic Mount</string>
<string name="home_overlayfs_mount">OverlayFS</string> <string name="home_overlayfs_mount">OverlayFS</string>
<string name="unavailable">Indisponible</string> <string name="unavailable">Indisponible</string>

View File

@@ -69,7 +69,7 @@
<string name="safe_mode">Mode aman</string> <string name="safe_mode">Mode aman</string>
<string name="reboot_to_apply">Reboot agar berfungsi</string> <string name="reboot_to_apply">Reboot agar berfungsi</string>
<string name="module_magisk_conflict">Konflik dengan Magisk, fungsi modul ditiadakan!</string> <string name="module_magisk_conflict">Konflik dengan Magisk, fungsi modul ditiadakan!</string>
<string name="home_module_mount">Modul Sistem</string> <string name="home_mount_system">Modul Sistem</string>
<string name="home_magic_mount">Magic Mount</string> <string name="home_magic_mount">Magic Mount</string>
<string name="home_overlayfs_mount">OverlayFS</string> <string name="home_overlayfs_mount">OverlayFS</string>
<string name="unavailable">Tidak Tersedia</string> <string name="unavailable">Tidak Tersedia</string>

View File

@@ -74,7 +74,7 @@
<string name="safe_mode">Modalità provvisoria</string> <string name="safe_mode">Modalità provvisoria</string>
<string name="reboot_to_apply">Riavvia per applicare la modifica</string> <string name="reboot_to_apply">Riavvia per applicare la modifica</string>
<string name="module_magisk_conflict">I moduli sono disabilitati perché in conflitto con Magisk!</string> <string name="module_magisk_conflict">I moduli sono disabilitati perché in conflitto con Magisk!</string>
<string name="home_module_mount">Modulo system</string> <string name="home_mount_system">Modulo system</string>
<string name="home_magic_mount">Magic Mount</string> <string name="home_magic_mount">Magic Mount</string>
<string name="home_overlayfs_mount">OverlayFS</string> <string name="home_overlayfs_mount">OverlayFS</string>
<string name="unavailable">Non disponibile</string> <string name="unavailable">Non disponibile</string>

View File

@@ -65,7 +65,7 @@
<string name="safe_mode">セーフモード</string> <string name="safe_mode">セーフモード</string>
<string name="reboot_to_apply">再起動して適用</string> <string name="reboot_to_apply">再起動して適用</string>
<string name="module_magisk_conflict">Magiskとの競合により、モジュールは使用できません。</string> <string name="module_magisk_conflict">Magiskとの競合により、モジュールは使用できません。</string>
<string name="home_module_mount">モジュールシステム</string> <string name="home_mount_system">モジュールシステム</string>
<string name="home_magic_mount">Magicマウント</string> <string name="home_magic_mount">Magicマウント</string>
<string name="home_overlayfs_mount">OverlayFS</string> <string name="home_overlayfs_mount">OverlayFS</string>
<string name="unavailable">利用不可</string> <string name="unavailable">利用不可</string>

View File

@@ -71,7 +71,7 @@
<string name="safe_mode">안전 모드</string> <string name="safe_mode">안전 모드</string>
<string name="reboot_to_apply">다시 시작하여 변경 사항 적용</string> <string name="reboot_to_apply">다시 시작하여 변경 사항 적용</string>
<string name="module_magisk_conflict">Magisk와의 충돌로 모듈을 사용할 수 없습니다.!</string> <string name="module_magisk_conflict">Magisk와의 충돌로 모듈을 사용할 수 없습니다.!</string>
<string name="home_module_mount">모듈 마운트 시스템</string> <string name="home_mount_system">모듈 마운트 시스템</string>
<string name="home_magic_mount">Magic Mount</string> <string name="home_magic_mount">Magic Mount</string>
<string name="home_overlayfs_mount">OverlayFS</string> <string name="home_overlayfs_mount">OverlayFS</string>
<string name="unavailable">이용할 수 없음</string> <string name="unavailable">이용할 수 없음</string>

View File

@@ -74,7 +74,7 @@
<string name="safe_mode">Tryb awaryjny</string> <string name="safe_mode">Tryb awaryjny</string>
<string name="reboot_to_apply">Uruchom ponownie, aby zastosować zmiany</string> <string name="reboot_to_apply">Uruchom ponownie, aby zastosować zmiany</string>
<string name="module_magisk_conflict">Moduły są niedostępne z powodu konfliku z Magisk!</string> <string name="module_magisk_conflict">Moduły są niedostępne z powodu konfliku z Magisk!</string>
<string name="home_module_mount">System montowania</string> <string name="home_mount_system">System montowania</string>
<string name="home_magic_mount">Magic Mount</string> <string name="home_magic_mount">Magic Mount</string>
<string name="home_overlayfs_mount">OverlayFS</string> <string name="home_overlayfs_mount">OverlayFS</string>
<string name="unavailable">Niedostępny</string> <string name="unavailable">Niedostępny</string>

View File

@@ -74,7 +74,7 @@
<string name="safe_mode">Modo de segurança</string> <string name="safe_mode">Modo de segurança</string>
<string name="reboot_to_apply">Reinicie para entrar em vigor</string> <string name="reboot_to_apply">Reinicie para entrar em vigor</string>
<string name="module_magisk_conflict">Os módulos estão indisponíveis devido a um conflito com Magisk!</string> <string name="module_magisk_conflict">Os módulos estão indisponíveis devido a um conflito com Magisk!</string>
<string name="home_module_mount">Sistema de módulos</string> <string name="home_mount_system">Sistema de módulos</string>
<string name="home_magic_mount">Magic Mount</string> <string name="home_magic_mount">Magic Mount</string>
<string name="home_overlayfs_mount">OverlayFS</string> <string name="home_overlayfs_mount">OverlayFS</string>
<string name="unavailable">Indisponível</string> <string name="unavailable">Indisponível</string>

View File

@@ -74,7 +74,7 @@
<string name="safe_mode">Безопасный режим</string> <string name="safe_mode">Безопасный режим</string>
<string name="reboot_to_apply">Перезагрузите для применения</string> <string name="reboot_to_apply">Перезагрузите для применения</string>
<string name="module_magisk_conflict">Модули недоступны из-за конфликта с Magisk!</string> <string name="module_magisk_conflict">Модули недоступны из-за конфликта с Magisk!</string>
<string name="home_module_mount">Система монтирования модулей</string> <string name="home_mount_system">Система монтирования модулей</string>
<string name="home_magic_mount">Magic Mount</string> <string name="home_magic_mount">Magic Mount</string>
<string name="home_overlayfs_mount">OverlayFS</string> <string name="home_overlayfs_mount">OverlayFS</string>
<string name="unavailable">Недоступно</string> <string name="unavailable">Недоступно</string>

View File

@@ -65,7 +65,7 @@
<string name="safe_mode">โหมดปลอดภัย</string> <string name="safe_mode">โหมดปลอดภัย</string>
<string name="reboot_to_apply">รีบูตเพื่อให้มีผล</string> <string name="reboot_to_apply">รีบูตเพื่อให้มีผล</string>
<string name="module_magisk_conflict">โมดูลไม่สามารถใช้งานได้ เนื่องจากขัดแย้งกับ Magisk!</string> <string name="module_magisk_conflict">โมดูลไม่สามารถใช้งานได้ เนื่องจากขัดแย้งกับ Magisk!</string>
<string name="home_module_mount">โมดูลระบบ</string> <string name="home_mount_system">โมดูลระบบ</string>
<string name="home_magic_mount">Magic Mount</string> <string name="home_magic_mount">Magic Mount</string>
<string name="home_overlayfs_mount">OverlayFS</string> <string name="home_overlayfs_mount">OverlayFS</string>
<string name="unavailable">ไม่สามารถใช้งานได้</string> <string name="unavailable">ไม่สามารถใช้งานได้</string>

View File

@@ -65,7 +65,7 @@
<string name="safe_mode">Güvenli Mod</string> <string name="safe_mode">Güvenli Mod</string>
<string name="reboot_to_apply">Değişikliklerin etkili olması için yeniden başlatın</string> <string name="reboot_to_apply">Değişikliklerin etkili olması için yeniden başlatın</string>
<string name="module_magisk_conflict">Magisk ile çakışma nedeniyle modüller kullanılamıyor!</string> <string name="module_magisk_conflict">Magisk ile çakışma nedeniyle modüller kullanılamıyor!</string>
<string name="home_module_mount">Modül Sistemi</string> <string name="home_mount_system">Modül Sistemi</string>
<string name="home_magic_mount">Magic Mount</string> <string name="home_magic_mount">Magic Mount</string>
<string name="home_overlayfs_mount">OverlayFS</string> <string name="home_overlayfs_mount">OverlayFS</string>
<string name="unavailable">Kullanılamaz</string> <string name="unavailable">Kullanılamaz</string>

View File

@@ -71,7 +71,7 @@
<string name="safe_mode">CHẾ ĐỘ AN TOÀN!?!?</string> <string name="safe_mode">CHẾ ĐỘ AN TOÀN!?!?</string>
<string name="reboot_to_apply">Khởi động lại để có hiệu lực</string> <string name="reboot_to_apply">Khởi động lại để có hiệu lực</string>
<string name="module_magisk_conflict">Vui lòng gỡ magisk để sử dụng module</string> <string name="module_magisk_conflict">Vui lòng gỡ magisk để sử dụng module</string>
<string name="home_module_mount">Module hệ thống</string> <string name="home_mount_system">Module hệ thống</string>
<string name="home_magic_mount">Magic Mount</string> <string name="home_magic_mount">Magic Mount</string>
<string name="home_overlayfs_mount">OverlayFS</string> <string name="home_overlayfs_mount">OverlayFS</string>
<string name="unavailable">Không có sẵn</string> <string name="unavailable">Không có sẵn</string>

View File

@@ -71,7 +71,7 @@
<string name="safe_mode">安全模式</string> <string name="safe_mode">安全模式</string>
<string name="reboot_to_apply">重启生效</string> <string name="reboot_to_apply">重启生效</string>
<string name="module_magisk_conflict">由于与 Magisk 冲突,模块不可用。</string> <string name="module_magisk_conflict">由于与 Magisk 冲突,模块不可用。</string>
<string name="home_module_mount">模块系统</string> <string name="home_mount_system">模块系统</string>
<string name="home_magic_mount">Magic Mount</string> <string name="home_magic_mount">Magic Mount</string>
<string name="home_overlayfs_mount">OverlayFS</string> <string name="home_overlayfs_mount">OverlayFS</string>
<string name="unavailable">不可用</string> <string name="unavailable">不可用</string>

View File

@@ -71,7 +71,7 @@
<string name="safe_mode">安全模式</string> <string name="safe_mode">安全模式</string>
<string name="reboot_to_apply">重啟生效</string> <string name="reboot_to_apply">重啟生效</string>
<string name="module_magisk_conflict">由於與 Magisk 有衝突,所有模組不可用!</string> <string name="module_magisk_conflict">由於與 Magisk 有衝突,所有模組不可用!</string>
<string name="home_module_mount">模組系統</string> <string name="home_mount_system">模組系統</string>
<string name="home_magic_mount">Magic Mount</string> <string name="home_magic_mount">Magic Mount</string>
<string name="home_overlayfs_mount">OverlayFS</string> <string name="home_overlayfs_mount">OverlayFS</string>
<string name="unavailable">不可用</string> <string name="unavailable">不可用</string>

View File

@@ -74,7 +74,7 @@
<string name="safe_mode">Safe mode</string> <string name="safe_mode">Safe mode</string>
<string name="reboot_to_apply">Reboot to take effect</string> <string name="reboot_to_apply">Reboot to take effect</string>
<string name="module_magisk_conflict">Modules are unavailable due to a conflict with Magisk!</string> <string name="module_magisk_conflict">Modules are unavailable due to a conflict with Magisk!</string>
<string name="home_module_mount">Module system</string> <string name="home_mount_system">Mount system</string>
<string name="home_magic_mount">Magic Mount</string> <string name="home_magic_mount">Magic Mount</string>
<string name="home_overlayfs_mount">OverlayFS</string> <string name="home_overlayfs_mount">OverlayFS</string>
<string name="unavailable">Unavailable</string> <string name="unavailable">Unavailable</string>