mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-07 01:54:34 +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")
|
@Version("0.0.1")
|
||||||
class HideAutoplayButtonPatch : BytecodePatch(
|
class HideAutoplayButtonPatch : BytecodePatch(
|
||||||
listOf(
|
listOf(
|
||||||
LayoutConstructorFingerprint
|
LayoutConstructorFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
// resolve the offsets such as ...
|
// resolve the offsets such as ...
|
||||||
val autoNavPreviewStubId = ResourceMappingPatch.resourceMappings.single {
|
val autoNavToggleId = ResourceMappingPatch.resourceMappings.single {
|
||||||
it.name == "autonav_preview_stub"
|
it.type == "id" && it.name == "autonav_toggle"
|
||||||
}.id
|
}.id
|
||||||
|
|
||||||
LayoutConstructorFingerprint.result?.mutableMethod?.let { method ->
|
LayoutConstructorFingerprint.result?.mutableMethod?.let { method ->
|
||||||
@ -57,7 +57,7 @@ class HideAutoplayButtonPatch : BytecodePatch(
|
|||||||
|
|
||||||
// where to insert the branch instructions and ...
|
// where to insert the branch instructions and ...
|
||||||
val insertIndex = this.indexOfFirst {
|
val insertIndex = this.indexOfFirst {
|
||||||
(it as? WideLiteralInstruction)?.wideLiteral == autoNavPreviewStubId
|
(it as? WideLiteralInstruction)?.wideLiteral == autoNavToggleId
|
||||||
}
|
}
|
||||||
// where to branch away
|
// where to branch away
|
||||||
val branchIndex = this.subList(insertIndex + 1, this.size - 1).indexOfFirst {
|
val branchIndex = this.subList(insertIndex + 1, this.size - 1).indexOfFirst {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user