Skip to content

Commit 92b588c

Browse files
authored
feat(Spotify): Remove ads section from browse (#5193)
1 parent da20e56 commit 92b588c

File tree

2 files changed

+22
-6
lines changed
  • extensions/spotify/stub/src/main/java/com/spotify/browsita/v1/resolved
  • patches/src/main/kotlin/app/revanced/patches/spotify/misc

2 files changed

+22
-6
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package com.spotify.browsita.v1.resolved;
2+
3+
public final class Section {
4+
public static final int BRAND_ADS_FIELD_NUMBER = 6;
5+
public int sectionTypeCase_;
6+
}

patches/src/main/kotlin/app/revanced/patches/spotify/misc/Fingerprints.kt

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,18 +93,28 @@ internal val abstractProtobufListEnsureIsMutableFingerprint = fingerprint {
9393
}
9494
}
9595

96-
internal val homeSectionFingerprint = fingerprint {
97-
custom { _, classDef -> classDef.endsWith("homeapi/proto/Section;") }
98-
}
99-
100-
internal val homeStructureGetSectionsFingerprint = fingerprint {
96+
private fun structureGetSectionsFingerprint(className: String) = fingerprint {
10197
custom { method, classDef ->
102-
classDef.endsWith("homeapi/proto/HomeStructure;") && method.indexOfFirstInstruction {
98+
classDef.endsWith(className) && method.indexOfFirstInstruction {
10399
opcode == Opcode.IGET_OBJECT && getReference<FieldReference>()?.name == "sections_"
104100
} >= 0
105101
}
106102
}
107103

104+
internal val homeSectionFingerprint = fingerprint {
105+
custom { _, classDef -> classDef.endsWith("homeapi/proto/Section;") }
106+
}
107+
108+
internal val homeStructureGetSectionsFingerprint =
109+
structureGetSectionsFingerprint("homeapi/proto/HomeStructure;")
110+
111+
internal val browseSectionFingerprint = fingerprint {
112+
custom { _, classDef -> classDef.endsWith("browsita/v1/resolved/Section;") }
113+
}
114+
115+
internal val browseStructureGetSectionsFingerprint =
116+
structureGetSectionsFingerprint("browsita/v1/resolved/BrowseStructure;")
117+
108118
internal fun reactivexFunctionApplyWithClassInitFingerprint(className: String) = fingerprint {
109119
returns("Ljava/lang/Object;")
110120
parameters("Ljava/lang/Object;")

0 commit comments

Comments
 (0)