You've already forked KernelSU-Next
mirror of
https://github.com/KernelSU-Next/KernelSU-Next.git
synced 2025-08-27 23:46:34 +00:00
manager: add susfs status and sus_su toggle
userspace: add susfsd ci: build susfsd ksud_overlayfs: update aarch64 bin BusyBox v1.36.1.1 topjohnwu (2024-10-06 01:38:43 PDT)
This commit is contained in:
@@ -289,6 +289,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
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -446,6 +454,18 @@ private fun InfoCard() {
|
||||
},
|
||||
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),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,6 +172,32 @@ 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")
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
val hasShownWarning = rememberSaveable { mutableStateOf(prefs.getBoolean("has_shown_warning", false)) }
|
||||
|
||||
var useOverlayFs by rememberSaveable {
|
||||
|
||||
@@ -503,6 +503,51 @@ fun moduleRestore(): Boolean {
|
||||
return result.isEmpty()
|
||||
}
|
||||
|
||||
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 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 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_Mode(): String {
|
||||
val shell = getRootShell()
|
||||
val result = ShellUtils.fastCmd(shell, "${getSuSFSDaemonPath()} sus_su mode")
|
||||
return result
|
||||
}
|
||||
|
||||
fun setAppProfileTemplate(id: String, template: String): Boolean {
|
||||
val shell = getRootShell()
|
||||
val escapedTemplate = template.replace("\"", "\\\"")
|
||||
|
||||
1
manager/app/src/main/jniLibs/.gitignore
vendored
1
manager/app/src/main/jniLibs/.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
libksud_overlayfs.so
|
||||
libksud_magic.so
|
||||
libsusfsd.so
|
||||
9
manager/app/src/main/res/drawable/ic_sus.xml
Normal file
9
manager/app/src/main/res/drawable/ic_sus.xml
Normal file
File diff suppressed because one or more lines are too long
@@ -92,6 +92,8 @@
|
||||
<string name="require_kernel_version">Versi KernelSU-Next %d terlalu rendah agar manajer berfungsi normal. Harap membarui ke versi %d atau di atasnya!</string>
|
||||
<string name="settings_umount_modules_default">Melepas Modul secara bawaan</string>
|
||||
<string name="settings_umount_modules_default_summary">Menggunakan \"Umount Modul\" secara universal pada Profil Aplikasi. Jika diaktifkan, akan menghapus semua modifikasi sistem untuk aplikasi yang tidak memiliki set profil.</string>
|
||||
<string name="settings_susfs_toggle">Sembunyikan hook kprobe</string>
|
||||
<string name="settings_susfs_toggle_summary">Ini menonaktifkan hook kprobe yang dibuat oleh ksu, dan sebagai gantinya, hook inline non-kprobe akan diaktifkan, sama seperti implementasi untuk kernel non-gki yang tidak mendukung kprobe.</string>
|
||||
<string name="profile_umount_modules_summary">Aktifkan opsi ini agar KernelSU dapat memulihkan kembali berkas termodifikasi oleh modul pada aplikasi ini.</string>
|
||||
<string name="profile_selinux_domain">Domain</string>
|
||||
<string name="profile_selinux_rules">Aturan</string>
|
||||
|
||||
@@ -101,6 +101,8 @@
|
||||
<string name="require_kernel_version">현재 KernelSU Next 버전 %d이 너무 낮아 매니저가 올바르게 작동하기 어렵습니다. 버전 %d이상으로 업데이트해 주세요!</string>
|
||||
<string name="settings_umount_modules_default">기본적으로 모듈 마운트 해제</string>
|
||||
<string name="settings_umount_modules_default_summary">앱 프로파일의 \"모듈 마운트 해제\" 옵션에 대한 전역 기본값입니다. 이 옵션이 활성화되면, 프로파일이 설정되어 있지 않은 앱들에 대한 모듈의 모든 수정사항을 복구합니다.</string>
|
||||
<string name="settings_susfs_toggle">kprobe 훅 숨기기</string>
|
||||
<string name="settings_susfs_toggle_summary">이 설정은 ksu가 만든 kprobe 훅을 비활성화하고 대신 비-kprobe 인라인 훅을 활성화합니다. 이는 kprobe가 지원되지 않는 non-gki 커널과 동일한 구현입니다.</string>
|
||||
<string name="profile_umount_modules_summary">이 옵션이 활성화되면, 이 앱에 대한 모듈의 모든 수정사항을 복구합니다.</string>
|
||||
<string name="profile_selinux_domain">도메인</string>
|
||||
<string name="profile_selinux_rules">규칙</string>
|
||||
|
||||
@@ -106,6 +106,8 @@
|
||||
<string name="require_kernel_version">A versão atual do KernelSU Next %d é muito baixa para o gerenciador funcionar corretamente. Por favor, atualize para a versão %d ou superior!</string>
|
||||
<string name="settings_umount_modules_default">Desmontar módulos por padrão</string>
|
||||
<string name="settings_umount_modules_default_summary">O valor padrão global para \"Desmontar módulos\" em Perfil do Aplicativo. Se ativado, ele removerá todas as modificações do módulo no sistema para apps que não possuem um perfil definido.</string>
|
||||
<string name="settings_susfs_toggle">Ocultar ganchos kprobe</string>
|
||||
<string name="settings_susfs_toggle_summary">Desativa os ganchos kprobe feitos pelo ksu e, em vez disso, os ganchos inline não-kprobe serão ativados, da mesma forma que em um kernel não-gki sem suporte a kprobe.</string>
|
||||
<string name="profile_umount_modules_summary">Ativar esta opção permitirá que o KernelSU Next restaure quaisquer arquivos modificados pelos módulos para este app.</string>
|
||||
<string name="profile_selinux_domain">Domínio</string>
|
||||
<string name="profile_selinux_rules">Regras</string>
|
||||
|
||||
@@ -106,6 +106,8 @@
|
||||
<string name="require_kernel_version">当前 KernelSU Next 版本 %d 过低,管理器无法正常工作,请升级内核 KernelSU Next 版本至 %d 或以上!</string>
|
||||
<string name="settings_umount_modules_default">默认卸载模块</string>
|
||||
<string name="settings_umount_modules_default_summary">App Profile 中“卸载模块”的全局默认值,如果启用,将会为没有设置 Profile 的应用移除所有模块针对系统的修改。</string>
|
||||
<string name="settings_susfs_toggle">隐藏kprobe钩子</string>
|
||||
<string name="settings_susfs_toggle_summary">它禁用由ksu创建的kprobe钩子,取而代之的是启用非kprobe内联钩子,类似于不支持kprobe的non-gki内核的实现。</string>
|
||||
<string name="profile_umount_modules_summary">启用后将允许 KernelSU Next 为本应用还原被模块修改过的文件。</string>
|
||||
<string name="profile_selinux_domain">域</string>
|
||||
<string name="profile_selinux_rules">规则</string>
|
||||
|
||||
@@ -106,6 +106,8 @@
|
||||
<string name="require_kernel_version">當前 KernelSU-Next 版本 %d 過低,管理器無法正常工作,請升級內核 KernelSU-Next 版本至 %d 或以上!</string>
|
||||
<string name="settings_umount_modules_default">預設卸載模組</string>
|
||||
<string name="settings_umount_modules_default_summary">App Profile 中"卸載模組"的全域預設值,如果啟用,將會為沒有設定 Profile 的應用移除所有模組針對系統的修改。</string>
|
||||
<string name="settings_susfs_toggle">隱藏kprobe鉤子</string>
|
||||
<string name="settings_susfs_toggle_summary">它禁用由ksu所建立的kprobe鉤子,並啟用非kprobe內聯鉤子,就如同無法支援kprobe的non-gki核心的實現方式。</string>
|
||||
<string name="profile_umount_modules_summary">啟用後將允許 KernelSU-Next 為本應用還原被模組修改過的檔案。</string>
|
||||
<string name="profile_selinux_domain">域</string>
|
||||
<string name="profile_selinux_rules">規則</string>
|
||||
|
||||
@@ -19,6 +19,9 @@
|
||||
<string name="home_failure">KernelSU Next v2 signature not found in kernel! [ !KSU_NEXT || != size/hash ]</string>
|
||||
<string name="home_failure_tip">Ask your kernel developer to integrate KernelSU Next!</string>
|
||||
<string name="home_kernel">Kernel version</string>
|
||||
<string name="home_susfs">SuSFS: %s</string>
|
||||
<string name="home_susfs_version">SuSFS</string>
|
||||
<string name="home_susfs_sus_su">SuS SU</string>
|
||||
<string name="home_android">Android version</string>
|
||||
<string name="home_manager_version">Manager version</string>
|
||||
<string name="home_selinux_status">SELinux status</string>
|
||||
@@ -106,6 +109,8 @@
|
||||
<string name="require_kernel_version">The current KernelSU Next version %d is too low for the manager to work properly. Please upgrade to version %d or higher!</string>
|
||||
<string name="settings_umount_modules_default">Umount modules by default</string>
|
||||
<string name="settings_umount_modules_default_summary">The global default value for \"Umount modules\" in App Profile. If enabled, it will remove all module modifications to the system for apps that don\'t have a profile set.</string>
|
||||
<string name="settings_susfs_toggle">Hide kprobe hooks</string>
|
||||
<string name="settings_susfs_toggle_summary">It disables kprobe hooks made by ksu, and instead the non-kprobe inline hooks will be enabled, just the same implementation for non-gki kernel without kprobe supported.</string>
|
||||
<string name="profile_umount_modules_summary">Enabling this option will allow KernelSU Next to restore any modified files by the modules for this app.</string>
|
||||
<string name="profile_selinux_domain">Domain</string>
|
||||
<string name="profile_selinux_rules">Rules</string>
|
||||
|
||||
Reference in New Issue
Block a user