feat(YouTube): Support version 19.05, 19.06, 19.07, 19.08 and 19.09 (#2862)

This commit is contained in:
LisoUseInAIKyrios 2024-03-11 17:20:07 +04:00 committed by GitHub
parent 10f5363335
commit f044dde054
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
58 changed files with 373 additions and 140 deletions

View file

@ -36,9 +36,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37", "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
], ],
), ),
], ],

View file

@ -30,9 +30,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -35,9 +35,13 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -23,9 +23,13 @@ import app.revanced.patches.youtube.video.information.VideoInformationPatch
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37", "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
], ],
), ),
], ],

View file

@ -32,9 +32,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -31,9 +31,13 @@ import app.revanced.util.resultOrThrow
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37", "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
], ],
), ),
], ],

View file

@ -32,9 +32,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -34,9 +34,13 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -30,9 +30,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
], ],

View file

@ -36,9 +36,13 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethod
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -34,9 +34,13 @@ import app.revanced.util.exception
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
], ],

View file

@ -33,9 +33,13 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -43,9 +43,13 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -34,9 +34,13 @@ import com.android.tools.smali.dexlib2.Opcode
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -41,9 +41,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37", "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
], ],
), ),
], ],

View file

@ -38,9 +38,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction3rc
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -32,9 +32,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -32,9 +32,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -32,9 +32,13 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -32,9 +32,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -35,9 +35,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction21c
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -32,9 +32,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -28,9 +28,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -28,9 +28,13 @@ import app.revanced.util.exception
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -48,9 +48,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37", "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
], ],
), ),
], ],

View file

@ -39,9 +39,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -28,9 +28,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -33,9 +33,13 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -30,9 +30,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -35,9 +35,13 @@ import app.revanced.patches.youtube.shared.fingerprints.SeekbarOnDrawFingerprint
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -40,9 +40,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -27,9 +27,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -28,9 +28,13 @@ import app.revanced.util.exception
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -29,9 +29,13 @@ import app.revanced.util.exception
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -24,9 +24,13 @@ import org.w3c.dom.Element
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37", "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
], ],
), ),
], ],

View file

@ -58,9 +58,13 @@ import com.android.tools.smali.dexlib2.iface.reference.TypeReference
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -33,9 +33,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -29,9 +29,13 @@ import app.revanced.util.exception
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -42,9 +42,13 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
], ],

View file

@ -32,9 +32,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -38,9 +38,13 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -37,9 +37,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
) )
) )
] ]

View file

@ -41,9 +41,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -53,9 +53,13 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethod
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37", "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
], ],
), ),
], ],

View file

@ -33,9 +33,13 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -28,9 +28,13 @@ import app.revanced.util.exception
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -21,9 +21,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -38,9 +38,13 @@ object GmsCoreSupportPatch : BaseGmsCoreSupportPatch(
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
) )
) )
), ),

View file

@ -30,9 +30,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -34,9 +34,13 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -10,14 +10,20 @@ import app.revanced.patcher.extensions.InstructionExtensions.removeInstructions
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patcher.fingerprint.MethodFingerprint
import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchException
import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patcher.util.smali.ExternalLabel
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
import app.revanced.patches.youtube.misc.litho.filter.fingerprints.* import app.revanced.patches.youtube.misc.litho.filter.fingerprints.*
import app.revanced.util.getReference
import app.revanced.util.indexOfFirstInstruction
import com.android.tools.smali.dexlib2.Opcode
import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
import com.android.tools.smali.dexlib2.iface.instruction.Instruction import com.android.tools.smali.dexlib2.iface.instruction.Instruction
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.instruction.ReferenceInstruction import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
import com.android.tools.smali.dexlib2.iface.reference.FieldReference
import com.android.tools.smali.dexlib2.iface.reference.TypeReference
import java.io.Closeable import java.io.Closeable
@Patch( @Patch(
@ -102,7 +108,11 @@ object LithoFilterPatch : BytecodePatch(
val emptyComponentFieldIndex = builderMethodIndex + 2 val emptyComponentFieldIndex = builderMethodIndex + 2
bytesToComponentContextMethod.mutableMethod.apply { bytesToComponentContextMethod.mutableMethod.apply {
val insertHookIndex = bytesToComponentContextMethod.scanResult.patternScanResult!!.endIndex + 1 val insertHookIndex = indexOfFirstInstruction {
opcode == Opcode.IPUT_OBJECT &&
getReference<FieldReference>()?.type == "Ljava/lang/StringBuilder;"
} + 1
if (insertHookIndex <= 0) throw PatchException("Could not find insert index")
// region Get free registers that this patch uses. // region Get free registers that this patch uses.
// Registers are overwritten right after they are used in this patch, therefore free to clobber. // Registers are overwritten right after they are used in this patch, therefore free to clobber.

View file

@ -1,13 +1,7 @@
package app.revanced.patches.youtube.misc.litho.filter.fingerprints package app.revanced.patches.youtube.misc.litho.filter.fingerprints
import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patcher.fingerprint.MethodFingerprint
import com.android.tools.smali.dexlib2.Opcode
internal object ComponentContextParserFingerprint : MethodFingerprint( internal object ComponentContextParserFingerprint : MethodFingerprint(
opcodes = listOf(
Opcode.INVOKE_VIRTUAL,
Opcode.INVOKE_VIRTUAL,
Opcode.IPUT_OBJECT,
),
strings = listOf("Component was not found %s because it was removed due to duplicate converter bindings.") strings = listOf("Component was not found %s because it was removed due to duplicate converter bindings.")
) )

View file

@ -39,9 +39,13 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -35,9 +35,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -10,6 +10,7 @@ import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
import app.revanced.patches.youtube.misc.settings.SettingsPatch import app.revanced.patches.youtube.misc.settings.SettingsPatch
import app.revanced.patches.youtube.video.hdrbrightness.fingerprints.HDRBrightnessFingerprint import app.revanced.patches.youtube.video.hdrbrightness.fingerprints.HDRBrightnessFingerprint
import app.revanced.util.exception
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction 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.TwoRegisterInstruction
import com.android.tools.smali.dexlib2.iface.reference.FieldReference import com.android.tools.smali.dexlib2.iface.reference.FieldReference
@ -32,12 +33,16 @@ import com.android.tools.smali.dexlib2.iface.reference.FieldReference
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37", "19.04.38",
], "19.05.36",
), "19.06.39",
], "19.07.40",
"19.08.36",
// 19.09+ is dramatically different and the patched code is not present.
]
)
]
) )
@Suppress("unused") @Suppress("unused")
object HDRBrightnessPatch : BytecodePatch( object HDRBrightnessPatch : BytecodePatch(
@ -46,27 +51,31 @@ object HDRBrightnessPatch : BytecodePatch(
override fun execute(context: BytecodeContext) { override fun execute(context: BytecodeContext) {
AddResourcesPatch(this::class) AddResourcesPatch(this::class)
if (HDRBrightnessFingerprint.result == null) throw HDRBrightnessFingerprint.exception
SettingsPatch.PreferenceScreen.VIDEO.addPreferences( SettingsPatch.PreferenceScreen.VIDEO.addPreferences(
SwitchPreference("revanced_hdr_auto_brightness"), SwitchPreference("revanced_hdr_auto_brightness"),
) )
val method = HDRBrightnessFingerprint.result!!.mutableMethod // FIXME
// One of the changes made here effectively does nothing:
method.implementation!!.instructions.filter { instruction -> // It calls getHDRBrightness() and ignores the results.
val fieldReference = (instruction as? ReferenceInstruction)?.reference as? FieldReference HDRBrightnessFingerprint.result?.mutableMethod?.apply {
fieldReference?.let { it.name == "screenBrightness" } == true implementation!!.instructions.filter { instruction ->
}.forEach { instruction -> ((instruction as? ReferenceInstruction)?.reference as? FieldReference)
val brightnessRegisterIndex = method.implementation!!.instructions.indexOf(instruction) ?.name == "screenBrightness"
val register = (instruction as TwoRegisterInstruction).registerA }.forEach { instruction ->
val brightnessRegisterIndex = implementation!!.instructions.indexOf(instruction)
val insertIndex = brightnessRegisterIndex + 1 val register = (instruction as TwoRegisterInstruction).registerA
method.addInstructions( val insertIndex = brightnessRegisterIndex + 1
insertIndex, addInstructions(
""" insertIndex,
invoke-static {v$register}, Lapp/revanced/integrations/youtube/patches/HDRAutoBrightnessPatch;->getHDRBrightness(F)F """
move-result v$register invoke-static {v$register}, Lapp/revanced/integrations/youtube/patches/HDRAutoBrightnessPatch;->getHDRBrightness(F)F
""", move-result v$register
) """,
} )
}
} ?: throw HDRBrightnessFingerprint.exception
} }
} }

View file

@ -39,9 +39,13 @@ import com.android.tools.smali.dexlib2.iface.reference.FieldReference
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]

View file

@ -19,9 +19,13 @@ import app.revanced.patches.youtube.video.speed.remember.RememberPlaybackSpeedPa
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37", "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
], ],
), ),
], ],

View file

@ -35,9 +35,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
"18.49.37", "18.49.37",
"19.01.34", "19.01.34",
"19.02.39", "19.02.39",
"19.03.35",
"19.03.36", "19.03.36",
"19.04.37" "19.04.38",
"19.05.36",
"19.06.39",
"19.07.40",
"19.08.36",
"19.09.37"
] ]
) )
] ]