mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-12 05:07:41 +02:00
feat(YouTube - Fullscreen components): Remove Force fullscreen
setting
This commit is contained in:
@ -23,19 +23,6 @@ internal val broadcastReceiverFingerprint = legacyFingerprint(
|
||||
}
|
||||
)
|
||||
|
||||
internal val clientSettingEndpointFingerprint = legacyFingerprint(
|
||||
name = "clientSettingEndpointFingerprint",
|
||||
returnType = "V",
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
parameters = listOf("L", "Ljava/util/Map;"),
|
||||
strings = listOf(
|
||||
"OVERRIDE_EXIT_FULLSCREEN_TO_MAXIMIZED",
|
||||
"force_fullscreen",
|
||||
"start_watch_minimized",
|
||||
"watch"
|
||||
)
|
||||
)
|
||||
|
||||
internal val engagementPanelFingerprint = legacyFingerprint(
|
||||
name = "engagementPanelFingerprint",
|
||||
returnType = "L",
|
||||
@ -72,10 +59,3 @@ internal val relatedEndScreenResultsFingerprint = legacyFingerprint(
|
||||
literals = listOf(appRelatedEndScreenResults),
|
||||
)
|
||||
|
||||
internal val videoPortraitParentFingerprint = legacyFingerprint(
|
||||
name = "videoPortraitParentFingerprint",
|
||||
returnType = "V",
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
parameters = listOf("L", "Ljava/util/Map;"),
|
||||
strings = listOf("Acquiring NetLatencyActionLogger failed. taskId=")
|
||||
)
|
||||
|
@ -42,7 +42,6 @@ import com.android.tools.smali.dexlib2.Opcode
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.WideLiteralInstruction
|
||||
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
||||
|
||||
@ -198,60 +197,6 @@ val fullscreenComponentsPatch = bytecodePatch(
|
||||
|
||||
// endregion
|
||||
|
||||
// region patch for force fullscreen
|
||||
|
||||
clientSettingEndpointFingerprint.methodOrThrow().apply {
|
||||
val getActivityIndex = indexOfFirstStringInstructionOrThrow("watch") + 2
|
||||
val getActivityReference =
|
||||
getInstruction<ReferenceInstruction>(getActivityIndex).reference
|
||||
val classRegister =
|
||||
getInstruction<TwoRegisterInstruction>(getActivityIndex).registerB
|
||||
|
||||
val watchDescriptorMethodIndex =
|
||||
indexOfFirstStringInstructionOrThrow("start_watch_minimized") - 1
|
||||
val watchDescriptorRegister =
|
||||
getInstruction<FiveRegisterInstruction>(watchDescriptorMethodIndex).registerD
|
||||
|
||||
addInstructions(
|
||||
watchDescriptorMethodIndex, """
|
||||
invoke-static {v$watchDescriptorRegister}, $PLAYER_CLASS_DESCRIPTOR->forceFullscreen(Z)Z
|
||||
move-result v$watchDescriptorRegister
|
||||
"""
|
||||
)
|
||||
|
||||
// hooks Activity.
|
||||
val insertIndex = indexOfFirstStringInstructionOrThrow("force_fullscreen")
|
||||
val freeRegister = getInstruction<OneRegisterInstruction>(insertIndex).registerA
|
||||
|
||||
addInstructions(
|
||||
insertIndex, """
|
||||
iget-object v$freeRegister, v$classRegister, $getActivityReference
|
||||
check-cast v$freeRegister, Landroid/app/Activity;
|
||||
invoke-static {v$freeRegister}, $PLAYER_CLASS_DESCRIPTOR->setWatchDescriptorActivity(Landroid/app/Activity;)V
|
||||
"""
|
||||
)
|
||||
}
|
||||
|
||||
videoPortraitParentFingerprint.methodOrThrow().apply {
|
||||
val stringIndex =
|
||||
indexOfFirstStringInstructionOrThrow("Acquiring NetLatencyActionLogger failed. taskId=")
|
||||
val invokeIndex =
|
||||
indexOfFirstInstructionOrThrow(stringIndex, Opcode.INVOKE_INTERFACE)
|
||||
val targetIndex = indexOfFirstInstructionOrThrow(invokeIndex, Opcode.CHECK_CAST)
|
||||
val targetClass =
|
||||
getInstruction<ReferenceInstruction>(targetIndex).reference.toString()
|
||||
|
||||
// add an instruction to check the vertical video
|
||||
findMethodOrThrow(targetClass) {
|
||||
parameters == listOf("I", "I", "Z")
|
||||
}.addInstruction(
|
||||
1,
|
||||
"invoke-static {p1, p2}, $PLAYER_CLASS_DESCRIPTOR->setVideoPortrait(II)V"
|
||||
)
|
||||
}
|
||||
|
||||
// endregion
|
||||
|
||||
// region patch for disable landscape mode
|
||||
|
||||
onConfigurationChangedMethod.apply {
|
||||
|
Reference in New Issue
Block a user