Don't turn off new Shorts player flag on newer targets since it can break the Shorts player overlay
This commit is contained in:
parent
ed87bc7b7a
commit
c98c73b0bc
4 changed files with 30 additions and 16 deletions
|
|
@ -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_34_or_greater ()Z
|
||||||
public static final fun is_20_37_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_39_or_greater ()Z
|
||||||
|
public static final fun is_20_41_or_greater ()Z
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class app/revanced/patches/youtube/misc/privacy/SanitizeSharingLinksPatchKt {
|
public final class app/revanced/patches/youtube/misc/privacy/SanitizeSharingLinksPatchKt {
|
||||||
|
|
|
||||||
|
|
@ -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_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_07_or_greater
|
||||||
import app.revanced.patches.youtube.misc.playservice.is_20_10_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.playservice.versionCheckPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.PreferenceScreen
|
import app.revanced.patches.youtube.misc.settings.PreferenceScreen
|
||||||
import app.revanced.patches.youtube.misc.settings.settingsPatch
|
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.FieldReference
|
||||||
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
||||||
import com.android.tools.smali.dexlib2.iface.reference.TypeReference
|
import com.android.tools.smali.dexlib2.iface.reference.TypeReference
|
||||||
|
import java.util.logging.Logger
|
||||||
|
|
||||||
private const val EXTENSION_CLASS_DESCRIPTOR =
|
private const val EXTENSION_CLASS_DESCRIPTOR =
|
||||||
"Lapp/revanced/extension/youtube/patches/ReturnYouTubeDislikePatch;"
|
"Lapp/revanced/extension/youtube/patches/ReturnYouTubeDislikePatch;"
|
||||||
|
|
@ -169,7 +171,7 @@ val returnYouTubeDislikePatch = bytecodePatch(
|
||||||
addInstructionsAtControlFlowLabel(
|
addInstructionsAtControlFlowLabel(
|
||||||
insertIndex,
|
insertIndex,
|
||||||
"""
|
"""
|
||||||
# Copy conversion context
|
# Copy conversion context.
|
||||||
move-object/from16 v$free1, p0
|
move-object/from16 v$free1, p0
|
||||||
|
|
||||||
# 20.41 field is the abstract superclass.
|
# 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.
|
// 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.
|
// 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.
|
// 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.
|
// Player response video id is needed to search for the video ids in Shorts litho components.
|
||||||
|
|
|
||||||
|
|
@ -50,9 +50,9 @@ val wideSearchbarPatch = bytecodePatch(
|
||||||
// YT removed the legacy text search text field all code required to use it.
|
// 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
|
// This functionality could be restored by adding a search text field to the toolbar
|
||||||
// with a listener that artificially clicks the toolbar search button.
|
// with a listener that artificially clicks the toolbar search button.
|
||||||
Logger.getLogger(this::class.java.name).severe(
|
return@execute Logger.getLogger(this::class.java.name).warning(
|
||||||
"Wide searchbar is not compatible with 20.31+")
|
"Wide searchbar is not compatible with 20.31+"
|
||||||
return@execute
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
addResources("youtube", "layout.searchbar.wideSearchbarPatch")
|
addResources("youtube", "layout.searchbar.wideSearchbarPatch")
|
||||||
|
|
|
||||||
|
|
@ -65,27 +65,29 @@ var is_20_14_or_greater : Boolean by Delegates.notNull()
|
||||||
private set
|
private set
|
||||||
var is_20_15_or_greater : Boolean by Delegates.notNull()
|
var is_20_15_or_greater : Boolean by Delegates.notNull()
|
||||||
private set
|
private set
|
||||||
var is_20_19_or_greater = false
|
var is_20_19_or_greater : Boolean by Delegates.notNull()
|
||||||
private set
|
private set
|
||||||
var is_20_20_or_greater = false
|
var is_20_20_or_greater : Boolean by Delegates.notNull()
|
||||||
private set
|
private set
|
||||||
var is_20_21_or_greater = false
|
var is_20_21_or_greater : Boolean by Delegates.notNull()
|
||||||
private set
|
private set
|
||||||
var is_20_22_or_greater = false
|
var is_20_22_or_greater : Boolean by Delegates.notNull()
|
||||||
private set
|
private set
|
||||||
var is_20_26_or_greater = false
|
var is_20_26_or_greater : Boolean by Delegates.notNull()
|
||||||
private set
|
private set
|
||||||
var is_20_28_or_greater = false
|
var is_20_28_or_greater : Boolean by Delegates.notNull()
|
||||||
private set
|
private set
|
||||||
var is_20_30_or_greater = false
|
var is_20_30_or_greater : Boolean by Delegates.notNull()
|
||||||
private set
|
private set
|
||||||
var is_20_31_or_greater = false
|
var is_20_31_or_greater : Boolean by Delegates.notNull()
|
||||||
private set
|
private set
|
||||||
var is_20_34_or_greater = false
|
var is_20_34_or_greater : Boolean by Delegates.notNull()
|
||||||
private set
|
private set
|
||||||
var is_20_37_or_greater = false
|
var is_20_37_or_greater : Boolean by Delegates.notNull()
|
||||||
private set
|
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
|
private set
|
||||||
|
|
||||||
val versionCheckPatch = resourcePatch(
|
val versionCheckPatch = resourcePatch(
|
||||||
|
|
@ -132,5 +134,6 @@ val versionCheckPatch = resourcePatch(
|
||||||
is_20_34_or_greater = 253505000 <= playStoreServicesVersion
|
is_20_34_or_greater = 253505000 <= playStoreServicesVersion
|
||||||
is_20_37_or_greater = 253805000 <= playStoreServicesVersion
|
is_20_37_or_greater = 253805000 <= playStoreServicesVersion
|
||||||
is_20_39_or_greater = 253980000 <= playStoreServicesVersion
|
is_20_39_or_greater = 253980000 <= playStoreServicesVersion
|
||||||
|
is_20_41_or_greater = 254205000 <= playStoreServicesVersion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue