Skip to content

fix(Strava): Fix Overwrite media upload parameters patch#6491

Draft
xehpuk wants to merge 1 commit intoReVanced:devfrom
xehpuk:fix/strava/overwrite-media-upload-parameters
Draft

fix(Strava): Fix Overwrite media upload parameters patch#6491
xehpuk wants to merge 1 commit intoReVanced:devfrom
xehpuk:fix/strava/overwrite-media-upload-parameters

Conversation

@xehpuk
Copy link
Contributor

@xehpuk xehpuk commented Jan 16, 2026

Using returnEarly and returnLate fails when the patched method should return long or double (or their boxed types) while it has fewer than two registers.

This PR takes this into account by creating a helper method with sufficient registers and calling it from the original method.

A BytecodePatchContext is needed for method creation. To keep it optional (because this isn't needed in most cases), context receivers are replaced by context parameters, since nullable context receivers can't be accessed in extension methods (this is shadowed).

Context parameters are available from Kotlin v2.2 and I have no idea how to update. Hence the draft status.

Info about the feature:

@xehpuk
Copy link
Contributor Author

xehpuk commented Jan 18, 2026

I guess I found the source of the Kotlin version: https://github.com/ReVanced/revanced-patches-gradle-plugin/blob/2597efe/gradle/libs.versions.toml#L2
Can we bump this?

@oSumAtrIX
Copy link
Member

Yes, I am currently in the process of migrating to context parameters with patcher v22. Theres a couple cross dependencies going on here. Once patcher v22 is released the gradle plugin will update to it alongside with context params.

@xehpuk
Copy link
Contributor Author

xehpuk commented Jan 18, 2026

Will the migration happen before the next patches release? If not, this patch needs to be disabled or temporarily fixed via e.g. #6492.

@oSumAtrIX
Copy link
Member

Possibly, will keep in mind.

@oSumAtrIX
Copy link
Member

@xehpuk #6510 (comment) this may also be related to the return helper functions, does this PR fix that?

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