feat(kakaotalk): add patch and fingerprint to force enable debug mode

This commit is contained in:
2025-05-21 18:23:43 +09:00
parent d62649da49
commit 0fac05f134
3 changed files with 59 additions and 0 deletions

View File

@ -297,6 +297,10 @@ public final class app/revanced/patches/kakaotalk/integrity/VerifyingSignaturePa
public static final fun getVerifyingSignaturePatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
public final class app/revanced/patches/kakaotalk/misc/ForceEnableDebugModePatchKt {
public static final fun getForceEnableDebugModePatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
public final class app/revanced/patches/kakaotalk/misc/RemoveShopTabPatchKt {
public static final fun getRemoveShopTabPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}

View File

@ -0,0 +1,31 @@
package app.revanced.patches.kakaotalk.misc
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.instructions
import app.revanced.patcher.patch.bytecodePatch
import app.revanced.patches.kakaotalk.misc.fingerprints.configConstructorFingerprint
import com.android.tools.smali.dexlib2.Opcode
@Suppress("unused")
val forceEnableDebugModePatch = bytecodePatch(
name = "Force enable debug mode",
description = "Enables debug mode in the app.",
) {
compatibleWith("com.kakao.talk"("25.4.2"))
execute {
val method = configConstructorFingerprint.method
val insns = method.instructions
val idxReturn = insns.indexOfFirst { it.opcode == Opcode.RETURN_VOID } // RETURN_VOID
val clazz = method.definingClass
method.addInstructions(
idxReturn,
"""
const/4 v0, 0x1
sput-boolean v0, $clazz->a:Z
""".trimIndent()
)
}
}

View File

@ -0,0 +1,24 @@
package app.revanced.patches.kakaotalk.misc.fingerprints
import app.revanced.patcher.fingerprint
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode
internal val configConstructorFingerprint = fingerprint {
accessFlags(AccessFlags.STATIC, AccessFlags.CONSTRUCTOR)
returns("V")
parameters()
strings("google", "one", "getBytes(...)")
opcodes(
Opcode.SGET_OBJECT,
Opcode.INVOKE_VIRTUAL,
Opcode.INVOKE_STATIC,
Opcode.MOVE_RESULT_OBJECT,
Opcode.SGET_OBJECT,
Opcode.CONST_4,
Opcode.CONST_4,
Opcode.IF_EQ,
Opcode.MOVE,
Opcode.GOTO,
)
}