diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/spoofappversion/SpoofAppVersionPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/general/spoofappversion/SpoofAppVersionPatch.kt index 662a2f932..532671dc2 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/spoofappversion/SpoofAppVersionPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/spoofappversion/SpoofAppVersionPatch.kt @@ -1,9 +1,14 @@ package app.revanced.patches.youtube.general.spoofappversion import app.revanced.patcher.data.ResourceContext +import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction import app.revanced.patches.youtube.utils.compatibility.Constants.COMPATIBLE_PACKAGE +import app.revanced.patches.youtube.utils.integrations.Constants.GENERAL_CLASS_DESCRIPTOR +import app.revanced.patches.youtube.utils.integrations.Constants.PATCH_STATUS_CLASS_DESCRIPTOR +import app.revanced.patches.youtube.utils.settings.SettingsBytecodePatch import app.revanced.patches.youtube.utils.settings.SettingsPatch import app.revanced.util.appendAppVersion +import app.revanced.util.findMethodOrThrow import app.revanced.util.patch.BaseResourcePatch @Suppress("unused") @@ -13,6 +18,7 @@ object SpoofAppVersionPatch : BaseResourcePatch( "This can be used to restore old UI elements and features.", dependencies = setOf( SettingsPatch::class, + SettingsBytecodePatch::class, SpoofAppVersionBytecodePatch::class ), compatiblePackages = COMPATIBLE_PACKAGE @@ -27,6 +33,27 @@ object SpoofAppVersionPatch : BaseResourcePatch( context.appendAppVersion("18.48.39") if (SettingsPatch.upward1915) { context.appendAppVersion("19.13.37") + + SettingsBytecodePatch.contexts.findMethodOrThrow( + PATCH_STATUS_CLASS_DESCRIPTOR + ) { + name == "SpoofAppVersionDefaultString" + }.replaceInstruction( + 0, + "const-string v0, \"19.13.37\"" + ) + SettingsBytecodePatch.contexts.findMethodOrThrow(PATCH_STATUS_CLASS_DESCRIPTOR) { + name == "SpoofAppVersionDefaultBoolean" + }.replaceInstruction( + 0, + "const/4 v0, 0x1" + ) + SettingsBytecodePatch.contexts.findMethodOrThrow(PATCH_STATUS_CLASS_DESCRIPTOR) { + name == "SpoofAppVersionUserDialogMessage" + }.replaceInstruction( + 0, + "const-string v0, \"revanced_spoof_app_version_user_dialog_message_19_16\"" + ) } } } @@ -42,7 +69,6 @@ object SpoofAppVersionPatch : BaseResourcePatch( "SETTINGS: SPOOF_APP_VERSION" ) ) - SettingsPatch.updatePatchStatus(this) } } \ No newline at end of file diff --git a/src/main/resources/youtube/settings/host/values/strings.xml b/src/main/resources/youtube/settings/host/values/strings.xml index a556bccf4..19dacf00a 100644 --- a/src/main/resources/youtube/settings/host/values/strings.xml +++ b/src/main/resources/youtube/settings/host/values/strings.xml @@ -379,6 +379,7 @@ This does not bypass the age restriction. It just accepts it automatically." + Disabling this setting may result in a YouTube server-side bug that causes rolling number text such as likes, views, and upload dates to be hidden. Edit spoof app version Type the spoof app version target. Spoof app version target