fix(Reddit): Limit the available versions of the Hide navigation buttons patch to 2024.17.0

This commit is contained in:
inotia00
2024-12-21 11:37:41 +09:00
parent 7f72395c36
commit b2b64c1404
2 changed files with 5 additions and 5 deletions

View File

@ -7,7 +7,7 @@ import app.revanced.patcher.patch.bytecodePatch
import app.revanced.patches.reddit.utils.compatibility.Constants.COMPATIBLE_PACKAGE
import app.revanced.patches.reddit.utils.extension.Constants.PATCHES_PATH
import app.revanced.patches.reddit.utils.patch.PatchList.HIDE_NAVIGATION_BUTTONS
import app.revanced.patches.reddit.utils.settings.is_2024_26_or_greater
import app.revanced.patches.reddit.utils.settings.is_2024_18_or_greater
import app.revanced.patches.reddit.utils.settings.settingsPatch
import app.revanced.patches.reddit.utils.settings.updatePatchStatus
import app.revanced.util.fingerprint.methodOrThrow
@ -33,8 +33,8 @@ val navigationButtonsPatch = bytecodePatch(
execute {
if (is_2024_26_or_greater) {
println("WARNING: \"Hide navigation buttons\" patch is not supported in this version. Use Reddit 2024.25.3 or earlier.")
if (is_2024_18_or_greater) {
println("WARNING: \"Hide navigation buttons\" patch is not supported in this version. Use Reddit 2024.17.0 or earlier.")
return@execute
}

View File

@ -33,7 +33,7 @@ private const val EXTENSION_METHOD_DESCRIPTOR =
private lateinit var acknowledgementsLabelBuilderMethod: MutableMethod
private lateinit var settingsStatusLoadMethod: MutableMethod
var is_2024_26_or_greater = false
var is_2024_18_or_greater = false
private set
private val settingsBytecodePatch = bytecodePatch(
@ -53,7 +53,7 @@ private val settingsBytecodePatch = bytecodePatch(
val versionNumber = getInstruction<BuilderInstruction21c>(versionIndex).reference.toString().replace(".", "").toInt()
is_2024_26_or_greater = 2024260 <= versionNumber
is_2024_18_or_greater = 2024180 <= versionNumber
}
/**