Skip to content

feat(Instagram): Add Follow back indicator patch#6564

Open
Swakshan wants to merge 2 commits intoReVanced:devfrom
Swakshan:Instagram/followback-indicator
Open

feat(Instagram): Add Follow back indicator patch#6564
Swakshan wants to merge 2 commits intoReVanced:devfrom
Swakshan:Instagram/followback-indicator

Conversation

@Swakshan
Copy link
Contributor

@Swakshan Swakshan commented Feb 6, 2026

This patch aims are bringing a follow back indicator on user profile, which indicates which the viewing profile is following the user or not.

image

I tested it on 414, 415, 416 alphas and the patch was working fine.

@oSumAtrIX oSumAtrIX changed the title feat(Instagram): Added Follow back indicator feat(Instagram): Add Follow back indicator patch Feb 6, 2026
if(loggedInUserId.equals(viewingProfileUserId)) return;

Boolean followed_by = Helper.getFollowbackInfo(viewingProfileUserObject);
String indicatorText = followed_by ? "User follows you" : "User does not follow you";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shorter

Suggested change
String indicatorText = followed_by ? "User follows you" : "User does not follow you";
String indicatorText = followed_by ? "Follows you" : "Does not follow you";

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could even not show anything at all if doesnt follow back

Copy link
Contributor Author

@Swakshan Swakshan Feb 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel its better to have a consistent feedback, rather than showing for some and not showing for others.

index: Int,
value: String,
) {
method.instructions.filter { it.opcode == Opcode.CONST_STRING }[index].let { instruction ->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sequence to avoid unnecessary filtering all instructions

Suggested change
method.instructions.filter { it.opcode == Opcode.CONST_STRING }[index].let { instruction ->
method.instructions.asSequence().filter { it.opcode == Opcode.CONST_STRING }.elementAt(index).let { instruction ->

value: String,
) {
method.instructions.filter { it.opcode == Opcode.CONST_STRING }[index].let { instruction ->
val register = (instruction as BuilderInstruction21c).registerA
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to understand

Suggested change
val register = (instruction as BuilderInstruction21c).registerA
val register = (instruction as OneRegisterInstruction).registerA


// This constant stores the value of the obfuscated profile info class,
// which is later used to find the index of the parameter.
var profileInfoClassName:String
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var profileInfoClassName:String
var profileInfoClassName: String

// This fingerprint is used to identify field name in obfuscated profile info class,
// that holds user data.
bindRowViewTypesFingerprint.method.apply {
val igetObjectInstruction = instructions.first { it.opcode == Opcode.IGET_OBJECT }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try running a format in your IDE theres a couple of formatting issues


invoke-static {v$dummyRegistry1,v$dummyRegistry2, v$internalBadgeRegistry}, ${EXTENSION_CLASS_DESCRIPTOR}FollowBackIndicatorPatch;->indicator($userSessionClassName Ljava/lang/Object;Ljava/lang/Object;)V
goto :revanced
""".trimIndent(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
""".trimIndent(),
""",

val dummyRegistry2 = getInstruction<OneRegisterInstruction>(internalBadgeStringIndex).registerA

// Instruction to which the call needs to transfer after our hook.
val invokeStaticRangeIndex = indexOfFirstInstruction(internalBadgeInstructionIndex, Opcode.INVOKE_STATIC_RANGE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instruction to which the call needs to transfer after our hook.

Whats the reason for this? PLease add in the comment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically Instagram does their check on whether or not developer tag/badge needs to be displayed (which is always false in production and the visibility is set to GONE), which in some builds are done in a seperate method and in some, they do it without a method. So to avoid it, I have added the hook before they do their developer badge check and transfer the flow, avoiding their check, which is this static-range instructions.

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.

2 participants