fix(YouTube - Copy video URL): Support A/B player layout

This commit is contained in:
LisoUseInAIKyrios 2024-11-02 12:52:48 -04:00 committed by oSumAtrIX
parent 15a8848cca
commit 0f42574b7f
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4
4 changed files with 22 additions and 0 deletions

View File

@ -1348,6 +1348,7 @@ public final class app/revanced/patches/youtube/misc/playservice/VersionCheckPat
public static final fun is_19_32_or_greater ()Z
public static final fun is_19_33_or_greater ()Z
public static final fun is_19_34_or_greater ()Z
public static final fun is_19_35_or_greater ()Z
public static final fun is_19_36_or_greater ()Z
public static final fun is_19_41_or_greater ()Z
public static final fun is_19_43_or_greater ()Z

View File

@ -46,3 +46,11 @@ internal val controlsOverlayVisibilityFingerprint = fingerprint {
returns("V")
parameters("Z", "Z")
}
internal val playerControlsExploderFeatureFlagFingerprint = fingerprint {
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
returns("Z")
parameters()
literal { 45643739L }
}

View File

@ -10,6 +10,7 @@ import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patches.shared.misc.mapping.get
import app.revanced.patches.shared.misc.mapping.resourceMappingPatch
import app.revanced.patches.shared.misc.mapping.resourceMappings
import app.revanced.patches.youtube.misc.playservice.is_19_35_or_greater
import app.revanced.util.*
import com.android.tools.smali.dexlib2.Opcode
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
@ -217,6 +218,7 @@ val playerControlsPatch = bytecodePatch(
val playerTopControlsInflateMatch by playerTopControlsInflateFingerprint()
val overlayViewInflateMatch by overlayViewInflateFingerprint()
val playerControlsExtensionHookMatch by playerControlsExtensionHookFingerprint()
val playerControlsExploderFeatureFlagMatch by playerControlsExploderFeatureFlagFingerprint()
execute { context ->
fun MutableMethod.indexOfFirstViewInflateOrThrow() =
@ -269,5 +271,13 @@ val playerControlsPatch = bytecodePatch(
}
visibilityImmediateMethod = playerControlsExtensionHookMatch.mutableMethod
// A/B test for a slightly different overlay controls,
// that uses layout file youtube_video_exploder_controls_bottom_ui_container.xml
// The change to support this is simple and only requires adding buttons to both layout files,
// but for now force this different layout off since it's still an experimental test.
if (is_19_35_or_greater) {
playerControlsExploderFeatureFlagMatch.mutableMethod.returnEarly()
}
}
}

View File

@ -29,6 +29,8 @@ var is_19_33_or_greater = false
private set
var is_19_34_or_greater = false
private set
var is_19_35_or_greater = false
private set
var is_19_36_or_greater = false
private set
var is_19_41_or_greater = false
@ -62,6 +64,7 @@ val versionCheckPatch = resourcePatch(
is_19_32_or_greater = 243199000 <= playStoreServicesVersion
is_19_33_or_greater = 243405000 <= playStoreServicesVersion
is_19_34_or_greater = 243499000 <= playStoreServicesVersion
is_19_35_or_greater = 243605000 <= playStoreServicesVersion
is_19_36_or_greater = 243705000 <= playStoreServicesVersion
is_19_41_or_greater = 244305000 <= playStoreServicesVersion
is_19_43_or_greater = 244405000 <= playStoreServicesVersion