Don't turn off new Shorts player flag on newer targets since it can break the Shorts player overlay

This commit is contained in:
LisoUseInAIKyrios
2025-10-15 11:46:11 +04:00
parent ed87bc7b7a
commit c98c73b0bc
4 changed files with 30 additions and 16 deletions

View File

@@ -1635,6 +1635,7 @@ public final class app/revanced/patches/youtube/misc/playservice/VersionCheckPat
public static final fun is_20_34_or_greater ()Z
public static final fun is_20_37_or_greater ()Z
public static final fun is_20_39_or_greater ()Z
public static final fun is_20_41_or_greater ()Z
}
public final class app/revanced/patches/youtube/misc/privacy/SanitizeSharingLinksPatchKt {

View File

@@ -17,6 +17,7 @@ import app.revanced.patches.youtube.misc.playertype.playerTypeHookPatch
import app.revanced.patches.youtube.misc.playservice.is_19_33_or_greater
import app.revanced.patches.youtube.misc.playservice.is_20_07_or_greater
import app.revanced.patches.youtube.misc.playservice.is_20_10_or_greater
import app.revanced.patches.youtube.misc.playservice.is_20_41_or_greater
import app.revanced.patches.youtube.misc.playservice.versionCheckPatch
import app.revanced.patches.youtube.misc.settings.PreferenceScreen
import app.revanced.patches.youtube.misc.settings.settingsPatch
@@ -38,6 +39,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
import com.android.tools.smali.dexlib2.iface.reference.FieldReference
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
import com.android.tools.smali.dexlib2.iface.reference.TypeReference
import java.util.logging.Logger
private const val EXTENSION_CLASS_DESCRIPTOR =
"Lapp/revanced/extension/youtube/patches/ReturnYouTubeDislikePatch;"
@@ -169,7 +171,7 @@ val returnYouTubeDislikePatch = bytecodePatch(
addInstructionsAtControlFlowLabel(
insertIndex,
"""
# Copy conversion context
# Copy conversion context.
move-object/from16 v$free1, p0
# 20.41 field is the abstract superclass.
@@ -199,7 +201,15 @@ val returnYouTubeDislikePatch = bytecodePatch(
// If enabled then the litho text span hook is never called.
// Target code is very obfuscated and exactly what the code does is not clear.
// Return late so debug patch logs if the flag is enabled.
textComponentFeatureFlagFingerprint.method.returnLate(false)
if (is_20_41_or_greater) {
// TODO: Support the new non litho Shorts layout.
// Turning off this flag on later versions can break the Shorts overlay and nothing is shown.
Logger.getLogger(this::class.java.name).warning(
"20.40+ Shorts player is not fully supported yet. Shorts Dislikes may not show."
)
} else {
textComponentFeatureFlagFingerprint.method.returnLate(false)
}
}
// Player response video id is needed to search for the video ids in Shorts litho components.

View File

@@ -50,9 +50,9 @@ val wideSearchbarPatch = bytecodePatch(
// YT removed the legacy text search text field all code required to use it.
// This functionality could be restored by adding a search text field to the toolbar
// with a listener that artificially clicks the toolbar search button.
Logger.getLogger(this::class.java.name).severe(
"Wide searchbar is not compatible with 20.31+")
return@execute
return@execute Logger.getLogger(this::class.java.name).warning(
"Wide searchbar is not compatible with 20.31+"
)
}
addResources("youtube", "layout.searchbar.wideSearchbarPatch")

View File

@@ -65,27 +65,29 @@ var is_20_14_or_greater : Boolean by Delegates.notNull()
private set
var is_20_15_or_greater : Boolean by Delegates.notNull()
private set
var is_20_19_or_greater = false
var is_20_19_or_greater : Boolean by Delegates.notNull()
private set
var is_20_20_or_greater = false
var is_20_20_or_greater : Boolean by Delegates.notNull()
private set
var is_20_21_or_greater = false
var is_20_21_or_greater : Boolean by Delegates.notNull()
private set
var is_20_22_or_greater = false
var is_20_22_or_greater : Boolean by Delegates.notNull()
private set
var is_20_26_or_greater = false
var is_20_26_or_greater : Boolean by Delegates.notNull()
private set
var is_20_28_or_greater = false
var is_20_28_or_greater : Boolean by Delegates.notNull()
private set
var is_20_30_or_greater = false
var is_20_30_or_greater : Boolean by Delegates.notNull()
private set
var is_20_31_or_greater = false
var is_20_31_or_greater : Boolean by Delegates.notNull()
private set
var is_20_34_or_greater = false
var is_20_34_or_greater : Boolean by Delegates.notNull()
private set
var is_20_37_or_greater = false
var is_20_37_or_greater : Boolean by Delegates.notNull()
private set
var is_20_39_or_greater = false
var is_20_39_or_greater : Boolean by Delegates.notNull()
private set
var is_20_41_or_greater : Boolean by Delegates.notNull()
private set
val versionCheckPatch = resourcePatch(
@@ -132,5 +134,6 @@ val versionCheckPatch = resourcePatch(
is_20_34_or_greater = 253505000 <= playStoreServicesVersion
is_20_37_or_greater = 253805000 <= playStoreServicesVersion
is_20_39_or_greater = 253980000 <= playStoreServicesVersion
is_20_41_or_greater = 254205000 <= playStoreServicesVersion
}
}