mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-21 00:37:18 +02:00
fix(YouTube - Spoof app version): Remove broken spoof targets that YouTube no longer supports (#145)
* Drop support for `v18.xx.xx` * fix: Apply code review suggestions * fix: Apply code review suggestions * fix: Apply code review suggestions --------- Co-authored-by: inotia00 <108592928+inotia00@users.noreply.github.com>
This commit is contained in:
parent
fd118211a5
commit
fec13ad15b
@ -28,6 +28,8 @@ 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.settings.preference.SharedPrefCategory;
|
||||
import app.revanced.extension.shared.utils.Logger;
|
||||
import app.revanced.extension.shared.utils.Utils;
|
||||
import app.revanced.extension.youtube.patches.alternativethumbnails.AlternativeThumbnailsPatch.DeArrowAvailability;
|
||||
import app.revanced.extension.youtube.patches.alternativethumbnails.AlternativeThumbnailsPatch.StillImagesAvailability;
|
||||
import app.revanced.extension.youtube.patches.alternativethumbnails.AlternativeThumbnailsPatch.ThumbnailOption;
|
||||
@ -637,6 +639,16 @@ public class Settings extends BaseSettings {
|
||||
|
||||
static {
|
||||
// region Migration initialized
|
||||
|
||||
// Old spoof versions that no longer work reliably.
|
||||
String spoofAppVersionTarget = SPOOF_APP_VERSION_TARGET.get();
|
||||
if (spoofAppVersionTarget.compareTo(SPOOF_APP_VERSION_TARGET.defaultValue) < 0) {
|
||||
Utils.showToastShort(str("revanced_spoof_app_version_target_invalid_toast", spoofAppVersionTarget));
|
||||
Utils.showToastShort(str("revanced_extended_reset_to_default_toast"));
|
||||
Logger.printInfo(() -> "Resetting spoof app version target");
|
||||
SPOOF_APP_VERSION_TARGET.resetToDefault();
|
||||
}
|
||||
|
||||
// Categories were previously saved without a 'sb_' key prefix, so they need an additional adjustment.
|
||||
Set<Setting<?>> sbCategories = new HashSet<>(Arrays.asList(
|
||||
SB_CATEGORY_SPONSOR,
|
||||
|
@ -16,7 +16,7 @@ import app.revanced.patches.youtube.utils.patch.PatchList.SPOOF_APP_VERSION
|
||||
import app.revanced.patches.youtube.utils.playservice.is_18_34_or_greater
|
||||
import app.revanced.patches.youtube.utils.playservice.is_18_39_or_greater
|
||||
import app.revanced.patches.youtube.utils.playservice.is_18_49_or_greater
|
||||
import app.revanced.patches.youtube.utils.playservice.is_19_17_or_greater
|
||||
import app.revanced.patches.youtube.utils.playservice.is_19_01_or_greater
|
||||
import app.revanced.patches.youtube.utils.playservice.is_19_23_or_greater
|
||||
import app.revanced.patches.youtube.utils.playservice.is_19_28_or_greater
|
||||
import app.revanced.patches.youtube.utils.playservice.is_19_34_or_greater
|
||||
@ -45,6 +45,15 @@ private val spoofAppVersionBytecodePatch = bytecodePatch(
|
||||
dependsOn(versionCheckPatch)
|
||||
|
||||
execute {
|
||||
if (is_19_01_or_greater) {
|
||||
findMethodOrThrow(PATCH_STATUS_CLASS_DESCRIPTOR) {
|
||||
name == "SpoofAppVersionDefaultString"
|
||||
}.replaceInstruction(
|
||||
0,
|
||||
"const-string v0, \"19.01.34\""
|
||||
)
|
||||
}
|
||||
|
||||
if (!is_19_23_or_greater) {
|
||||
return@execute
|
||||
}
|
||||
@ -72,13 +81,6 @@ private val spoofAppVersionBytecodePatch = bytecodePatch(
|
||||
""", ExternalLabel("ignore", getInstruction(jumpIndex))
|
||||
)
|
||||
}
|
||||
|
||||
findMethodOrThrow(PATCH_STATUS_CLASS_DESCRIPTOR) {
|
||||
name == "SpoofAppVersionDefaultString"
|
||||
}.replaceInstruction(
|
||||
0,
|
||||
"const-string v0, \"18.38.45\""
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
@ -108,35 +110,43 @@ val spoofAppVersionPatch = resourcePatch(
|
||||
SPOOF_APP_VERSION
|
||||
)
|
||||
|
||||
if (!is_19_17_or_greater) {
|
||||
// TODO: Remove this when the legacy code for YouTube 18.xx is cleaned up.
|
||||
if (!is_19_01_or_greater) {
|
||||
appendAppVersion("17.41.37")
|
||||
appendAppVersion("18.05.40")
|
||||
appendAppVersion("18.17.43")
|
||||
if (!is_18_34_or_greater) {
|
||||
|
||||
if (is_18_34_or_greater) {
|
||||
appendAppVersion("18.33.40")
|
||||
} else {
|
||||
return@execute
|
||||
}
|
||||
appendAppVersion("18.33.40")
|
||||
}
|
||||
|
||||
if (!is_18_39_or_greater) {
|
||||
if (is_18_39_or_greater) {
|
||||
appendAppVersion("18.38.45")
|
||||
} else {
|
||||
return@execute
|
||||
}
|
||||
|
||||
if (is_18_49_or_greater) {
|
||||
appendAppVersion("18.48.39")
|
||||
}
|
||||
|
||||
return@execute
|
||||
}
|
||||
appendAppVersion("18.38.45")
|
||||
|
||||
if (!is_18_49_or_greater) {
|
||||
appendAppVersion("19.01.34")
|
||||
|
||||
if (is_19_28_or_greater) {
|
||||
appendAppVersion("19.26.42")
|
||||
} else {
|
||||
return@execute
|
||||
}
|
||||
appendAppVersion("18.48.39")
|
||||
|
||||
if (!is_19_28_or_greater) {
|
||||
if (is_19_34_or_greater) {
|
||||
appendAppVersion("19.33.37")
|
||||
} else {
|
||||
return@execute
|
||||
}
|
||||
appendAppVersion("19.26.42")
|
||||
|
||||
if (!is_19_34_or_greater) {
|
||||
return@execute
|
||||
}
|
||||
appendAppVersion("19.33.37")
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ import app.revanced.patches.youtube.utils.extension.Constants.PLAYER_CLASS_DESCR
|
||||
import app.revanced.patches.youtube.utils.patch.PatchList.DESCRIPTION_COMPONENTS
|
||||
import app.revanced.patches.youtube.utils.playertype.playerTypeHookPatch
|
||||
import app.revanced.patches.youtube.utils.playservice.is_18_49_or_greater
|
||||
import app.revanced.patches.youtube.utils.playservice.is_19_02_or_greater
|
||||
import app.revanced.patches.youtube.utils.playservice.is_19_05_or_greater
|
||||
import app.revanced.patches.youtube.utils.playservice.versionCheckPatch
|
||||
import app.revanced.patches.youtube.utils.recyclerview.recyclerViewTreeObserverHook
|
||||
import app.revanced.patches.youtube.utils.recyclerview.recyclerViewTreeObserverPatch
|
||||
@ -93,8 +93,7 @@ val descriptionComponentsPatch = bytecodePatch(
|
||||
|
||||
// region patch for disable video description interaction and expand video description
|
||||
|
||||
// since these patches are still A/B tested, they are classified as 'Experimental flags'.
|
||||
if (is_19_02_or_greater) {
|
||||
if (is_19_05_or_greater) {
|
||||
textViewComponentFingerprint.methodOrThrow().apply {
|
||||
val insertIndex = indexOfTextIsSelectableInstruction(this)
|
||||
val insertInstruction = getInstruction<FiveRegisterInstruction>(insertIndex)
|
||||
|
@ -9,7 +9,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
||||
|
||||
/**
|
||||
* This fingerprint is compatible with YouTube v18.35.xx~
|
||||
* Nonetheless, the patch works in YouTube v19.02.xx~
|
||||
* Nonetheless, the patch works in YouTube v19.05.xx~
|
||||
*/
|
||||
internal val textViewComponentFingerprint = legacyFingerprint(
|
||||
name = "textViewComponentFingerprint",
|
||||
|
@ -9,10 +9,6 @@ internal object Constants {
|
||||
val COMPATIBLE_PACKAGE: Pair<PackageName, Set<VersionName>?> = Pair(
|
||||
YOUTUBE_PACKAGE_NAME,
|
||||
setOf(
|
||||
"18.29.38", // This is the last version where the 'Zoomed to fill' setting works.
|
||||
"18.33.40", // This is the last version that do not use litho components in Shorts.
|
||||
"18.38.44", // This is the last version with no delay in applying video quality on the server side.
|
||||
"18.48.39", // This is the last version that do not use Rolling Number.
|
||||
"19.05.36", // This is the last version with the least YouTube experimental flag.
|
||||
"19.16.39", // This is the last version where the 'Restore old seekbar thumbnails' setting works.
|
||||
"19.44.39", // This is the latest version supported by the RVX patch.
|
||||
|
@ -15,10 +15,14 @@ var is_18_42_or_greater = false
|
||||
private set
|
||||
var is_18_49_or_greater = false
|
||||
private set
|
||||
var is_19_01_or_greater = false
|
||||
private set
|
||||
var is_19_02_or_greater = false
|
||||
private set
|
||||
var is_19_04_or_greater = false
|
||||
private set
|
||||
var is_19_05_or_greater = false
|
||||
private set
|
||||
var is_19_09_or_greater = false
|
||||
private set
|
||||
var is_19_15_or_greater = false
|
||||
@ -83,8 +87,10 @@ val versionCheckPatch = resourcePatch(
|
||||
is_18_39_or_greater = 234000000 <= playStoreServicesVersion
|
||||
is_18_42_or_greater = 234302000 <= playStoreServicesVersion
|
||||
is_18_49_or_greater = 235000000 <= playStoreServicesVersion
|
||||
is_19_02_or_greater = 240204000 < playStoreServicesVersion
|
||||
is_19_01_or_greater = 240204000 < playStoreServicesVersion
|
||||
is_19_02_or_greater = 240299000 < playStoreServicesVersion
|
||||
is_19_04_or_greater = 240502000 <= playStoreServicesVersion
|
||||
is_19_05_or_greater = 240602000 <= playStoreServicesVersion
|
||||
is_19_09_or_greater = 241002000 <= playStoreServicesVersion
|
||||
is_19_15_or_greater = 241602000 <= playStoreServicesVersion
|
||||
is_19_16_or_greater = 241702000 <= playStoreServicesVersion
|
||||
|
@ -477,8 +477,10 @@ If later turned off, it is recommended to clear the app data to prevent UI bugs.
|
||||
<string name="revanced_spoof_app_version_target_entry_18_33_40">18.33.40 - Restore old Shorts action bar</string>
|
||||
<string name="revanced_spoof_app_version_target_entry_18_38_45">18.38.45 - Restore old default video quality behavior</string>
|
||||
<string name="revanced_spoof_app_version_target_entry_18_48_39">18.48.39 - Disable views and likes from being updated in real time</string>
|
||||
<string name="revanced_spoof_app_version_target_entry_19_01_34">19.01.34 - Disable video description interaction</string>
|
||||
<string name="revanced_spoof_app_version_target_entry_19_26_42">19.26.42 - Disable Cairo icon in navigation and toolbar</string>
|
||||
<string name="revanced_spoof_app_version_target_entry_19_33_37">19.33.37 - Restore old playback speed flyout panel</string>
|
||||
<string name="revanced_spoof_app_version_target_invalid_toast">Invalid spoof app version: %s.</string>
|
||||
|
||||
<!-- PreferenceScreen: General, PreferenceCategory: General, PreferenceScreen: Account menu -->
|
||||
<string name="revanced_preference_screen_account_menu_title">Account menu</string>
|
||||
@ -1510,7 +1512,6 @@ Info:
|
||||
<string name="revanced_enable_shorts_custom_actions_flyout_menu_summary_on">"Custom actions are enabled in flyout menu.
|
||||
|
||||
Limitations:
|
||||
• Does not work if app version is spoofed to 18.49.37 or earlier.
|
||||
• Does not work with live stream."</string>
|
||||
<string name="revanced_enable_shorts_custom_actions_flyout_menu_summary_off">Custom actions are disabled in flyout menu.</string>
|
||||
<string name="revanced_enable_shorts_custom_actions_toolbar_title">Enable custom actions in toolbar</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user