fix(instagram): pass current carousel index to reel overflow buttons - #1586
Merged
Conversation
swakwork
reviewed
Jul 26, 2026
swakwork
reviewed
Jul 26, 2026
Contributor
Author
|
Addressed — removed the unused 2-parameter constructors from all button subclasses (DownloadButton, ExternalDownloadButton, InfoButton, DebugButton) and from the base ReelButton class. Force pushed. its good to go |
When a reel post contains multiple images, all overflow buttons (download, external downloader, info) always operated on slide 1 (index hardcoded to 0), regardless of which slide the user was viewing. The hook now reads CURRENT_MEDIA_FIELD from MEDIA_ADD_INFO_CLASS_NAME on the controller class using the same safe register pattern as the feed onClick hook (HookOverflowMenuButtonOnClickPatch): iget-object freeReg, self, mediaExtraDataField <- read obj (self intact) iget freeReg, freeReg, CURRENT_MEDIA_FIELD <- read int index iget-object self, self, appActivityField <- clobber self LAST Falls back to index 0 via 3-arg overload if mediaExtraDataField is not found on the controller class. Note: The consent popup fix (crimera#1574, crimera#1563) is handled by PR crimera#1585 which adds a dedicated 'Disable onboarding permission prompts' patch. Closes crimera#1562
Contributor
Author
|
Addressed all three comments:
Force pushed. |
Collaborator
|
Just noticed MEDIA_ADD_INFO_CLASS_NAME isn't present in the Add Reels Button class |
github-actions Bot
pushed a commit
to kuntal-devrat/piko
that referenced
this pull request
Jul 26, 2026
## [3.9.0-dev.1](v3.8.0...v3.9.0-dev.1) (2026-07-26) ### 🐛 Bug Fixes * **instagram:** fix comments loading indefinitely after scrolling ([a62fe8f](a62fe8f)), closes [crimera#1551](https://github.com/Flaxmbot/piko/issues/1551) * **instagram:** pass current carousel index to reel overflow buttons ([crimera#1586](https://github.com/Flaxmbot/piko/issues/1586)) ([a80bf4a](a80bf4a)) * **Twitter:** Fix `More information on profile` fingerprint on 12.11 ([3b5c945](3b5c945)) ### ✨ New Features * **Instagram:** New patch to block onboarding permission prompts ([9b6e569](9b6e569))
github-actions Bot
pushed a commit
to kuntal-devrat/piko
that referenced
this pull request
Jul 26, 2026
## [3.9.0-dev.1](v3.8.0...v3.9.0-dev.1) (2026-07-26) ### 🐛 Bug Fixes * **instagram:** fix comments loading indefinitely after scrolling ([05cdc19](05cdc19)), closes [crimera#1551](https://github.com/Flaxmbot/piko/issues/1551) * **instagram:** pass current carousel index to reel overflow buttons ([crimera#1586](https://github.com/Flaxmbot/piko/issues/1586)) ([a80bf4a](a80bf4a)) * **Twitter:** Fix `More information on profile` fingerprint on 12.11 ([3b5c945](3b5c945)) ### ✨ New Features * **Instagram:** New patch to block onboarding permission prompts ([9b6e569](9b6e569))
Contributor
Author
My bad 😔 and I saw that you fixed that. I will be more careful from now on 😅 Actually I'm new into this....so please |
github-actions Bot
pushed a commit
that referenced
this pull request
Jul 26, 2026
## [3.9.0-dev.1](v3.8.0...v3.9.0-dev.1) (2026-07-26) ### 🐛 Bug Fixes * **Instagram:** Fix reels current media logic ([40836e8](40836e8)) * **Instagram:** Fix register issue while hooking reel overflow menu ([83786a8](83786a8)) * **instagram:** pass current carousel index to reel overflow buttons ([#1586](#1586)) ([a80bf4a](a80bf4a)) * **Twitter:** Fix `More information on profile` fingerprint on 12.11 ([3b5c945](3b5c945)) ### ✨ New Features * **Instagram:** New patch to block onboarding permission prompts ([9b6e569](9b6e569)) ### 🚀 Updated App Support * **Instagram:** Add support for `439.0.0.37.89` ([3e38d22](3e38d22)) * **Twitter:** Add support for `12.11.0-release.0` ([cdca6a8](cdca6a8))
github-actions Bot
pushed a commit
to kuntal-devrat/piko
that referenced
this pull request
Jul 27, 2026
## [3.9.0-dev.1](v3.8.0...v3.9.0-dev.1) (2026-07-27) ### 🐛 Bug Fixes * **instagram:** fix comments loading indefinitely after scrolling ([5551851](5551851)), closes [crimera#1551](https://github.com/Flaxmbot/piko/issues/1551) * **Instagram:** Fix reels current media logic ([40836e8](40836e8)) * **Instagram:** Fix register issue while hooking reel overflow menu ([83786a8](83786a8)) * **instagram:** pass current carousel index to reel overflow buttons ([crimera#1586](https://github.com/Flaxmbot/piko/issues/1586)) ([a80bf4a](a80bf4a)) * **instagram:** prevent register corruption in commentButtonClickCheckPatch ([b419b19](b419b19)) * **Twitter:** Fix `More information on profile` fingerprint on 12.11 ([3b5c945](3b5c945)) ### ✨ New Features * **Instagram:** New patch to block onboarding permission prompts ([9b6e569](9b6e569)) ### 🚀 Updated App Support * **Instagram:** Add support for `439.0.0.37.89` ([3e38d22](3e38d22)) * **Twitter:** Add support for `12.11.0-release.0` ([cdca6a8](cdca6a8))
github-actions Bot
pushed a commit
to kuntal-devrat/piko
that referenced
this pull request
Jul 27, 2026
## [3.9.0-dev.1](v3.8.0...v3.9.0-dev.1) (2026-07-27) ### 🐛 Bug Fixes * **instagram:** fix comments loading indefinitely after scrolling ([5551851](5551851)), closes [crimera#1551](https://github.com/Flaxmbot/piko/issues/1551) * **Instagram:** Fix reels current media logic ([40836e8](40836e8)) * **Instagram:** Fix register issue while hooking reel overflow menu ([83786a8](83786a8)) * **instagram:** pass current carousel index to reel overflow buttons ([crimera#1586](https://github.com/Flaxmbot/piko/issues/1586)) ([a80bf4a](a80bf4a)) * **instagram:** prevent register corruption in commentButtonClickCheckPatch ([b419b19](b419b19)) * **Twitter:** Fix `More information on profile` fingerprint on 12.11 ([3b5c945](3b5c945)) ### ✨ New Features * **Instagram:** New patch to block onboarding permission prompts ([9b6e569](9b6e569)) ### 🚀 Updated App Support * **Instagram:** Add support for `439.0.0.37.89` ([3e38d22](3e38d22)) * **Twitter:** Add support for `12.11.0-release.0` ([cdca6a8](cdca6a8))
github-actions Bot
pushed a commit
to kuntal-devrat/piko
that referenced
this pull request
Jul 27, 2026
## [3.9.0-dev.1](v3.8.0...v3.9.0-dev.1) (2026-07-27) ### 🐛 Bug Fixes * **instagram:** fix comments loading indefinitely after scrolling ([5551851](5551851)), closes [crimera#1551](https://github.com/Flaxmbot/piko/issues/1551) * **Instagram:** Fix reels current media logic ([40836e8](40836e8)) * **Instagram:** Fix register issue while hooking reel overflow menu ([83786a8](83786a8)) * **instagram:** pass current carousel index to reel overflow buttons ([crimera#1586](https://github.com/Flaxmbot/piko/issues/1586)) ([a80bf4a](a80bf4a)) * **instagram:** prevent register corruption in commentButtonClickCheckPatch ([b419b19](b419b19)) * **Twitter:** Fix `More information on profile` fingerprint on 12.11 ([3b5c945](3b5c945)) ### ✨ New Features * **Instagram:** New patch to block onboarding permission prompts ([9b6e569](9b6e569)) ### 🚀 Updated App Support * **Instagram:** Add support for `439.0.0.37.89` ([3e38d22](3e38d22)) * **Twitter:** Add support for `12.11.0-release.0` ([cdca6a8](cdca6a8))
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a reel post contains multiple images (carousel/slideshow), tapping the download button or any other overflow menu button (external downloader, more options) always operated on slide 1, regardless of which slide the user was currently viewing. The index was hardcoded to
0in allReelButtonsubclasses.Root Cause
The reel overflow button hook (
ClipsOrganicMediaItemViewMoreOptionsController) did not pass the current carousel position to the extension. No index was read from the controller at hook time.Fix
The hook now reads
CURRENT_MEDIA_FIELDfromMEDIA_ADD_INFO_CLASS_NAMEon the controller class — the same field and pattern already used by the feed onClick hook (HookOverflowMenuButtonOnClickPatch).A safe three-instruction register sequence is used to avoid clobbering live registers (which caused a previous crash):
Falls back to index
0via a 3-arg overload ifmediaExtraDataFieldis not found on the controller class.hookReelOverflowMenuButtonnow depends ondecoderEntityto ensureCURRENT_MEDIA_FIELDandMEDIA_ADD_INFO_CLASS_NAMEare resolved before the hook runs.Testing
Confirmed on a real device — downloading from slide 3 of a carousel reel correctly downloads slide 3. Single-video reels and the reel overflow bottom sheet are unaffected.
Note
The consent popup fix (#1574, #1563) is handled separately in PR #1585 which introduces a dedicated
Disable onboarding permission promptspatch.Closes #1562