revanced-patcher icon indicating copy to clipboard operation
revanced-patcher copied to clipboard

feat: allow defining of version ranges

Open TheJeterLP opened this issue 1 year ago • 4 comments

🐞 Issue

Currently we provide versions by a List containing strings, and the Patcher uses those. So for every new version we have to add another string to the list. We should find a way to be able to create a version range (for ex. 17.24.35-17.29.36). This will cleanup the source of Patches by a lot and makes it easier to maintain.

❗ Solution

Get version string, replace "." With nothing, so the version will look like 172435 and convert that to an int. Then we can check if the provided APK is in the specific version range.

❓ Motivation

Cleanup of code, not having to list every minor version for compatibility

TheJeterLP avatar Jul 17 '22 15:07 TheJeterLP

Is the solution proposal fail safe? Something like 1.2.3 would fail against 1.12.34

oSumAtrIX avatar Jul 17 '22 15:07 oSumAtrIX

I'd suggest using the version parser from the patches (https://github.com/revanced/revanced-patches/blob/main/src/main/kotlin/app/revanced/meta/readme/SemanticVersion.kt) to compare them

j4k0xb avatar Jul 17 '22 16:07 j4k0xb

Is the solution proposal fail safe? Something like 1.2.3 would fail against 1.12.34

With YouTubes current versioning system it is. If they change that, of course it won't be any longer.

TheJeterLP avatar Jul 17 '22 16:07 TheJeterLP

I'd suggest using the version parser from the patches (https://github.com/revanced/revanced-patches/blob/main/src/main/kotlin/app/revanced/meta/readme/SemanticVersion.kt) to compare them

If that works, no problem yes.

TheJeterLP avatar Jul 17 '22 16:07 TheJeterLP