File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed
patches/src/main/kotlin/app/revanced/patches/cricbuzz/ads Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ package app.revanced.patches.cricbuzz.ads
2
+
3
+ import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
4
+ import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
5
+ import app.revanced.patcher.patch.bytecodePatch
6
+ import app.revanced.util.indexOfFirstInstructionOrThrow
7
+ import com.android.tools.smali.dexlib2.Opcode
8
+ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
9
+
10
+ @Suppress(" unused" )
11
+ val disableAdsPatch = bytecodePatch (
12
+ name = " Hide ads" ,
13
+ ) {
14
+ compatibleWith(" com.cricbuzz.android" (" 6.23.02" ))
15
+
16
+ execute {
17
+ userStateSwitchFingerprint.method.apply {
18
+ val opcodeIndex = indexOfFirstInstructionOrThrow(Opcode .MOVE_RESULT_OBJECT )
19
+ val register = getInstruction<OneRegisterInstruction >(opcodeIndex).registerA
20
+
21
+ addInstruction(
22
+ opcodeIndex + 1 ,
23
+ " const-string v$register , \" ACTIVE\" "
24
+ )
25
+ }
26
+ }
27
+ }
Original file line number Diff line number Diff line change
1
+ package app.revanced.patches.cricbuzz.ads
2
+
3
+ import app.revanced.patcher.fingerprint
4
+ import com.android.tools.smali.dexlib2.Opcode
5
+
6
+ internal val userStateSwitchFingerprint = fingerprint {
7
+ strings(" key.user.state" , " NA" )
8
+ opcodes(Opcode .SPARSE_SWITCH )
9
+ }
You can’t perform that action at this time.
0 commit comments