refactor(hide-autoplay-button): no longer hide autoplay preview

This commit is contained in:
inotia00 2023-03-17 17:26:02 +09:00
parent 0faed1e5a2
commit 7cbef4e17c

View File

@ -43,8 +43,8 @@ class HideAutoplayButtonPatch : BytecodePatch(
) { ) {
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 {