This commit is contained in:
ShirkNeko
2025-04-01 15:56:40 +08:00
4 changed files with 22 additions and 5 deletions

View File

@@ -25,6 +25,14 @@ apksign {
}
android {
signingConfigs {
getByName("debug") {
storeFile = file("D:\\SukiSU\\release-key.keystore")
storePassword = "2832165"
keyAlias = "shirkneko"
keyPassword = "2832165"
}
}
namespace = "shirkneko.zako.sukisu"
buildTypes {

View File

@@ -507,11 +507,19 @@ fun getKpmModuleCount(): Int {
return result.trim().toIntOrNull() ?: 0
}
fun runCmd(shell : Shell, cmd : String) : String {
return shell.newJob()
.add(cmd)
.to(mutableListOf<String>(), null)
.exec().out
.joinToString("\n")
}
fun listKpmModules(): String {
val shell = getRootShell()
val cmd = "${getKpmmgrPath()} list"
return try {
ShellUtils.fastCmd(shell, cmd).trim()
runCmd(shell, cmd).trim()
} catch (e: Exception) {
Log.e(TAG, "Failed to list KPM modules", e)
""
@@ -522,7 +530,7 @@ fun getKpmModuleInfo(name: String): String {
val shell = getRootShell()
val cmd = "${getKpmmgrPath()} info $name"
return try {
ShellUtils.fastCmd(shell, cmd).trim()
runCmd(shell, cmd).trim()
} catch (e: Exception) {
Log.e(TAG, "Failed to get KPM module info: $name", e)
""
@@ -532,7 +540,7 @@ fun getKpmModuleInfo(name: String): String {
fun controlKpmModule(name: String, args: String? = null): Int {
val shell = getRootShell()
val cmd = "${getKpmmgrPath()} control $name ${args ?: ""}"
val result = ShellUtils.fastCmd(shell, cmd)
val result = runCmd(shell, cmd)
return result.trim().toIntOrNull() ?: -1
}

View File

@@ -47,7 +47,8 @@ class KpmViewModel : ViewModel() {
private fun getAllKpmModuleInfo(): List<ModuleInfo> {
val result = mutableListOf<ModuleInfo>()
try {
val moduleNames = listKpmModules()
val str = listKpmModules()
val moduleNames = str
.split("\n")
.filter { it.isNotBlank() }

View File

@@ -237,7 +237,7 @@
<string name="kpm_install_success">Load of kpm module successful</string>
<string name="kpm_install_failed">Load of kpm module failed</string>
<string name="kpm_args">kpm parameters</string>
<string name="kpm_control">kpm control</string>
<string name="kpm_control">执行</string>
<string name="home_kpm_version">KPM Version</string>
<string name="close_notice">close</string>
<string name="kernel_module_notice">The following kernel module functions were developed by KernelPatch and modified to include the kernel module functions of SukiSU Ultra</string>