feat(YouTube Music - Spoof app version): Remove the version that is no longer valid https://github.com/inotia00/ReVanced_Extended/issues/2743

This commit is contained in:
inotia00 2025-01-29 19:21:04 +09:00
parent 2a57ffe002
commit 21b8b48e47
5 changed files with 21 additions and 14 deletions

View File

@ -19,6 +19,7 @@ import app.revanced.extension.shared.settings.IntegerSetting;
import app.revanced.extension.shared.settings.LongSetting;
import app.revanced.extension.shared.settings.Setting;
import app.revanced.extension.shared.settings.StringSetting;
import app.revanced.extension.shared.utils.Logger;
import app.revanced.extension.shared.utils.Utils;
@ -230,6 +231,16 @@ public class Settings extends BaseSettings {
public static final LongSetting SB_LAST_VIP_CHECK = new LongSetting("sb_last_vip_check", 0L, false, false);
static {
// region Migration
// Old spoof versions that no longer work reliably.
if (SPOOF_APP_VERSION_TARGET.get().compareTo(SPOOF_APP_VERSION_TARGET.defaultValue) < 0) {
Logger.printInfo(() -> "Resetting spoof app version target");
SPOOF_APP_VERSION_TARGET.resetToDefault();
}
// endregion
// region SB import/export callbacks
Setting.addImportExportCallback(SponsorBlockSettings.SB_IMPORT_EXPORT_CALLBACK);

View File

@ -3,11 +3,11 @@ package app.revanced.patches.music.general.spoofappversion
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
import app.revanced.patcher.patch.bytecodePatch
import app.revanced.patcher.patch.resourcePatch
import app.revanced.patches.music.general.oldstylelibraryshelf.oldStyleLibraryShelfPatch
import app.revanced.patches.music.utils.compatibility.Constants.YOUTUBE_MUSIC_PACKAGE_NAME
import app.revanced.patches.music.utils.extension.Constants.GENERAL_CLASS_DESCRIPTOR
import app.revanced.patches.music.utils.extension.Constants.PATCH_STATUS_CLASS_DESCRIPTOR
import app.revanced.patches.music.utils.patch.PatchList.SPOOF_APP_VERSION
import app.revanced.patches.music.utils.playservice.is_6_43_or_greater
import app.revanced.patches.music.utils.playservice.is_7_17_or_greater
import app.revanced.patches.music.utils.playservice.is_7_25_or_greater
import app.revanced.patches.music.utils.playservice.versionCheckPatch
@ -32,7 +32,7 @@ private val spoofAppVersionBytecodePatch = bytecodePatch(
)
execute {
if (is_7_25_or_greater) {
if (!is_6_43_or_greater || is_7_25_or_greater) {
return@execute
}
if (is_7_17_or_greater) {
@ -61,9 +61,6 @@ val spoofAppVersionPatch = resourcePatch(
) {
compatibleWith(
YOUTUBE_MUSIC_PACKAGE_NAME(
"6.20.51",
"6.29.59",
"6.42.55",
"6.51.53",
"7.16.53",
),
@ -71,14 +68,13 @@ val spoofAppVersionPatch = resourcePatch(
dependsOn(
spoofAppVersionBytecodePatch,
oldStyleLibraryShelfPatch,
settingsPatch,
versionCheckPatch,
)
execute {
if (is_7_25_or_greater) {
printWarn("\"${SPOOF_APP_VERSION.title}\" is not supported in this version. Use YouTube Music 7.24.51 or earlier.")
if (!is_6_43_or_greater || is_7_25_or_greater) {
printWarn("\"${SPOOF_APP_VERSION.title}\" is not supported in this version. Use YouTube Music 6.43.53 ~ 7.24.51.")
return@execute
}
if (is_7_17_or_greater) {

View File

@ -11,6 +11,8 @@ var is_6_36_or_greater = false
private set
var is_6_42_or_greater = false
private set
var is_6_43_or_greater = false
private set
var is_7_03_or_greater = false
private set
var is_7_06_or_greater = false
@ -49,6 +51,7 @@ val versionCheckPatch = resourcePatch(
is_6_27_or_greater = 234412000 <= playStoreServicesVersion
is_6_36_or_greater = 240399000 <= playStoreServicesVersion
is_6_42_or_greater = 240999000 <= playStoreServicesVersion
is_6_43_or_greater = 241099000 <= playStoreServicesVersion
is_7_03_or_greater = 242199000 <= playStoreServicesVersion
is_7_06_or_greater = 242499000 <= playStoreServicesVersion
is_7_13_or_greater = 243199000 <= playStoreServicesVersion

View File

@ -70,12 +70,10 @@
<item>HANDLE_USERNAME</item>
</string-array>
<string-array name="revanced_spoof_app_version_target_entries">
<item>@string/revanced_spoof_app_version_target_entry_6_11_52</item>
<item>@string/revanced_spoof_app_version_target_entry_4_27_53</item>
<item>@string/revanced_spoof_app_version_target_entry_6_42_55</item>
</string-array>
<string-array name="revanced_spoof_app_version_target_entry_values">
<item>6.11.52</item>
<item>4.27.53</item>
<item>6.42.55</item>
</string-array>
<string-array name="revanced_spoof_client_type_entries">
<item>@string/revanced_spoof_client_type_entry_ios_music_6_21</item>

View File

@ -197,8 +197,7 @@ This does not bypass the age restriction. It just accepts it automatically."</st
• If later disabled, the old UI may remain until the app data is cleared."</string>
<string name="revanced_spoof_app_version_target_title">Spoof app version target</string>
<string name="revanced_spoof_app_version_target_summary">Select the spoof app version target.</string>
<string name="revanced_spoof_app_version_target_entry_4_27_53">4.27.53 - Disable Radio mode in Canadian regions</string>
<string name="revanced_spoof_app_version_target_entry_6_11_52">6.11.52 - Disable real-time lyrics</string>
<string name="revanced_spoof_app_version_target_entry_6_42_55">6.42.55 - Disable real-time lyrics</string>
<string name="revanced_spoof_app_version_target_entry_7_16_53">7.16.53 - Restore old action bar</string>