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 1
1
package app.revanced.patches.pandora.ads
2
2
3
- import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
4
- import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
5
3
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
4
+ import app.revanced.util.returnEarly
10
5
11
6
@Suppress(" unused" )
12
7
val disableAudioAdsPatch = bytecodePatch(
@@ -15,16 +10,7 @@ val disableAudioAdsPatch = bytecodePatch(
15
10
compatibleWith(" com.pandora.android" )
16
11
17
12
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()
29
15
}
30
16
}
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 1
1
package app.revanced.patches.pandora.misc
2
2
3
- import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
4
- import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
5
3
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
4
+ import app.revanced.util.returnEarly
10
5
11
6
@Suppress(" unused" )
12
7
val enableUnlimitedSkipsPatch = bytecodePatch(
@@ -15,17 +10,6 @@ val enableUnlimitedSkipsPatch = bytecodePatch(
15
10
compatibleWith(" com.pandora.android" )
16
11
17
12
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" )
30
14
}
31
15
}
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