Skip to content

Conversation

@brosssh
Copy link
Member

@brosssh brosssh commented Nov 18, 2025

Removes the reshare button from both posts and reels.

This was quite the journey inside Instagram code. For some reason, the normal parseFromJson isn't used for media. Instead, a spaghetti-code like implementation of a json parser is used.

TLDR, medias are received in 3 ways:

  • from normal feed/timeline request
  • a stream of reels when scrolling the reels feed
  • from GraphQL queries, when accessing them via user or explore page

For the first 2 cases, the first fingerprint handles them. The 3rd is handled by the 2nd fingerprint. There is probably a single place which can handle all cases, however I wasn't able to find it after multiple hours.

The JSON parser deserialize the JSON object but instead of saving it into a class, it saves the media fields into a public hashmap, where they key of the map if the hashcode of the JSON field (eg enable_media_notes_production (our flag for this patch) is stored with key -545107410 in the map.

The code is a mess, duplicated classes, objects with public fields passed as reference which gets modified, methods unused. Possibly this patch is easier with a patch which modifies the view, removing the button. However I'm not familiar with that type of patches. I added comments, please @LisoUseInAIKyrios improves them, let me know if any of this stuff can be simplified.

Side note, I have no idea why the flag which controls the reshare button visibility is called enable_media_notes_production...

@brosssh
Copy link
Member Author

brosssh commented Nov 18, 2025

I just noticed a bug, no idea why it's doing this...

VID_20251118131406.mp4

@cyberboh
Copy link
Contributor

@brosssh Maybe your account has an A/B test enabled and make this patch incosistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants