mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-13 05:37:40 +02:00
fix(Reddit): Limit the available versions of the Hide navigation buttons
patch to 2024.17.0
This commit is contained in:
@ -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.compatibility.Constants.COMPATIBLE_PACKAGE
|
||||||
import app.revanced.patches.reddit.utils.extension.Constants.PATCHES_PATH
|
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.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.settingsPatch
|
||||||
import app.revanced.patches.reddit.utils.settings.updatePatchStatus
|
import app.revanced.patches.reddit.utils.settings.updatePatchStatus
|
||||||
import app.revanced.util.fingerprint.methodOrThrow
|
import app.revanced.util.fingerprint.methodOrThrow
|
||||||
@ -33,8 +33,8 @@ val navigationButtonsPatch = bytecodePatch(
|
|||||||
|
|
||||||
execute {
|
execute {
|
||||||
|
|
||||||
if (is_2024_26_or_greater) {
|
if (is_2024_18_or_greater) {
|
||||||
println("WARNING: \"Hide navigation buttons\" patch is not supported in this version. Use Reddit 2024.25.3 or earlier.")
|
println("WARNING: \"Hide navigation buttons\" patch is not supported in this version. Use Reddit 2024.17.0 or earlier.")
|
||||||
return@execute
|
return@execute
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ private const val EXTENSION_METHOD_DESCRIPTOR =
|
|||||||
private lateinit var acknowledgementsLabelBuilderMethod: MutableMethod
|
private lateinit var acknowledgementsLabelBuilderMethod: MutableMethod
|
||||||
private lateinit var settingsStatusLoadMethod: MutableMethod
|
private lateinit var settingsStatusLoadMethod: MutableMethod
|
||||||
|
|
||||||
var is_2024_26_or_greater = false
|
var is_2024_18_or_greater = false
|
||||||
private set
|
private set
|
||||||
|
|
||||||
private val settingsBytecodePatch = bytecodePatch(
|
private val settingsBytecodePatch = bytecodePatch(
|
||||||
@ -53,7 +53,7 @@ private val settingsBytecodePatch = bytecodePatch(
|
|||||||
|
|
||||||
val versionNumber = getInstruction<BuilderInstruction21c>(versionIndex).reference.toString().replace(".", "").toInt()
|
val versionNumber = getInstruction<BuilderInstruction21c>(versionIndex).reference.toString().replace(".", "").toInt()
|
||||||
|
|
||||||
is_2024_26_or_greater = 2024260 <= versionNumber
|
is_2024_18_or_greater = 2024180 <= versionNumber
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user