feat(Cricbuzz): Add Hide ads patch (#4998)

This commit is contained in:
Sourav Agrawal
2025-06-26 12:38:22 +05:30
committed by GitHub
parent e22d4e6a4b
commit 558bf8bca8
2 changed files with 36 additions and 0 deletions

View File

@@ -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\""
)
}
}
}

View File

@@ -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)
}