diff --git a/patches/api/patches.api b/patches/api/patches.api index c22dfd05d..1c967bb33 100644 --- a/patches/api/patches.api +++ b/patches/api/patches.api @@ -257,6 +257,10 @@ public final class app/revanced/patches/kakaotalk/chatroom/Remove300PlusLimitPat public static final fun getRemove300PlusLimitOpenChatRoomPatch ()Lapp/revanced/patcher/patch/BytecodePatch; } +public final class app/revanced/patches/kakaotalk/emoticon/ForceEnableEmoticonPlusPatchKt { + public static final fun getForceEnableEmoticonPlusPatch ()Lapp/revanced/patcher/patch/BytecodePatch; +} + public final class app/revanced/patches/kakaotalk/misc/RemoveShopTabPatchKt { public static final fun getRemoveShopTabPatch ()Lapp/revanced/patcher/patch/BytecodePatch; } diff --git a/patches/src/main/kotlin/app/revanced/patches/kakaotalk/emoticon/ForceEnableEmoticonPlusPatch.kt b/patches/src/main/kotlin/app/revanced/patches/kakaotalk/emoticon/ForceEnableEmoticonPlusPatch.kt new file mode 100644 index 000000000..29268a064 --- /dev/null +++ b/patches/src/main/kotlin/app/revanced/patches/kakaotalk/emoticon/ForceEnableEmoticonPlusPatch.kt @@ -0,0 +1,24 @@ +package app.revanced.patches.kakaotalk.emoticon + +import app.revanced.patcher.extensions.InstructionExtensions.addInstructions +import app.revanced.patcher.patch.Package +import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patches.kakaotalk.emoticon.fingerprints.forceEnableEmoticonPlusFingerprint + +@Suppress("unused") +val forceEnableEmoticonPlusPatch = bytecodePatch( + name = "Force enable emoticon plus feature", + description = "Force enable emoticon plus feature (Unpurchased emoticon can be sent once per day)", +) { + compatibleWith(Package("com.kakao.talk", setOf("25.3.5"))) + + execute { + forceEnableEmoticonPlusFingerprint.method.addInstructions( + 0, + """ + const/4 v0, 0x1 + return v0 + """.trimIndent() + ) + } +} \ No newline at end of file diff --git a/patches/src/main/kotlin/app/revanced/patches/kakaotalk/emoticon/fingerprints/ForceEnableEmoticonPlusFingerprint.kt b/patches/src/main/kotlin/app/revanced/patches/kakaotalk/emoticon/fingerprints/ForceEnableEmoticonPlusFingerprint.kt new file mode 100644 index 000000000..ab6fc8365 --- /dev/null +++ b/patches/src/main/kotlin/app/revanced/patches/kakaotalk/emoticon/fingerprints/ForceEnableEmoticonPlusFingerprint.kt @@ -0,0 +1,22 @@ +package app.revanced.patches.kakaotalk.emoticon.fingerprints + +import app.revanced.patcher.fingerprint +import com.android.tools.smali.dexlib2.AccessFlags +import com.android.tools.smali.dexlib2.Opcode + +internal val forceEnableEmoticonPlusFingerprint = fingerprint { + accessFlags(AccessFlags.PUBLIC, AccessFlags.STATIC) + returns("Z") + parameters() + strings("emoticonPlusMe") + opcodes( + Opcode.SGET_OBJECT, + Opcode.IF_EQZ, + Opcode.IGET_BOOLEAN, + Opcode.RETURN, + Opcode.CONST_STRING, + Opcode.INVOKE_STATIC, + Opcode.CONST_4, + Opcode.THROW, + ) +} \ No newline at end of file