From db1a96d4f79f72cfc3cf0da179b8dd2624c808ce Mon Sep 17 00:00:00 2001 From: brosssh Date: Fri, 27 Jun 2025 15:48:25 +0200 Subject: [PATCH 1/2] fix(Spotify - Spoof client patch): Block the verdict request integrity API Blocks the outgoing request containing the broken verdict, in case integrity validation was requested. --- .../app/revanced/patches/spotify/misc/fix/Fingerprints.kt | 8 ++++++++ .../revanced/patches/spotify/misc/fix/SpoofClientPatch.kt | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/patches/src/main/kotlin/app/revanced/patches/spotify/misc/fix/Fingerprints.kt b/patches/src/main/kotlin/app/revanced/patches/spotify/misc/fix/Fingerprints.kt index f1600861a7..dff859cfb2 100644 --- a/patches/src/main/kotlin/app/revanced/patches/spotify/misc/fix/Fingerprints.kt +++ b/patches/src/main/kotlin/app/revanced/patches/spotify/misc/fix/Fingerprints.kt @@ -19,3 +19,11 @@ internal val startupPageLayoutInflateFingerprint = fingerprint { parameters("Landroid/view/LayoutInflater;", "Landroid/view/ViewGroup;", "Landroid/os/Bundle;") strings("blueprintContainer", "gradient", "valuePropositionTextView") } + +internal val standardIntegrityTokenProviderBuilderFingerprint = fingerprint { + strings( + "standard_pi_init", + "outcome", + "success" + ) +} diff --git a/patches/src/main/kotlin/app/revanced/patches/spotify/misc/fix/SpoofClientPatch.kt b/patches/src/main/kotlin/app/revanced/patches/spotify/misc/fix/SpoofClientPatch.kt index 70339813d7..c46213c24c 100644 --- a/patches/src/main/kotlin/app/revanced/patches/spotify/misc/fix/SpoofClientPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/spotify/misc/fix/SpoofClientPatch.kt @@ -12,6 +12,7 @@ import app.revanced.patches.spotify.misc.extension.sharedExtensionPatch import app.revanced.util.findInstructionIndicesReversedOrThrow import app.revanced.util.getReference import app.revanced.util.indexOfFirstInstructionReversedOrThrow +import app.revanced.util.returnEarly import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.reference.MethodReference @@ -118,5 +119,8 @@ val spoofClientPatch = bytecodePatch( """ ) } + + // Early return the integrity builder to avoid making the integrity API call + standardIntegrityTokenProviderBuilderFingerprint.method.returnEarly() } } From 4736c6da4626e5f1c074f419637a2c659559513e Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Fri, 27 Jun 2025 16:02:24 +0200 Subject: [PATCH 2/2] Apply suggestions from code review --- .../app/revanced/patches/spotify/misc/fix/SpoofClientPatch.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/src/main/kotlin/app/revanced/patches/spotify/misc/fix/SpoofClientPatch.kt b/patches/src/main/kotlin/app/revanced/patches/spotify/misc/fix/SpoofClientPatch.kt index c46213c24c..e34bcebaa1 100644 --- a/patches/src/main/kotlin/app/revanced/patches/spotify/misc/fix/SpoofClientPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/spotify/misc/fix/SpoofClientPatch.kt @@ -120,7 +120,7 @@ val spoofClientPatch = bytecodePatch( ) } - // Early return the integrity builder to avoid making the integrity API call + // Early return to block sending bad verdicts to the API. standardIntegrityTokenProviderBuilderFingerprint.method.returnEarly() } }