fix(YouTube - Hide Shorts components): Disable A/B player that prevents hiding buttons (#5104)
This commit is contained in:

committed by
GitHub

parent
8ccf7c881c
commit
835b7bd7bd
@ -74,3 +74,21 @@ internal val setPivotBarVisibilityParentFingerprint = fingerprint {
|
|||||||
parameters("Z")
|
parameters("Z")
|
||||||
strings("FEnotifications_inbox")
|
strings("FEnotifications_inbox")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal val shortsExperimentalPlayerFeatureFlagFingerprint = fingerprint {
|
||||||
|
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
|
||||||
|
returns("Z")
|
||||||
|
parameters()
|
||||||
|
literal {
|
||||||
|
45677719L
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
internal val renderNextUIFeatureFlagFingerprint = fingerprint {
|
||||||
|
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
|
||||||
|
returns("Z")
|
||||||
|
parameters()
|
||||||
|
literal {
|
||||||
|
45649743L
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -18,6 +18,7 @@ import app.revanced.patches.youtube.misc.litho.filter.addLithoFilter
|
|||||||
import app.revanced.patches.youtube.misc.litho.filter.lithoFilterPatch
|
import app.revanced.patches.youtube.misc.litho.filter.lithoFilterPatch
|
||||||
import app.revanced.patches.youtube.misc.navigation.navigationBarHookPatch
|
import app.revanced.patches.youtube.misc.navigation.navigationBarHookPatch
|
||||||
import app.revanced.patches.youtube.misc.playservice.is_19_41_or_greater
|
import app.revanced.patches.youtube.misc.playservice.is_19_41_or_greater
|
||||||
|
import app.revanced.patches.youtube.misc.playservice.is_20_07_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
|
||||||
@ -26,6 +27,7 @@ import app.revanced.util.forEachLiteralValueInstruction
|
|||||||
import app.revanced.util.getReference
|
import app.revanced.util.getReference
|
||||||
import app.revanced.util.indexOfFirstInstructionOrThrow
|
import app.revanced.util.indexOfFirstInstructionOrThrow
|
||||||
import app.revanced.util.indexOfFirstLiteralInstruction
|
import app.revanced.util.indexOfFirstLiteralInstruction
|
||||||
|
import app.revanced.util.returnLate
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
||||||
|
|
||||||
@ -252,5 +254,27 @@ val hideShortsComponentsPatch = bytecodePatch(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
|
// region Disable experimental Shorts flags.
|
||||||
|
|
||||||
|
// Flags might be present in earlier targets, but they are not found in 19.47.53.
|
||||||
|
// If these flags are forced on, the experimental layout is still not used and
|
||||||
|
// it appears the features requires additional server side data to fully use.
|
||||||
|
if (is_20_07_or_greater) {
|
||||||
|
// Experimental Shorts player uses Android native buttons and not Litho,
|
||||||
|
// and the layout is provided by the server.
|
||||||
|
//
|
||||||
|
// Since the buttons are native components and not Litho, it should be possible to
|
||||||
|
// fix the RYD Shorts loading delay by asynchronously loading RYD and updating
|
||||||
|
// the button text after RYD has loaded.
|
||||||
|
shortsExperimentalPlayerFeatureFlagFingerprint.method.returnLate(true)
|
||||||
|
|
||||||
|
// Experimental UI renderer must also be disabled since it requires the
|
||||||
|
// experimental Shorts player. If this is enabled but Shorts player
|
||||||
|
// is disabled then the app crashes when the Shorts player is opened.
|
||||||
|
renderNextUIFeatureFlagFingerprint.method.returnLate(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
// endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user