mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-05 00:54:32 +02:00
fix(YouTube/Enable tablet layout): rollback to previous commit
This commit is contained in:
parent
de9d22f554
commit
5ef4760f47
@ -61,27 +61,17 @@ object LayoutSwitchPatch : BytecodePatch(
|
|||||||
|
|
||||||
GetFormFactorFingerprint.result?.let {
|
GetFormFactorFingerprint.result?.let {
|
||||||
it.mutableMethod.apply {
|
it.mutableMethod.apply {
|
||||||
val returnCurrentFormFactorIndex = getInstructions().lastIndex - 2
|
val jumpIndex = it.scanResult.patternScanResult!!.endIndex - 4
|
||||||
|
|
||||||
val returnIsLargeFormFactorLabel = getInstruction(returnCurrentFormFactorIndex - 2)
|
|
||||||
val returnFormFactorIndex = getInstruction(returnCurrentFormFactorIndex)
|
|
||||||
|
|
||||||
val insertIndex = returnCurrentFormFactorIndex + 1
|
|
||||||
|
|
||||||
// Replace the labeled instruction with a nop and add the preserved instructions back
|
|
||||||
replaceInstruction(returnCurrentFormFactorIndex, BuilderInstruction10x(Opcode.NOP))
|
|
||||||
addInstruction(insertIndex, returnFormFactorIndex)
|
|
||||||
|
|
||||||
// Because the labeled instruction is now a nop, we can add our own instructions right after it
|
|
||||||
addInstructionsWithLabels(
|
addInstructionsWithLabels(
|
||||||
insertIndex, """
|
0, """
|
||||||
invoke-static { }, $MISC_PATH/LayoutOverridePatch;->enableTabletLayout()Z
|
invoke-static { }, $MISC_PATH/LayoutOverridePatch;->enableTabletLayout()Z
|
||||||
move-result v0 # Free register
|
move-result v0 # Free register
|
||||||
if-nez v0, :is_large_form_factor
|
if-nez v0, :is_large_form_factor
|
||||||
""",
|
""",
|
||||||
ExternalLabel(
|
ExternalLabel(
|
||||||
"is_large_form_factor",
|
"is_large_form_factor",
|
||||||
returnIsLargeFormFactorLabel
|
getInstruction(jumpIndex)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user