File tree 4 files changed +76
-0
lines changed
src/main/kotlin/app/revanced/patches/pandora
4 files changed +76
-0
lines changed Original file line number Diff line number Diff line change @@ -380,6 +380,14 @@ public final class app/revanced/patches/openinghours/misc/fix/crash/FixCrashPatc
380
380
public static final fun getFixCrashPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
381
381
}
382
382
383
+ public final class app/revanced/patches/pandora/ads/DisableAudioAdsPatchKt {
384
+ public static final fun getDisableAudioAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
385
+ }
386
+
387
+ public final class app/revanced/patches/pandora/misc/EnableUnlimitedSkipsPatchKt {
388
+ public static final fun getEnableUnlimitedSkipsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
389
+ }
390
+
383
391
public final class app/revanced/patches/photomath/detection/deviceid/SpoofDeviceIdPatchKt {
384
392
public static final fun getGetDeviceIdPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
385
393
}
Original file line number Diff line number Diff line change
1
+ package app.revanced.patches.pandora.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.patches.pandora.shared.constructUserDataFingerprint
7
+ import app.revanced.util.indexOfFirstInstructionOrThrow
8
+ import com.android.tools.smali.dexlib2.Opcode
9
+ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
10
+
11
+ @Suppress(" unused" )
12
+ val disableAudioAdsPatch = bytecodePatch(
13
+ name = " Disable audio ads" ,
14
+ ) {
15
+ compatibleWith(" com.pandora.android" )
16
+
17
+ execute {
18
+ constructUserDataFingerprint.method.apply {
19
+ // First match is "hasAudioAds".
20
+ val hasAudioAdsStringIndex = constructUserDataFingerprint.stringMatches!! .first().index
21
+ val moveResultIndex = indexOfFirstInstructionOrThrow(hasAudioAdsStringIndex, Opcode .MOVE_RESULT )
22
+ val hasAudioAdsRegister = getInstruction<OneRegisterInstruction >(moveResultIndex).registerA
23
+
24
+ addInstruction(
25
+ moveResultIndex + 1 ,
26
+ " const/4 v$hasAudioAdsRegister , 0"
27
+ )
28
+ }
29
+ }
30
+ }
Original file line number Diff line number Diff line change
1
+ package app.revanced.patches.pandora.misc
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.patches.pandora.shared.constructUserDataFingerprint
7
+ import app.revanced.util.indexOfFirstInstructionOrThrow
8
+ import com.android.tools.smali.dexlib2.Opcode
9
+ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
10
+
11
+ @Suppress(" unused" )
12
+ val enableUnlimitedSkipsPatch = bytecodePatch(
13
+ name = " Enable unlimited skips" ,
14
+ ) {
15
+ compatibleWith(" com.pandora.android" )
16
+
17
+ execute {
18
+ constructUserDataFingerprint.method.apply {
19
+ // Last match is "skipLimitBehavior".
20
+ val skipLimitBehaviorStringIndex = constructUserDataFingerprint.stringMatches!! .last().index
21
+ val moveResultObjectIndex =
22
+ indexOfFirstInstructionOrThrow(skipLimitBehaviorStringIndex, Opcode .MOVE_RESULT_OBJECT )
23
+ val skipLimitBehaviorRegister = getInstruction<OneRegisterInstruction >(moveResultObjectIndex).registerA
24
+
25
+ addInstruction(
26
+ moveResultObjectIndex + 1 ,
27
+ " const-string v$skipLimitBehaviorRegister , \" unlimited\" "
28
+ )
29
+ }
30
+ }
31
+ }
Original file line number Diff line number Diff line change
1
+ package app.revanced.patches.pandora.shared
2
+
3
+ import app.revanced.patcher.fingerprint
4
+
5
+ internal val constructUserDataFingerprint = fingerprint {
6
+ strings(" hasAudioAds" , " skipLimitBehavior" )
7
+ }
You can’t perform that action at this time.
0 commit comments