manager: Add the ability to get the hook type

This commit is contained in:
ShirkNeko
2025-06-13 14:39:16 +08:00
parent 9f407a94e3
commit 2d9783e3d4
5 changed files with 22 additions and 2 deletions

View File

@@ -69,6 +69,7 @@ object Natives {
external fun isSuEnabled(): Boolean
external fun setSuEnabled(enabled: Boolean): Boolean
external fun isKPMEnabled(): Boolean
external fun getHookType(): Boolean
private const val NON_ROOT_DEFAULT_PROFILE_KEY = "$"
private const val NOBODY_UID = 9999

View File

@@ -731,7 +731,13 @@ private fun InfoCard(
val isSUS_SU = systemInfo.suSFSFeatures == "CONFIG_KSU_SUSFS_SUS_SU"
val infoText = buildString {
append(systemInfo.suSFSVersion)
append(if (isSUS_SU) " (${systemInfo.suSFSVariant})" else " (${stringResource(R.string.manual_hook)})")
append(if (isSUS_SU && !Natives.getHookType()) " (${systemInfo.suSFSVariant})" else {
if (Natives.getHookType()) {
" (${stringResource(R.string.manual_hook)})"
} else {
"Unknown"
}
})
if (isSUS_SU) {
if (systemInfo.susSUMode.isNotEmpty()) {
append(" ${stringResource(R.string.sus_su_mode)} ${systemInfo.susSUMode}")