mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-11 13:46:17 +00:00
fix(Spotify - Unlock Premium): Fix hiding context menu ads on newest versions (#5318)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
package app.revanced;
|
||||
|
||||
public interface ContextMenuItemPlaceholder {
|
||||
Object getViewModel();
|
||||
}
|
||||
@@ -42,7 +42,10 @@ internal val contextMenuViewModelClassFingerprint = fingerprint {
|
||||
strings("ContextMenuViewModel(header=")
|
||||
}
|
||||
|
||||
internal val contextMenuViewModelAddItemFingerprint = fingerprint {
|
||||
/**
|
||||
* Used in versions older than "9.0.60.128".
|
||||
*/
|
||||
internal val oldContextMenuViewModelAddItemFingerprint = fingerprint {
|
||||
parameters("L")
|
||||
returns("V")
|
||||
custom { method, _ ->
|
||||
@@ -52,6 +55,28 @@ internal val contextMenuViewModelAddItemFingerprint = fingerprint {
|
||||
}
|
||||
}
|
||||
|
||||
internal val contextMenuViewModelConstructorFingerprint = fingerprint {
|
||||
accessFlags(AccessFlags.PUBLIC, AccessFlags.CONSTRUCTOR)
|
||||
parameters("L", "Z", "Ljava/util/List;")
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to find the interface name of a context menu item.
|
||||
*/
|
||||
internal val browsePodcastsContextMenuItemClassFingerprint = fingerprint {
|
||||
strings("browse_podcast_item", "ui_navigate")
|
||||
}
|
||||
|
||||
internal const val CONTEXT_MENU_ITEM_PLACEHOLDER_CLASS_NAME = "Lapp/revanced/ContextMenuItemPlaceholder;"
|
||||
internal val extensionFilterContextMenuItemsFingerprint = fingerprint {
|
||||
accessFlags(AccessFlags.PUBLIC, AccessFlags.STATIC)
|
||||
returns("Ljava/util/List;")
|
||||
parameters("Ljava/util/List;")
|
||||
custom { method, classDef ->
|
||||
method.name == "filterContextMenuItems" && classDef.type == EXTENSION_CLASS_DESCRIPTOR
|
||||
}
|
||||
}
|
||||
|
||||
internal val getViewModelFingerprint = fingerprint {
|
||||
custom { method, _ -> method.name == "getViewModel" }
|
||||
}
|
||||
@@ -93,7 +118,7 @@ internal val abstractProtobufListEnsureIsMutableFingerprint = fingerprint {
|
||||
}
|
||||
}
|
||||
|
||||
private fun structureGetSectionsFingerprint(className: String) = fingerprint {
|
||||
internal fun structureGetSectionsFingerprint(className: String) = fingerprint {
|
||||
custom { method, classDef ->
|
||||
classDef.endsWith(className) && method.indexOfFirstInstruction {
|
||||
opcode == Opcode.IGET_OBJECT && getReference<FieldReference>()?.name == "sections_"
|
||||
|
||||
Reference in New Issue
Block a user