diff --git a/extensions/spotify/stub/src/main/java/com/spotify/browsita/v1/resolved/Section.java b/extensions/spotify/stub/src/main/java/com/spotify/browsita/v1/resolved/Section.java new file mode 100644 index 000000000..af3fd9aa3 --- /dev/null +++ b/extensions/spotify/stub/src/main/java/com/spotify/browsita/v1/resolved/Section.java @@ -0,0 +1,6 @@ +package com.spotify.browsita.v1.resolved; + +public final class Section { + public static final int BRAND_ADS_FIELD_NUMBER = 6; + public int sectionTypeCase_; +} diff --git a/patches/src/main/kotlin/app/revanced/patches/spotify/misc/Fingerprints.kt b/patches/src/main/kotlin/app/revanced/patches/spotify/misc/Fingerprints.kt index a797763a0..3ac589fc8 100644 --- a/patches/src/main/kotlin/app/revanced/patches/spotify/misc/Fingerprints.kt +++ b/patches/src/main/kotlin/app/revanced/patches/spotify/misc/Fingerprints.kt @@ -93,18 +93,28 @@ internal val abstractProtobufListEnsureIsMutableFingerprint = fingerprint { } } -internal val homeSectionFingerprint = fingerprint { - custom { _, classDef -> classDef.endsWith("homeapi/proto/Section;") } -} - -internal val homeStructureGetSectionsFingerprint = fingerprint { +private fun structureGetSectionsFingerprint(className: String) = fingerprint { custom { method, classDef -> - classDef.endsWith("homeapi/proto/HomeStructure;") && method.indexOfFirstInstruction { + classDef.endsWith(className) && method.indexOfFirstInstruction { opcode == Opcode.IGET_OBJECT && getReference()?.name == "sections_" } >= 0 } } +internal val homeSectionFingerprint = fingerprint { + custom { _, classDef -> classDef.endsWith("homeapi/proto/Section;") } +} + +internal val homeStructureGetSectionsFingerprint = + structureGetSectionsFingerprint("homeapi/proto/HomeStructure;") + +internal val browseSectionFingerprint = fingerprint { + custom { _, classDef -> classDef.endsWith("browsita/v1/resolved/Section;") } +} + +internal val browseStructureGetSectionsFingerprint = + structureGetSectionsFingerprint("browsita/v1/resolved/BrowseStructure;") + internal fun reactivexFunctionApplyWithClassInitFingerprint(className: String) = fingerprint { returns("Ljava/lang/Object;") parameters("Ljava/lang/Object;")