Skip to content

Commit 2f7d751

Browse files
FullerBread2032FullerBread2032
andauthored
fix(Soundcloud - Hide ads): Support latest version (#3628)
Co-authored-by: FullerBread2032 <[email protected]>
1 parent 4886a95 commit 2f7d751

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/main/kotlin/app/revanced/patches/soundcloud/ad/HideAdsPatch.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ object HideAdsPatch : BytecodePatch(
6262

6363
// Prevent verification of an HTTP header containing the user's current plan, which would contradict the previous patch.
6464
InterceptFingerprint.resultOrThrow().let { result ->
65-
val conditionIndex = result.scanResult.patternScanResult!!.endIndex
65+
val conditionIndex = result.scanResult.patternScanResult!!.endIndex + 1
6666
result.mutableMethod.addInstruction(
6767
conditionIndex,
6868
"return-object p1",

src/main/kotlin/app/revanced/patches/soundcloud/ad/fingerprints/InterceptFingerprint.kt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@ internal object InterceptFingerprint : MethodFingerprint(
99
accessFlags = AccessFlags.PUBLIC.value,
1010
parameters = listOf("L"),
1111
opcodes = listOf(
12-
Opcode.INVOKE_INTERFACE,
1312
Opcode.MOVE_RESULT_OBJECT,
14-
Opcode.INVOKE_VIRTUAL,
15-
Opcode.MOVE_RESULT,
16-
Opcode.IF_EQZ,
13+
Opcode.INVOKE_INTERFACE,
14+
Opcode.MOVE_RESULT_OBJECT
1715
),
1816
strings = listOf("SC-Mob-UserPlan", "Configuration"),
1917
customFingerprint = { _, classDef ->
20-
classDef.sourceFile == "ApiUserPlanInterceptor.java"
18+
classDef.sourceFile == "ApiUserPlanInterceptor.java" ||
19+
classDef.sourceFile == "ApiUserPlanInterceptor.kt"
2120
},
2221
)

0 commit comments

Comments
 (0)