ImranR98 / Obtainium

Get Android app updates straight from the source.
https://obtainium.imranr.dev
GNU General Public License v3.0
6.15k stars 144 forks source link

Regex for version detection #707

Open kabigonfanb01 opened 1 year ago

kabigonfanb01 commented 1 year ago

The version detection seems to use the release tag however for some github forks projects where apks are compiled automatically there may be different apks with different versions that dont correspond to the release tag. It would be a good to have the ability to use regex on the filename if possible and use that to determine if the version has changed.

ImranR98 commented 1 year ago

Some releases have multiple APKs (and others have none). Both of these cases are currently supported but would be problematic if we want to use the file name as a "version"/ Adding a feature to use file names as versions would also require adding extra logic to work with existing features (track-only, APK filter, etc.). Leaving the issue open but it's not likely to be added unless someone makes a PR.

Could you also post a link to a repo like this? Maybe there's another way to do it aside from file names. Obtainium already has a "use release date as version" option but I don't know if that will work for your case.

kabigonfanb01 commented 12 months ago

Heres a project where tag doesnt match installed version https://github.com/Vita3K/Vita3K-Android/releases . Only way I can use this app now is just as a notification with no version detection. I have xiaomi phone as well and obtanium doesnt work with install as per issue 661 where I have posted screen recording so this is very unfortunate.

IlIllIl commented 9 months ago

Regex cannot match the specific release of apk with the filter of release title wireguard-plugin.

Btw, it may be useful for advanced users to customize the version regex instead of the default one.

Sanzium commented 7 months ago

Maybe implementing the Version Extraction ReGex like in the html sources would do the trick. But I believe that it would need to be able to apply the RegEx for the release notes (just like there already is an option to "Filter Release Notes by Regular Expression" for GitHub). Another example is Kiwi Browser ( https://github.com/kiwibrowser/src.next ), which displays the release version in the release notes, matching the one which is shown by Android.

Araxeus commented 7 months ago

Version regex from release notes should be easier to implement than from release assets

But even regex from release assets could just treat the assets as a string list and return the first result found

I'm personally struggling with version detection on packages installed from https://github.com/j-hc/revanced-magisk-module

brezelman commented 2 months ago

I noticed the same problem with the nightly repo of LinkSheet: https://github.com/LinkSheet/nightly/releases. The app version is "master-<last-commit>-nightly". I could extract that from the asset/apk link, but not from the version.

PinkSerenity commented 1 month ago

One possible implementation would be that Obtanium checks every new release entry, selects the apk that matches the Regex filter and only then compares the version. That would require Obtanium to keep track of release dates in addition to the general version matching if that option is selected. But since the support for that is already there (I think), it might be possible.