manager: Redesign zygisk to ensure display accuracy

This commit is contained in:
ShirkNeko
2025-09-26 23:28:27 +08:00
parent b5d9607e8e
commit 8b74f7d466

View File

@@ -557,36 +557,28 @@ fun getKpmVersion(): String {
fun getZygiskImplement(): String { fun getZygiskImplement(): String {
val shell = getRootShell() val shell = getRootShell()
val modulesPath = "/data/adb/modules"
return try { val zygiskModuleIds = listOf(
val moduleDirs = shell.newJob() "zygisksu",
.add("ls $modulesPath") "rezygisk",
.to(ArrayList<String>(), null) "shirokozygisk"
.exec() )
.out
moduleDirs.firstNotNullOfOrNull { moduleName -> for (moduleId in zygiskModuleIds) {
if (!moduleName.matches(Regex(".*[a-zA-Z]*zygisk[a-zA-Z]*.*", RegexOption.IGNORE_CASE))) { val modulePath = "/data/adb/modules/$moduleId"
return@firstNotNullOfOrNull null when {
} ShellUtils.fastCmdResult(shell, "test -f $modulePath/module.prop && test ! -f $modulePath/disable") -> {
val result = ShellUtils.fastCmd(shell, "grep '^name=' $modulePath/module.prop | cut -d'=' -f2")
if (moduleName.contains("lsposed", ignoreCase = true)) {
return@firstNotNullOfOrNull null
}
val modulePath = "$modulesPath/$moduleName"
val isEnabled = ShellUtils.fastCmdResult(shell, "test -f $modulePath/module.prop && test ! -f $modulePath/disable")
if (!isEnabled) return@firstNotNullOfOrNull null
ShellUtils.fastCmd(shell, "grep '^name=' $modulePath/module.prop | cut -d'=' -f2")
.takeIf { it.isNotBlank() }
} ?: "None"
} catch (_: Exception) {
"None"
}.also { result ->
Log.i(TAG, "Zygisk implement: $result") Log.i(TAG, "Zygisk implement: $result")
return result
} }
}
}
Log.i(TAG, "Zygisk implement: None")
return "None"
} }
fun getUidScannerDaemonPath(): String { fun getUidScannerDaemonPath(): String {
return ksuApp.applicationInfo.nativeLibraryDir + File.separator + "libuid_scanner.so" return ksuApp.applicationInfo.nativeLibraryDir + File.separator + "libuid_scanner.so"
} }