2023-02-19 23:54:29 +01:00
|
|
|
package app.revanced.patches.youtube.layout.hide.breakingnews.bytecode.fingerprints
|
2022-12-29 17:42:33 +01:00
|
|
|
|
|
|
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
2023-02-19 23:54:29 +01:00
|
|
|
import app.revanced.patches.youtube.layout.hide.breakingnews.resource.patch.BreakingNewsResourcePatch
|
2022-12-29 17:42:33 +01:00
|
|
|
import org.jf.dexlib2.Opcode
|
|
|
|
import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
|
|
|
|
|
|
|
|
object BreakingNewsFingerprint : MethodFingerprint(
|
|
|
|
opcodes = listOf(
|
|
|
|
Opcode.CONST,
|
|
|
|
Opcode.CONST_4,
|
|
|
|
Opcode.INVOKE_VIRTUAL,
|
|
|
|
Opcode.MOVE_RESULT_OBJECT,
|
|
|
|
Opcode.CHECK_CAST,
|
|
|
|
Opcode.IPUT_OBJECT,
|
|
|
|
),
|
2023-05-13 03:18:48 +02:00
|
|
|
customFingerprint = { methodDef, _ ->
|
2022-12-29 17:42:33 +01:00
|
|
|
methodDef.implementation?.instructions?.any { instruction ->
|
|
|
|
instruction.opcode.ordinal == Opcode.CONST.ordinal &&
|
|
|
|
(instruction as? WideLiteralInstruction)?.wideLiteral == BreakingNewsResourcePatch.horizontalCardListId
|
|
|
|
} == true
|
|
|
|
}
|
|
|
|
)
|