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:
parent
d3c9dc6ed7
commit
8b9e04475d
2 changed files with 32 additions and 2 deletions
|
|
@ -0,0 +1,5 @@
|
||||||
|
package app.revanced;
|
||||||
|
|
||||||
|
public interface ContextMenuItemPlaceholder {
|
||||||
|
Object getViewModel();
|
||||||
|
}
|
||||||
|
|
@ -42,7 +42,10 @@ internal val contextMenuViewModelClassFingerprint = fingerprint {
|
||||||
strings("ContextMenuViewModel(header=")
|
strings("ContextMenuViewModel(header=")
|
||||||
}
|
}
|
||||||
|
|
||||||
internal val contextMenuViewModelAddItemFingerprint = fingerprint {
|
/**
|
||||||
|
* Used in versions older than "9.0.60.128".
|
||||||
|
*/
|
||||||
|
internal val oldContextMenuViewModelAddItemFingerprint = fingerprint {
|
||||||
parameters("L")
|
parameters("L")
|
||||||
returns("V")
|
returns("V")
|
||||||
custom { method, _ ->
|
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 {
|
internal val getViewModelFingerprint = fingerprint {
|
||||||
custom { method, _ -> method.name == "getViewModel" }
|
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 ->
|
custom { method, classDef ->
|
||||||
classDef.endsWith(className) && method.indexOfFirstInstruction {
|
classDef.endsWith(className) && method.indexOfFirstInstruction {
|
||||||
opcode == Opcode.IGET_OBJECT && getReference<FieldReference>()?.name == "sections_"
|
opcode == Opcode.IGET_OBJECT && getReference<FieldReference>()?.name == "sections_"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue