Skip to content

perf(Instagram - Customise story ring size): Clarify standard size in the setting#1265

Merged
swakwork merged 3 commits into
crimera:devfrom
kitadai31:story-ring-size-clarify-normal-size
Jun 8, 2026
Merged

perf(Instagram - Customise story ring size): Clarify standard size in the setting#1265
swakwork merged 3 commits into
crimera:devfrom
kitadai31:story-ring-size-clarify-normal-size

Conversation

@kitadai31

Copy link
Copy Markdown
Contributor

After the default settings value for this patch has been changed to 70, some users didn't know how to revert to the stock Instagram size, so I added the original value and instructions on how to set it in the settings screen.

Also, I removed the unnecessary ".0f" from the default value.
Since neither "." nor "f" can be entered in this setting, the ".0f" was meaningless.
I could allow decimal point input, but nobody would want to set the size down to the decimal point.

Furthermore, I changed Float.valueOf() to Float.parseFloat() because the IDE warned that the former was useless because it returns a non-primitive Float object.
I confirmed parseFloat() can parse "70.0f" and the size changes correctly.


p.s. This is the first time I've seen the code for the Instagram patches (Kotlin side).
I noticed that you're not using instructionMatches at all.
Do you know Morphe's instructionMatches feature?
This allows each element of the instruction filter of the fingerprint to be used later within a patch.

To demonstrate a practical use case for it, I've refactored this patch using instructionMatches.
Before the introduction of instruction filters, it was necessary to match a specific literal value (in this case, 100.0f) using a custom fingerprint and then use indexOfFirstLiteralInstruction within the patch to search for that literal again.
But now, if you specify an instruction in the filter, you can directly access the filter's matched instructions within the patch.
Therefore, you can write the patch more concisely.
It's no longer needed to extract the literal 100.0f as a constant.

Another example is my ImportExportLoginTokenPatch.kt.
Here, I used it.instructionMatches.last().index to add an instruction immediately after the move-result-object of the layout inflator calling and receive that result.

Instruction filters are one of Morphe's most distinctive features compared to the old Patcher.
It was also the direct cause of the split between ReVanced and Morphe.
This makes my experience writing patches in Morphe enjoyable.
I assume you will continue to develop new patches for Instagram, you can incorporate this new feature when you create a new patch.

For more details, please see here. (There is a point to note when adding instructions for multiple matches)
https://github.com/MorpheApp/morphe-patcher/blob/main/docs/2_2_1_fingerprinting.md

I just wanted to let you know in case you didn't know it yet.

@swakwork

swakwork commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

Ya I never tried instructionMatches in the past, so sticked to basics. Will learn about it and start using it in the future ones 👍

public static String UNLOCK_PLUS_BENEFITS = "Unlock Plus benefits";
public static String UNLOCK_PLUS_BENEFITS_DESC = "Unlock 'Plus' subscription benefits that are checked locally. USE IT AT YOUR OWN RISK";
public static String CUSTOMISE_STORY_RING_SIZE = "Customise story ring size";
public static String CUSTOMISE_STORY_RING_SIZE_DESC = "Enter the percentage of story ring size. 100 is the standard and maximum size.";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

100 is the default one but isn't the maximum size per say. I tried increasing it to 200 and it did work and the app didn't crash.
You can probably change it to just standard size

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Really? Values above 100 do not work on my end. Whether it's 120 or 200, the size is the same as 100.

However, if it works on your end, this might be an A/B test or something. I can remove "maximum" from the description.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Based on DPI or something ig. On my tab, it reflects aka increases to 200+ but on my phone 100 is the max.

@kitadai31

Copy link
Copy Markdown
Contributor Author

Please don't merge for now
I came up with a better strings
will update tomorrow

@kitadai31 kitadai31 marked this pull request as draft June 7, 2026 18:22
@kitadai31 kitadai31 marked this pull request as ready for review June 8, 2026 06:35
@swakwork

swakwork commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Ready ?

@swakwork swakwork merged commit d30a32e into crimera:dev Jun 8, 2026
1 check passed
github-actions Bot pushed a commit that referenced this pull request Jun 8, 2026
## [3.5.0-dev.6](v3.5.0-dev.5...v3.5.0-dev.6) (2026-06-08)

### 🐛 Bug Fixes

* **Instagram:** Check if `More options on profile` is patched before adding the button ([a8cfbab](a8cfbab))

### ✨ New Features

* **Instagram:** Added `Save media comment` patch ([b756d4b](b756d4b))
* **Instagram:** Added image variants download option ([5aca4b4](5aca4b4))

### 🔧 Improvements

* **Instagram:**  Customise story ring size - Clarify standard size in the setting ([#1265](#1265)) ([d30a32e](d30a32e))
* **Instagram:** Added alternative logic for video variants ([45bf91f](45bf91f))
* **Instagram:** Added Debug option for comments & improved comment button loading ([2c827ed](2c827ed))
* **Twitter:** Make unofficial instance links optional for deeplinks ([6dea26b](6dea26b))
@kitadai31 kitadai31 deleted the story-ring-size-clarify-normal-size branch June 9, 2026 04:33
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