diff --git a/src/main/kotlin/app/revanced/patches/music/misc/versionspoof/patch/SpoofAppVersionPatch.kt b/src/main/kotlin/app/revanced/patches/music/misc/versionspoof/patch/SpoofAppVersionPatch.kt new file mode 100644 index 000000000..a6ac15436 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/music/misc/versionspoof/patch/SpoofAppVersionPatch.kt @@ -0,0 +1,37 @@ +package app.revanced.patches.music.misc.versionspoof.patch + +import app.revanced.patcher.annotation.Description +import app.revanced.patcher.annotation.Name +import app.revanced.patcher.annotation.Version +import app.revanced.patcher.data.BytecodeContext +import app.revanced.patcher.patch.BytecodePatch +import app.revanced.patcher.patch.PatchResult +import app.revanced.patcher.patch.PatchResultSuccess +import app.revanced.patcher.patch.annotations.DependsOn +import app.revanced.patcher.patch.annotations.Patch +import app.revanced.patches.music.misc.settings.patch.MusicSettingsPatch +import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility +import app.revanced.patches.shared.patch.versionspoof.GeneralVersionSpoofPatch +import app.revanced.util.integrations.Constants.MUSIC_SETTINGS_PATH + +@Patch +@Name("spoof-version") +@Description("Spoof the YouTube Music client version.") +@DependsOn( + [ + GeneralVersionSpoofPatch::class, + MusicSettingsPatch::class + ] +) +@YouTubeMusicCompatibility +@Version("0.0.1") +class SpoofAppVersionPatch : BytecodePatch() { + override fun execute(context: BytecodeContext): PatchResult { + + GeneralVersionSpoofPatch.injectSpoof("$MUSIC_SETTINGS_PATH->spoofVersion(Ljava/lang/String;)Ljava/lang/String;") + + MusicSettingsPatch.addMusicPreference("navigation", "revanced_enable_spoof_version", "false") + + return PatchResultSuccess() + } +} \ No newline at end of file diff --git a/src/main/resources/music/settings/host/values/strings.xml b/src/main/resources/music/settings/host/values/strings.xml index b767a3b3c..4f37ce54f 100644 --- a/src/main/resources/music/settings/host/values/strings.xml +++ b/src/main/resources/music/settings/host/values/strings.xml @@ -12,12 +12,14 @@ Enable color match Players Keep player permanently minimized even if another track is played. Enable force minimized player - "Enable force shuffle even if another track is played. -(Not available in Canada)" + Enable force shuffle even if another track is played. Enable force shuffle "Enable 250/251 opus codec when playing audio. (requires an app restart)" Enable opus codec + "Trick the YouTube Music version to v4.27.53 for Canadian users. +(requires an app restart)" + Enable version spoof "Enable landscape mode on phone. (requires an app restart)" Enable tablet mode