mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-12-07 01:51:27 +01:00
feat(Cricbuzz): Add Hide ads patch (#4998)
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package app.revanced.patches.cricbuzz.ads
|
||||
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
import app.revanced.util.indexOfFirstInstructionOrThrow
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
@Suppress("unused")
|
||||
val disableAdsPatch = bytecodePatch (
|
||||
name = "Hide ads",
|
||||
) {
|
||||
compatibleWith("com.cricbuzz.android"("6.23.02"))
|
||||
|
||||
execute {
|
||||
userStateSwitchFingerprint.method.apply {
|
||||
val opcodeIndex = indexOfFirstInstructionOrThrow(Opcode.MOVE_RESULT_OBJECT)
|
||||
val register = getInstruction<OneRegisterInstruction>(opcodeIndex).registerA
|
||||
|
||||
addInstruction(
|
||||
opcodeIndex + 1,
|
||||
"const-string v$register, \"ACTIVE\""
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package app.revanced.patches.cricbuzz.ads
|
||||
|
||||
import app.revanced.patcher.fingerprint
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
|
||||
internal val userStateSwitchFingerprint = fingerprint {
|
||||
strings("key.user.state", "NA")
|
||||
opcodes(Opcode.SPARSE_SWITCH)
|
||||
}
|
||||
Reference in New Issue
Block a user