mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-05 17:14:35 +02:00
refactor(hide-autoplay-button): no longer hide autoplay preview
This commit is contained in:
parent
0faed1e5a2
commit
7cbef4e17c
@ -38,13 +38,13 @@ import org.jf.dexlib2.iface.reference.MethodReference
|
||||
@Version("0.0.1")
|
||||
class HideAutoplayButtonPatch : BytecodePatch(
|
||||
listOf(
|
||||
LayoutConstructorFingerprint
|
||||
LayoutConstructorFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
// resolve the offsets such as ...
|
||||
val autoNavPreviewStubId = ResourceMappingPatch.resourceMappings.single {
|
||||
it.name == "autonav_preview_stub"
|
||||
val autoNavToggleId = ResourceMappingPatch.resourceMappings.single {
|
||||
it.type == "id" && it.name == "autonav_toggle"
|
||||
}.id
|
||||
|
||||
LayoutConstructorFingerprint.result?.mutableMethod?.let { method ->
|
||||
@ -57,7 +57,7 @@ class HideAutoplayButtonPatch : BytecodePatch(
|
||||
|
||||
// where to insert the branch instructions and ...
|
||||
val insertIndex = this.indexOfFirst {
|
||||
(it as? WideLiteralInstruction)?.wideLiteral == autoNavPreviewStubId
|
||||
(it as? WideLiteralInstruction)?.wideLiteral == autoNavToggleId
|
||||
}
|
||||
// where to branch away
|
||||
val branchIndex = this.subList(insertIndex + 1, this.size - 1).indexOfFirst {
|
||||
|
Loading…
x
Reference in New Issue
Block a user