feat(Reddit): Restrict support version to 2025.05.1 (Close https://github.com/inotia00/ReVanced_Extended/issues/2772)

This commit is contained in:
inotia00 2025-02-10 16:13:16 +09:00
parent 60809b2636
commit 7667b70c67
3 changed files with 22 additions and 13 deletions

View File

@ -10,6 +10,7 @@ import app.revanced.patches.reddit.utils.patch.PatchList.REMOVE_SUBREDDIT_DIALOG
import app.revanced.patches.reddit.utils.settings.is_2024_41_or_greater
import app.revanced.patches.reddit.utils.settings.is_2025_01_or_greater
import app.revanced.patches.reddit.utils.settings.is_2025_05_or_greater
import app.revanced.patches.reddit.utils.settings.is_2025_06_or_greater
import app.revanced.patches.reddit.utils.settings.settingsPatch
import app.revanced.patches.reddit.utils.settings.updatePatchStatus
import app.revanced.util.fingerprint.methodOrThrow
@ -83,19 +84,21 @@ val subRedditDialogPatch = bytecodePatch(
}
// Not used in latest Reddit client.
redditAlertDialogsFingerprint.methodOrThrow().apply {
val backgroundTintIndex = indexOfSetBackgroundTintListInstruction(this)
val insertIndex =
indexOfFirstInstructionOrThrow(backgroundTintIndex) {
opcode == Opcode.INVOKE_VIRTUAL &&
getReference<MethodReference>()?.name == "setTextAppearance"
}
val insertRegister = getInstruction<FiveRegisterInstruction>(insertIndex).registerC
if (!is_2025_06_or_greater) {
redditAlertDialogsFingerprint.methodOrThrow().apply {
val backgroundTintIndex = indexOfSetBackgroundTintListInstruction(this)
val insertIndex =
indexOfFirstInstructionOrThrow(backgroundTintIndex) {
opcode == Opcode.INVOKE_VIRTUAL &&
getReference<MethodReference>()?.name == "setTextAppearance"
}
val insertRegister = getInstruction<FiveRegisterInstruction>(insertIndex).registerC
addInstruction(
insertIndex,
"invoke-static {v$insertRegister}, $EXTENSION_CLASS_DESCRIPTOR->confirmDialog(Landroid/widget/TextView;)V"
)
addInstruction(
insertIndex,
"invoke-static {v$insertRegister}, $EXTENSION_CLASS_DESCRIPTOR->confirmDialog(Landroid/widget/TextView;)V"
)
}
}
updatePatchStatus(

View File

@ -8,6 +8,9 @@ internal object Constants {
val COMPATIBLE_PACKAGE: Pair<PackageName, Set<VersionName>?> = Pair(
REDDIT_PACKAGE_NAME,
null
setOf(
"2024.17.0", // This is the last version that can be patched without anti-split.
"2025.05.1", // This is the latest version supported by the RVX patch.
)
)
}

View File

@ -41,6 +41,8 @@ var is_2025_01_or_greater = false
private set
var is_2025_05_or_greater = false
private set
var is_2025_06_or_greater = false
private set
private val settingsBytecodePatch = bytecodePatch(
description = "settingsBytecodePatch"
@ -65,6 +67,7 @@ private val settingsBytecodePatch = bytecodePatch(
is_2024_41_or_greater = 2024410 <= versionNumber
is_2025_01_or_greater = 2025010 <= versionNumber
is_2025_05_or_greater = 2025050 <= versionNumber
is_2025_06_or_greater = 2025060 <= versionNumber
}
/**