Skip to content

Commit

Permalink
app: hooks: PropSpoofHooks: additional hooks for Samsung Cloud Assist…
Browse files Browse the repository at this point in the history
…ant app

Signed-off-by: BlackMesa123 <giangrecosalvo9@gmail.com>
  • Loading branch information
salvogiangri committed Nov 1, 2023
1 parent ecb4b84 commit b97ac26
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions app/src/main/java/io/mesalabs/knoxpatch/hooks/PropSpoofHooks.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,34 @@ 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"

override fun onHook() {
loggerD(msg = "$TAG: onHook: loaded.")

/* Spoof critical system props */
findClass("java.lang.ProcessBuilder").hook {
injectMember {
constructor {
param(Array<String>::class.java)
}
beforeHook {
val cmdarray: Array<String> = 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 {
Expand Down

0 comments on commit b97ac26

Please sign in to comment.