From b97ac26e021da3c7c48d5f89766f2779ff7baa58 Mon Sep 17 00:00:00 2001 From: BlackMesa123 Date: Wed, 1 Nov 2023 14:37:19 +0100 Subject: [PATCH] app: hooks: PropSpoofHooks: additional hooks for Samsung Cloud Assistant app Signed-off-by: BlackMesa123 --- .../knoxpatch/hooks/PropSpoofHooks.kt | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/mesalabs/knoxpatch/hooks/PropSpoofHooks.kt b/app/src/main/java/io/mesalabs/knoxpatch/hooks/PropSpoofHooks.kt index 19ff54e..ce7d00f 100644 --- a/app/src/main/java/io/mesalabs/knoxpatch/hooks/PropSpoofHooks.kt +++ b/app/src/main/java/io/mesalabs/knoxpatch/hooks/PropSpoofHooks.kt @@ -22,8 +22,6 @@ import com.highcapable.yukihookapi.hook.entity.YukiBaseHooker import com.highcapable.yukihookapi.hook.log.loggerD import com.highcapable.yukihookapi.hook.type.java.StringClass -import io.mesalabs.knoxpatch.utils.Constants - object PropSpoofHooks : YukiBaseHooker() { private const val TAG: String = "PropSpoofHooks" @@ -31,6 +29,27 @@ object PropSpoofHooks : YukiBaseHooker() { loggerD(msg = "$TAG: onHook: loaded.") /* Spoof critical system props */ + findClass("java.lang.ProcessBuilder").hook { + injectMember { + constructor { + param(Array::class.java) + } + beforeHook { + val cmdarray: Array = args(0).array() + + // Fix SPCMAgent (SAK) + if (cmdarray.size == 2 && cmdarray[0] == "/system/bin/getprop") { + when (cmdarray[1]) { + "ro.build.type" -> args(0).set( + arrayOf("/system/bin/echo", "eng")) + "ro.security.keystore.keytype" -> args(0).set( + arrayOf("/system/bin/echo", "")) + } + } + } + } + } + findClass("android.os.SystemProperties").hook { injectMember { method {