File tree Expand file tree Collapse file tree 5 files changed +29
-42
lines changed
patches/src/main/kotlin/app/revanced/patches/pandora Expand file tree Collapse file tree 5 files changed +29
-42
lines changed Original file line number Diff line number Diff line change 11package app.revanced.patches.pandora.ads
22
3- import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
4- import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
53import 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
4+ import app.revanced.util.returnEarly
105
116@Suppress(" unused" )
127val disableAudioAdsPatch = bytecodePatch(
@@ -15,16 +10,7 @@ val disableAudioAdsPatch = bytecodePatch(
1510 compatibleWith(" com.pandora.android" )
1611
1712 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- }
13+ getIsAdSupportedFingerprint.method.returnEarly(false )
14+ requestAudioAdFingerprint.method.returnEarly()
2915 }
3016}
Original file line number Diff line number Diff line change 1+ package app.revanced.patches.pandora.ads
2+
3+ import app.revanced.patcher.fingerprint
4+
5+ internal val getIsAdSupportedFingerprint = fingerprint {
6+ custom { method, classDef ->
7+ method.name == " getIsAdSupported" && classDef.endsWith(" UserData;" )
8+ }
9+ }
10+
11+ internal val requestAudioAdFingerprint = fingerprint {
12+ custom { method, classDef ->
13+ method.name == " requestAudioAdFromAdSDK" && classDef.endsWith(" ContentServiceOpsImpl;" )
14+ }
15+ }
Original file line number Diff line number Diff line change 11package app.revanced.patches.pandora.misc
22
3- import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
4- import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
53import 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
4+ import app.revanced.util.returnEarly
105
116@Suppress(" unused" )
127val enableUnlimitedSkipsPatch = bytecodePatch(
@@ -15,17 +10,6 @@ val enableUnlimitedSkipsPatch = bytecodePatch(
1510 compatibleWith(" com.pandora.android" )
1611
1712 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- }
13+ skipLimitBehaviorFingerprint.method.returnEarly(" unlimited" )
3014 }
3115}
Original file line number Diff line number Diff line change 1+ package app.revanced.patches.pandora.misc
2+
3+ import app.revanced.patcher.fingerprint
4+
5+ internal val skipLimitBehaviorFingerprint = fingerprint {
6+ custom { method, classDef ->
7+ method.name == " getSkipLimitBehavior" && classDef.endsWith(" UserData;" )
8+ }
9+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments