mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-09 02:54:37 +02:00
fix: 'Hide breaking news shelf' setting hides album card header in search results
This commit is contained in:
parent
676ef9b980
commit
2ccafc6b4b
@ -22,8 +22,7 @@ import org.jf.dexlib2.iface.instruction.formats.*
|
||||
class GeneralAdsBytecodePatch : BytecodePatch() {
|
||||
private val resourceIds = arrayOf(
|
||||
"id" to "ad_attribution",
|
||||
"layout" to "horizontal_card_list",
|
||||
"layout" to "album_card"
|
||||
"layout" to "horizontal_card_list"
|
||||
).map { (type, name) ->
|
||||
ResourceMappingPatch
|
||||
.resourceMappings
|
||||
@ -62,18 +61,6 @@ class GeneralAdsBytecodePatch : BytecodePatch() {
|
||||
mutableMethod.implementation!!.injectHideCall(insertIndex, viewRegister, "ads/GeneralAdsPatch", "hideBreakingNewsShelf")
|
||||
patchSuccessArray[1] = true
|
||||
}
|
||||
|
||||
resourceIds[2] -> { // album cards
|
||||
val insertIndex = index + 4
|
||||
val invokeInstruction = instructions.elementAt(insertIndex)
|
||||
if (invokeInstruction.opcode != Opcode.CHECK_CAST) return@forEachIndexed
|
||||
|
||||
val mutableMethod = context.proxy(classDef).mutableClass.findMutableMethodOf(method)
|
||||
|
||||
val viewRegister = (invokeInstruction as Instruction21c).registerA
|
||||
mutableMethod.implementation!!.injectHideCall(insertIndex, viewRegister, "ads/GeneralAdsPatch", "hideAlbumCards")
|
||||
patchSuccessArray[2] = true
|
||||
}
|
||||
}
|
||||
}
|
||||
else -> return@forEachIndexed
|
||||
|
Loading…
x
Reference in New Issue
Block a user