feat(kakaotalk): Add version info patch to include '(ReVanced)' in the version string
This commit is contained in:
@ -257,6 +257,10 @@ public final class app/revanced/patches/kakaotalk/signature/VerifyingSignaturePa
|
|||||||
public static final fun getVerifyingSignaturePatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
public static final fun getVerifyingSignaturePatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final class app/revanced/patches/kakaotalk/versioninfo/VersionInfoPatchKt {
|
||||||
|
public static final fun getVersionInfoPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||||
|
}
|
||||||
|
|
||||||
public final class app/revanced/patches/lightroom/misc/login/DisableMandatoryLoginPatchKt {
|
public final class app/revanced/patches/lightroom/misc/login/DisableMandatoryLoginPatchKt {
|
||||||
public static final fun getDisableMandatoryLoginPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
public static final fun getDisableMandatoryLoginPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,41 @@
|
|||||||
|
package app.revanced.patches.kakaotalk.versioninfo
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.instructions
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||||
|
import app.revanced.patcher.patch.Package
|
||||||
|
import app.revanced.patcher.patch.bytecodePatch
|
||||||
|
import app.revanced.patches.kakaotalk.versioninfo.fingerprints.versionInfoFingerprint
|
||||||
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
|
import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction21c
|
||||||
|
import com.android.tools.smali.dexlib2.iface.reference.StringReference
|
||||||
|
import com.android.tools.smali.dexlib2.immutable.reference.ImmutableStringReference
|
||||||
|
|
||||||
|
@Suppress("unused")
|
||||||
|
val versionInfoPatch = bytecodePatch(
|
||||||
|
name = "Version info patch",
|
||||||
|
description = "Patches the version info to include '(ReVanced)' in the version string.",
|
||||||
|
) {
|
||||||
|
compatibleWith(Package("com.kakao.talk", setOf("25.3.5")))
|
||||||
|
|
||||||
|
execute {
|
||||||
|
val inst = versionInfoFingerprint.method.instructions
|
||||||
|
.filterIsInstance<BuilderInstruction21c>()
|
||||||
|
.first {
|
||||||
|
it.opcode == Opcode.CONST_STRING
|
||||||
|
}
|
||||||
|
|
||||||
|
val versionString = (inst.reference as StringReference).string
|
||||||
|
|
||||||
|
versionInfoFingerprint.method
|
||||||
|
.replaceInstruction(
|
||||||
|
inst.location.index,
|
||||||
|
BuilderInstruction21c(
|
||||||
|
Opcode.CONST_STRING,
|
||||||
|
inst.registerA,
|
||||||
|
ImmutableStringReference(
|
||||||
|
"$versionString (ReVanced)"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package app.revanced.patches.kakaotalk.versioninfo.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint
|
||||||
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
|
|
||||||
|
internal val versionInfoFingerprint = fingerprint {
|
||||||
|
accessFlags(AccessFlags.PUBLIC, AccessFlags.CONSTRUCTOR)
|
||||||
|
returns("V")
|
||||||
|
opcodes(
|
||||||
|
Opcode.INVOKE_DIRECT,
|
||||||
|
Opcode.CONST_STRING,
|
||||||
|
Opcode.IPUT_OBJECT,
|
||||||
|
Opcode.IPUT_BOOLEAN,
|
||||||
|
Opcode.IPUT_OBJECT,
|
||||||
|
Opcode.RETURN_VOID,
|
||||||
|
)
|
||||||
|
}
|
Reference in New Issue
Block a user