RJNY / Obtainium-Emulation-Pack

An Obtainium import file containing an Android emulation pack
The Unlicense
64 stars 3 forks source link

Fix Turnip drivers #3

Closed GlazedBelmont closed 4 months ago

GlazedBelmont commented 4 months ago

Turns out that A32 experimental driver broke the release check, this will ONLY grab R[0-9]+ versions

RJNY commented 4 months ago

my god this diff is a nightmare. I might consider keeping this json beautified and only minify the release file. 🤔

Did my most recent release not already fix this? I can't make out your diff.

GlazedBelmont commented 4 months ago

oh fuck, yeah it edits the turnip regex since it's currently looking for just "turnip" and that A32 release has no version so it keeps failing at checking that. it now checks for "turnip" and "revision"

GlazedBelmont commented 4 months ago

I haven't checked the latest release though so hold on

RJNY commented 4 months ago

Yeah, it's too bad obtainium doesn't support beautified json or that wouldn't be an issue. 😭

I can diff this on my work laptop easily, but won't be able to until tomorrow.

GlazedBelmont commented 4 months ago

Turnip -> Turnip.*Revision.*[0-9]+ image

RJNY commented 4 months ago

When I applied your changes to my personal device, it pulled v24.1.0, but the latest version is v24.2.0 which my current master pulls just fine. What version is your device pulling? This is the latest Turnip AFAIK: https://github.com/K11MCH1/AdrenoToolsDrivers/releases/tag/v24.2.0_a32_patch

And this is what the latest release looks like IMG_8123 IMG_8124

RJNY commented 4 months ago

Just a heads up. I've beautified the json file. From now on, only the release file will be minified.

GlazedBelmont commented 4 months ago

Yeah mine is made to only pull Turnip R0-9 releases so this A32 interim release wouldn't be pulled (R19 though will be pulled when it drops)

RJNY commented 4 months ago

This did the trick v\d+.\d+.\d+.*((R|revision)\d+)? https://regexr.com/80rq9

ianmacd commented 4 months ago

This did the trick v\d+.\d+.\d+.*((R|revision)\d+)? https://regexr.com/80rq9

Note that the part of the expression following .* is superfluous, since .* will always match the rest of the string, whether or not (R|revision)\d+ is present. That's because this latter subexpression is matched 0 or 1 times, so it always matches.

Also, the literal dots are not properly matched in the above expression. Instead, any character is matched.

Taking all of the above into account, you could suffice with just v\d+\.\d+\.\d+\s+.*

RJNY commented 4 months ago

@ianmacd You're absolutely right, good catch! This is also a little smarter than my approach in the sense that if they break convention again, it should pick up the string after the version regardless of how they decide to input it. Thank you!

RJNY commented 4 months ago

@ianmacd looks like I might have jumped to conclusions too quickly. It worked in Regexr, but not in obtainium. I did take what you posted into consideration and tried to update it again. Let me know what you think: Give it a shot in obtainium too. v\d+\.\d+\.\d+.*(\s+)?

I still don't have a good way to test these scenarios. I've considered looking at Obtainiums source code to see how they're hitting GitHub to RegEx these versions. What works today is breaking tomorrow.

edit: simplified it even further: v\d+\.\d+\.\d+.*. Yes it grabs everything after the version, but it's using the tag for version reporting anyway. Thoughts?

RJNY commented 4 months ago

I can't believe I never noticed. It's not matching on the release titles, it's matching on the tags 🤦‍♂️

https://github.com/K11MCH1/AdrenoToolsDrivers/tags?after=v744.4

The reason something like v\d+\.\d+\.\d+ wouldn't work is because Obtainium wouldn't be able to reconsile the difference between v24.1.0_a and v24.1.0_b. It has to match the rest of the string!

Therefore; something like v\d+\.\d+\.\d+.* would absolutely work. Here is a regexr of what I think the test suite should be.

https://regexr.com/80sva

And indeed, Obtainium is picking up the newest version