feat(YouTube - Fullscreen components): Remove Force fullscreen setting

This commit is contained in:
inotia00
2025-01-03 21:48:58 +09:00
parent c6ad8331bc
commit a596959d71
7 changed files with 1 additions and 139 deletions

View File

@ -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=")
)

View File

@ -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 {