fix(YouTube/Enable song search): indicates the supported version when a patch exception occurs

This commit is contained in:
inotia00 2024-01-19 11:39:55 +09:00
parent 22645ce855
commit 91b6d1fed6
2 changed files with 5 additions and 2 deletions

View File

@ -3,12 +3,12 @@ package app.revanced.patches.youtube.general.songsearch
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchException
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patches.youtube.general.songsearch.fingerprints.VoiceSearchConfigFingerprint
import app.revanced.patches.youtube.utils.integrations.Constants.GENERAL
import app.revanced.patches.youtube.utils.settings.SettingsPatch
import app.revanced.util.exception
@Patch(
name = "Enable song search",
@ -55,7 +55,7 @@ object SongSearchPatch : BytecodePatch(
"""
)
}
} ?: throw VoiceSearchConfigFingerprint.exception
} ?: throw PatchException("This version is not supported. Please use YouTube 18.30.37 or later.")
/**
* Add settings

View File

@ -2,6 +2,9 @@ package app.revanced.patches.youtube.general.songsearch.fingerprints
import app.revanced.util.fingerprint.LiteralValueFingerprint
/**
* This fingerprint is compatible with YouTube v18.30.37+
*/
object VoiceSearchConfigFingerprint : LiteralValueFingerprint(
returnType = "Z",
literalSupplier = { 45417109 }