From 66e7e33efce9b702fdfcc2b9803e9da8491c1f08 Mon Sep 17 00:00:00 2001 From: FullerBread2032 <56510855+FullerBread2032@users.noreply.github.com> Date: Sat, 14 Sep 2024 17:07:27 +0200 Subject: [PATCH] fix(Soundcloud - Hide ads): Support latest version (#3628) Co-authored-by: FullerBread2032 --- .../app/revanced/patches/soundcloud/ad/HideAdsPatch.kt | 2 +- .../soundcloud/ad/fingerprints/InterceptFingerprint.kt | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/soundcloud/ad/HideAdsPatch.kt b/src/main/kotlin/app/revanced/patches/soundcloud/ad/HideAdsPatch.kt index 4f538458a..ea94b3f2a 100644 --- a/src/main/kotlin/app/revanced/patches/soundcloud/ad/HideAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/soundcloud/ad/HideAdsPatch.kt @@ -62,7 +62,7 @@ object HideAdsPatch : BytecodePatch( // Prevent verification of an HTTP header containing the user's current plan, which would contradict the previous patch. InterceptFingerprint.resultOrThrow().let { result -> - val conditionIndex = result.scanResult.patternScanResult!!.endIndex + val conditionIndex = result.scanResult.patternScanResult!!.endIndex + 1 result.mutableMethod.addInstruction( conditionIndex, "return-object p1", diff --git a/src/main/kotlin/app/revanced/patches/soundcloud/ad/fingerprints/InterceptFingerprint.kt b/src/main/kotlin/app/revanced/patches/soundcloud/ad/fingerprints/InterceptFingerprint.kt index d9f1e5874..d38975357 100644 --- a/src/main/kotlin/app/revanced/patches/soundcloud/ad/fingerprints/InterceptFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/soundcloud/ad/fingerprints/InterceptFingerprint.kt @@ -9,14 +9,13 @@ internal object InterceptFingerprint : MethodFingerprint( accessFlags = AccessFlags.PUBLIC.value, parameters = listOf("L"), opcodes = listOf( - Opcode.INVOKE_INTERFACE, Opcode.MOVE_RESULT_OBJECT, - Opcode.INVOKE_VIRTUAL, - Opcode.MOVE_RESULT, - Opcode.IF_EQZ, + Opcode.INVOKE_INTERFACE, + Opcode.MOVE_RESULT_OBJECT ), strings = listOf("SC-Mob-UserPlan", "Configuration"), customFingerprint = { _, classDef -> - classDef.sourceFile == "ApiUserPlanInterceptor.java" + classDef.sourceFile == "ApiUserPlanInterceptor.java" || + classDef.sourceFile == "ApiUserPlanInterceptor.kt" }, )