feat(kakaotalk): Add patches for changing device model and disabling signature verification

This commit is contained in:
2025-05-03 19:25:46 +09:00
parent 5f6d03b705
commit 0693212ba5
4 changed files with 77 additions and 0 deletions

View File

@ -0,0 +1,29 @@
package app.revanced.patches.kakaotalk.changemodel
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.Package
import app.revanced.patcher.patch.bytecodePatch
import app.revanced.patcher.patch.stringOption
import app.revanced.patches.kakaotalk.changemodel.fingerprints.changeModelFingerprint
@Suppress("unused")
val changeModelPatch = bytecodePatch(
name = "Change model",
description = "Changes the device model to supporting subdevice features",
) {
val changeModelOption = stringOption(
"model", "SM-X926N"
)
compatibleWith(Package("com.kakao.talk", setOf("25.3.5")))
execute {
changeModelFingerprint.method.addInstructions(
0,
"""
const-string v0, "${changeModelOption.value}"
return-object v0
""".trimIndent()
)
}
}

View File

@ -0,0 +1,12 @@
package app.revanced.patches.kakaotalk.changemodel.fingerprints
import app.revanced.patcher.fingerprint
@Suppress("unused")
internal val changeModelFingerprint = fingerprint {
strings("MODEL", "\\s", "-", "US", "toUpperCase(...)")
custom {
_, classDef ->
classDef.methods.indexOf(classDef.methods.last()) > 2
}
}

View File

@ -0,0 +1,24 @@
package app.revanced.patches.kakaotalk.signature
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.Package
import app.revanced.patcher.patch.bytecodePatch
import app.revanced.patches.memegenerator.detection.signature.verifySignatureFingerprint
@Suppress("unused")
val verifyingSignaturePatch = bytecodePatch(
name = "Disable verifying signature",
description = "Disables the signature verification check that prevents the app from running.",
) {
compatibleWith(Package("com.kakao.talk", setOf("25.3.5")))
execute {
verifySignatureFingerprint.method.addInstructions(
0,
"""
const/4 v0, 0x1
return v0
""".trimIndent()
)
}
}

View File

@ -0,0 +1,12 @@
package app.revanced.patches.kakaotalk.signature.fingerprints
import app.revanced.patcher.fingerprint
import com.android.tools.smali.dexlib2.AccessFlags
@Suppress("unused")
internal val verifyingSignatureFingerprint = fingerprint {
accessFlags(AccessFlags.PUBLIC, AccessFlags.STATIC)
returns("Z")
parameters()
strings("getPackageName(...)")
}