fix(YouTube/Hide layout components): Hide official header doesn't work (A/B tests)

This commit is contained in:
inotia00 2023-10-20 09:49:32 +09:00
parent a033d52a54
commit c3645ddb34
2 changed files with 1 additions and 34 deletions

View File

@ -12,7 +12,6 @@ import app.revanced.patches.shared.patch.litho.ComponentParserPatch
import app.revanced.patches.shared.patch.litho.ComponentParserPatch.generalHook
import app.revanced.patches.youtube.utils.litho.fingerprints.GeneralByteBufferFingerprint
import app.revanced.patches.youtube.utils.litho.fingerprints.LithoFilterFingerprint
import app.revanced.patches.youtube.utils.litho.fingerprints.LowLevelByteBufferFingerprint
import app.revanced.util.integrations.Constants.ADS_PATH
import java.io.Closeable
@ -21,22 +20,15 @@ import java.io.Closeable
object LithoFilterPatch : BytecodePatch(
setOf(
GeneralByteBufferFingerprint,
LithoFilterFingerprint,
LowLevelByteBufferFingerprint
LithoFilterFingerprint
)
), Closeable {
internal lateinit var addFilter: (String) -> Unit
private set
private var filterCount = 0
override fun execute(context: BytecodeContext) {
LowLevelByteBufferFingerprint.result?.mutableMethod?.addInstruction(
0,
"invoke-static { p0 }, $ADS_PATH/LowLevelFilter;->setProtoBuffer(Ljava/nio/ByteBuffer;)V"
) ?: throw LowLevelByteBufferFingerprint.exception
GeneralByteBufferFingerprint.result?.let {
(context
.toMethodWalker(it.method)

View File

@ -1,25 +0,0 @@
package app.revanced.patches.youtube.utils.litho.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode
object LowLevelByteBufferFingerprint : MethodFingerprint(
returnType = "V",
accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC,
parameters = listOf("L", "L"),
opcodes = listOf(
Opcode.SGET_OBJECT,
Opcode.INVOKE_VIRTUAL,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT,
Opcode.ADD_INT_2ADDR,
Opcode.INVOKE_VIRTUAL,
Opcode.RETURN_VOID
)
)