feat(kakaotalk): add patches to handle deleted and hidden messages in chat logs
This is the second commit to make deleted, hidden messages visible.
This commit is contained in:
@ -272,6 +272,10 @@ public final class app/revanced/patches/kakaotalk/changemodel/ChangeModelPatchKt
|
|||||||
public static final fun getChangeModelPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
public static final fun getChangeModelPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final class app/revanced/patches/kakaotalk/chatlog/AddDeletedOrHiddenLayoutPatchKt {
|
||||||
|
public static final fun getAddDeletedOrHiddenLayoutPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||||
|
}
|
||||||
|
|
||||||
public final class app/revanced/patches/kakaotalk/chatlog/AddRealDeletedOrHiddenFlagPatchKt {
|
public final class app/revanced/patches/kakaotalk/chatlog/AddRealDeletedOrHiddenFlagPatchKt {
|
||||||
public static final fun getAddRealDeletedOrHiddenFlagPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
public static final fun getAddRealDeletedOrHiddenFlagPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||||
}
|
}
|
||||||
@ -280,6 +284,10 @@ public final class app/revanced/patches/kakaotalk/chatlog/Remove99ClampPatchKt {
|
|||||||
public static final fun getRemove99ClampPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
public static final fun getRemove99ClampPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final class app/revanced/patches/kakaotalk/chatlog/ShowDeletedMessagePatchKt {
|
||||||
|
public static final fun getShowDeletedMessagePatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||||
|
}
|
||||||
|
|
||||||
public final class app/revanced/patches/kakaotalk/chatroom/Remove300PlusLimitPatchKt {
|
public final class app/revanced/patches/kakaotalk/chatroom/Remove300PlusLimitPatchKt {
|
||||||
public static final fun getRemove300PlusLimitBaseChatRoomPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
public static final fun getRemove300PlusLimitBaseChatRoomPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||||
public static final fun getRemove300PlusLimitOpenChatRoomPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
public static final fun getRemove300PlusLimitOpenChatRoomPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||||
|
@ -0,0 +1,174 @@
|
|||||||
|
package app.revanced.patches.kakaotalk.chatlog
|
||||||
|
|
||||||
|
import app.revanced.patcher.patch.bytecodePatch
|
||||||
|
import app.revanced.patcher.util.proxy.mutableTypes.MutableField.Companion.toMutable
|
||||||
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
|
import com.android.tools.smali.dexlib2.immutable.ImmutableField
|
||||||
|
import com.android.tools.smali.dexlib2.immutable.value.ImmutableBooleanEncodedValue
|
||||||
|
|
||||||
|
val addDeletedOrHiddenLayoutPatch = bytecodePatch(
|
||||||
|
name = "Add deleted or hidden layout",
|
||||||
|
description = "Adds a layout for deleted or hidden messages in chat logs",
|
||||||
|
) {
|
||||||
|
compatibleWith("com.kakao.talk"("25.4.2"))
|
||||||
|
|
||||||
|
execute {
|
||||||
|
val chatInfoViewClass = proxy(classes.first {
|
||||||
|
it.type == "Lcom/kakao/talk/widget/chatlog/ChatInfoView;"
|
||||||
|
}).mutableClass
|
||||||
|
val makeLayoutMethod = chatInfoViewClass.methods.firstOrNull {
|
||||||
|
it.name == "makeLayout"
|
||||||
|
} ?: error("makeLayout method not found in ChatInfoView class")
|
||||||
|
|
||||||
|
println("ChatInfoView class: $chatInfoViewClass")
|
||||||
|
println("makeLayout method: $makeLayoutMethod")
|
||||||
|
|
||||||
|
chatInfoViewClass.apply {
|
||||||
|
fields.add(
|
||||||
|
ImmutableField(
|
||||||
|
type,
|
||||||
|
"isDeleted",
|
||||||
|
"Z",
|
||||||
|
AccessFlags.PUBLIC.value,
|
||||||
|
ImmutableBooleanEncodedValue.FALSE_VALUE,
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
).toMutable(),
|
||||||
|
)
|
||||||
|
|
||||||
|
fields.add(
|
||||||
|
ImmutableField(
|
||||||
|
type,
|
||||||
|
"deletedLayout",
|
||||||
|
"Landroid/text/Layout;",
|
||||||
|
AccessFlags.PUBLIC.value,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
).toMutable()
|
||||||
|
)
|
||||||
|
|
||||||
|
fields.add(
|
||||||
|
ImmutableField(
|
||||||
|
type,
|
||||||
|
"deletedPaint",
|
||||||
|
"Landroid/text/TextPaint;",
|
||||||
|
AccessFlags.PUBLIC.value,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
).toMutable()
|
||||||
|
)
|
||||||
|
|
||||||
|
fields.add(
|
||||||
|
ImmutableField(
|
||||||
|
type,
|
||||||
|
"deletedRect",
|
||||||
|
"Landroid/graphics/Rect;",
|
||||||
|
AccessFlags.PUBLIC.value,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
).toMutable()
|
||||||
|
)
|
||||||
|
|
||||||
|
fields.add(
|
||||||
|
ImmutableField(
|
||||||
|
type,
|
||||||
|
"deletedTextColor",
|
||||||
|
"I",
|
||||||
|
AccessFlags.PUBLIC.value,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
).toMutable()
|
||||||
|
)
|
||||||
|
|
||||||
|
fields.add(
|
||||||
|
ImmutableField(
|
||||||
|
type,
|
||||||
|
"deletedTextSize",
|
||||||
|
"I",
|
||||||
|
AccessFlags.PUBLIC.value,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
).toMutable()
|
||||||
|
)
|
||||||
|
|
||||||
|
fields.add(
|
||||||
|
ImmutableField(
|
||||||
|
type,
|
||||||
|
"isHidden",
|
||||||
|
"Z",
|
||||||
|
AccessFlags.PUBLIC.value,
|
||||||
|
ImmutableBooleanEncodedValue.FALSE_VALUE,
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
).toMutable(),
|
||||||
|
)
|
||||||
|
|
||||||
|
fields.add(
|
||||||
|
ImmutableField(
|
||||||
|
type,
|
||||||
|
"hiddenLayout",
|
||||||
|
"Landroid/text/Layout;",
|
||||||
|
AccessFlags.PUBLIC.value,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
).toMutable()
|
||||||
|
)
|
||||||
|
|
||||||
|
fields.add(
|
||||||
|
ImmutableField(
|
||||||
|
type,
|
||||||
|
"hiddenPaint",
|
||||||
|
"Landroid/text/TextPaint;",
|
||||||
|
AccessFlags.PUBLIC.value,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
).toMutable()
|
||||||
|
)
|
||||||
|
|
||||||
|
fields.add(
|
||||||
|
ImmutableField(
|
||||||
|
type,
|
||||||
|
"hiddenRect",
|
||||||
|
"Landroid/graphics/Rect;",
|
||||||
|
AccessFlags.PUBLIC.value,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
).toMutable()
|
||||||
|
)
|
||||||
|
|
||||||
|
fields.add(
|
||||||
|
ImmutableField(
|
||||||
|
type,
|
||||||
|
"hiddenTextColor",
|
||||||
|
"I",
|
||||||
|
AccessFlags.PUBLIC.value,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
).toMutable()
|
||||||
|
)
|
||||||
|
|
||||||
|
fields.add(
|
||||||
|
ImmutableField(
|
||||||
|
type,
|
||||||
|
"hiddenTextSize",
|
||||||
|
"I",
|
||||||
|
AccessFlags.PUBLIC.value,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
).toMutable()
|
||||||
|
)
|
||||||
|
|
||||||
|
// TODO: Add logic to initialize these fields in the makeLayout method
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package app.revanced.patches.kakaotalk.chatlog
|
||||||
|
|
||||||
|
import app.revanced.patcher.patch.bytecodePatch
|
||||||
|
|
||||||
|
val showDeletedMessagePatch = bytecodePatch(
|
||||||
|
name = "Show deleted message",
|
||||||
|
description = "Shows deleted messages in chat logs",
|
||||||
|
) {
|
||||||
|
compatibleWith("com.kakao.talk"("25.4.2"))
|
||||||
|
|
||||||
|
dependsOn(addRealDeletedOrHiddenFlagPatch)
|
||||||
|
|
||||||
|
execute {
|
||||||
|
// TODO: Implement the patch to show deleted messages
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,2 @@
|
|||||||
|
package app.revanced.patches.kakaotalk.chatlog.fingerprints
|
||||||
|
|
@ -0,0 +1,20 @@
|
|||||||
|
package app.revanced.patches.kakaotalk.chatlog.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint
|
||||||
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
|
|
||||||
|
internal val replaceToFeedFingerprint = fingerprint {
|
||||||
|
accessFlags(AccessFlags.PUBLIC, AccessFlags.STATIC)
|
||||||
|
returns("V")
|
||||||
|
strings(
|
||||||
|
"feedType",
|
||||||
|
"{}",
|
||||||
|
"safeBot",
|
||||||
|
"getString(...)",
|
||||||
|
"hidden",
|
||||||
|
"byHost",
|
||||||
|
"previous_message",
|
||||||
|
"previous_enc",
|
||||||
|
"enc : %s, %s",
|
||||||
|
)
|
||||||
|
}
|
Reference in New Issue
Block a user