fix(YouTube - Hide layout components): Reduce false positives when hiding mix playlists
Implementation references taken from github.com/inotia00/revanced-integrations/commit/cfaf3d6356f316623ad32b10719b1b5ef0ba25b9
This commit is contained in:
parent
68d10d4779
commit
fb173e18af
|
@ -23,6 +23,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch.PreferenceScreen
|
import app.revanced.patches.youtube.misc.settings.SettingsPatch.PreferenceScreen
|
||||||
import com.android.tools.smali.dexlib2.Opcode
|
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.TwoRegisterInstruction
|
||||||
|
|
||||||
@Patch(
|
@Patch(
|
||||||
name = "Hide layout components",
|
name = "Hide layout components",
|
||||||
|
@ -327,12 +328,15 @@ object HideLayoutComponentsPatch : BytecodePatch(
|
||||||
|
|
||||||
result.mutableMethod.apply {
|
result.mutableMethod.apply {
|
||||||
val consumeByteBufferIndex = result.scanResult.patternScanResult!!.startIndex
|
val consumeByteBufferIndex = result.scanResult.patternScanResult!!.startIndex
|
||||||
val byteBufferRegister = getInstruction<FiveRegisterInstruction>(consumeByteBufferIndex).registerD
|
val conversionContextRegister =
|
||||||
|
getInstruction<TwoRegisterInstruction>(consumeByteBufferIndex - 2).registerA
|
||||||
|
val byteBufferRegister =
|
||||||
|
getInstruction<FiveRegisterInstruction>(consumeByteBufferIndex).registerD
|
||||||
|
|
||||||
addInstructionsWithLabels(
|
addInstructionsWithLabels(
|
||||||
result.scanResult.patternScanResult!!.startIndex,
|
consumeByteBufferIndex,
|
||||||
"""
|
"""
|
||||||
invoke-static {v$byteBufferRegister}, $FILTER_CLASS_DESCRIPTOR->filterMixPlaylists([B)Z
|
invoke-static {v$conversionContextRegister, v$byteBufferRegister}, $FILTER_CLASS_DESCRIPTOR->filterMixPlaylists(Ljava/lang/Object;[B)Z
|
||||||
move-result v0 # Conveniently same register happens to be free.
|
move-result v0 # Conveniently same register happens to be free.
|
||||||
if-nez v0, :return_empty_component
|
if-nez v0, :return_empty_component
|
||||||
""",
|
""",
|
||||||
|
|
Loading…
Reference in a new issue