diff --git a/patches/src/main/kotlin/app/revanced/patches/reddit/layout/subredditdialog/SubRedditDialogPatch.kt b/patches/src/main/kotlin/app/revanced/patches/reddit/layout/subredditdialog/SubRedditDialogPatch.kt index 1ebaef98f..7d51cb4a0 100644 --- a/patches/src/main/kotlin/app/revanced/patches/reddit/layout/subredditdialog/SubRedditDialogPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/reddit/layout/subredditdialog/SubRedditDialogPatch.kt @@ -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()?.name == "setTextAppearance" - } - val insertRegister = getInstruction(insertIndex).registerC + if (!is_2025_06_or_greater) { + redditAlertDialogsFingerprint.methodOrThrow().apply { + val backgroundTintIndex = indexOfSetBackgroundTintListInstruction(this) + val insertIndex = + indexOfFirstInstructionOrThrow(backgroundTintIndex) { + opcode == Opcode.INVOKE_VIRTUAL && + getReference()?.name == "setTextAppearance" + } + val insertRegister = getInstruction(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( diff --git a/patches/src/main/kotlin/app/revanced/patches/reddit/utils/compatibility/Constants.kt b/patches/src/main/kotlin/app/revanced/patches/reddit/utils/compatibility/Constants.kt index 7ef039926..9589f9dd7 100644 --- a/patches/src/main/kotlin/app/revanced/patches/reddit/utils/compatibility/Constants.kt +++ b/patches/src/main/kotlin/app/revanced/patches/reddit/utils/compatibility/Constants.kt @@ -8,6 +8,9 @@ internal object Constants { val COMPATIBLE_PACKAGE: Pair?> = 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. + ) ) } \ No newline at end of file diff --git a/patches/src/main/kotlin/app/revanced/patches/reddit/utils/settings/SettingsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/reddit/utils/settings/SettingsPatch.kt index d6f09660f..e126683fd 100644 --- a/patches/src/main/kotlin/app/revanced/patches/reddit/utils/settings/SettingsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/reddit/utils/settings/SettingsPatch.kt @@ -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 } /**