diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/spoofappversion/SpoofAppVersionPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/spoofappversion/SpoofAppVersionPatch.kt index b2fdc0510..4537f4575 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/spoofappversion/SpoofAppVersionPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/spoofappversion/SpoofAppVersionPatch.kt @@ -50,7 +50,21 @@ object SpoofAppVersionPatch : AbstractVersionSpoofPatch( contexts.copyXmlNode("youtube/spoofappversion/host", "values/arrays.xml", "resources") if (SettingsPatch.upward1834) { - contexts.appendChild() + contexts.appendChild( + arrayOf( + "revanced_spoof_app_version_target_entry" to "@string/revanced_spoof_app_version_target_entry_18_33_40", + "revanced_spoof_app_version_target_entry_value" to "18.33.40", + ) + ) + + if (SettingsPatch.upward1841) { + contexts.appendChild( + arrayOf( + "revanced_spoof_app_version_target_entry" to "@string/revanced_spoof_app_version_target_entry_18_40_34", + "revanced_spoof_app_version_target_entry_value" to "18.40.34", + ) + ) + } } /** @@ -67,11 +81,8 @@ object SpoofAppVersionPatch : AbstractVersionSpoofPatch( } - private fun ResourceContext.appendChild() { - arrayOf( - "revanced_spoof_app_version_target_entry" to "@string/revanced_spoof_app_version_target_entry_18_33_40", - "revanced_spoof_app_version_target_entry_value" to "18.33.40", - ).map { (attributeName, attributeValue) -> + private fun ResourceContext.appendChild(entryArray: Array>) { + entryArray.map { (attributeName, attributeValue) -> this.xmlEditor["res/values/arrays.xml"].use { editor -> editor.file.apply { val resourcesNode = getElementsByTagName("resources").item(0) as Element diff --git a/src/main/resources/youtube/settings/host/values/strings.xml b/src/main/resources/youtube/settings/host/values/strings.xml index 082c35746..8e676e856 100644 --- a/src/main/resources/youtube/settings/host/values/strings.xml +++ b/src/main/resources/youtube/settings/host/values/strings.xml @@ -684,6 +684,7 @@ Tap and hold to set playback speed to 1.0x." 18.05.40 - Restore old comment input box 18.17.43 - Restore old player flyout panel 18.33.40 - Restore old shorts action bar + "18.40.34 - Disables 'views' and 'likes' from being updated in real time" Spoof app version target Type the spoof app version target. Edit spoof app version