Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version extraction via RegEx seems to not work with sub-folders (on SourceForge) #1352

Closed
DJCrashdummy opened this issue Jan 28, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@DJCrashdummy
Copy link

Prerequisites
i'm not 100% sure, maybe this is very loosely related to #946.
yes, i'v read https://github.com/ImranR98/Obtainium/wiki but found nothing related to either sub-folders or SourceForge (nor an explanation of what the version extraction via RegEx takes into consideration: just the APKs name, a relative link depending on the "source" aka. distributor or the whole URL?).

Describe the bug
either i don't get completely how the version extraction via RegEx works, or it simply does not work with sub-folders (on SourceForge).

To Reproduce

  1. i tried to add https://sourceforge.net/projects/domination/ to Obtainium. (no matter what URL to which sub-folder you paste, that's the URL Obtainium uses.)
  2. if i just go ahead (like it usually works) Obtainium presents a list with all APKs to choose from, which is a pleasant surprise given the fact that the sorting of the APKs in sub-folders is a mess.
  3. after you choose the latest one (version code 93 at the time of writing) - the version code is at least used in the file name - Obtainium correctly displays it afterwards as installed.
  4. but after that the issue begins: Obtainium always displays a new version Domination (which i guess is because the newer of the 2 main folders in the repo is named like that).
  5. than i thought ok, it's time to test the RegEx-function:
    as the allegedly new version is called Domination i thought this would be a good staring point... so my RegEx looks like Domination\/[\d.]+\/Domination[-_]([\d]+)\.apk. in desperation i also tried something like https:\/\/sourceforge\.net\/projects\/domination\/files\/[Dd]omination\/[\d\p{Punct}]+\/[Dd]omination[\p{Punct}]([\d]+)\.apk.+ and countless variations, but it always tells me "Release version can't be determined" (that's my translation).

Please complete the following information:

  • Device: Asus Z00ED
  • OS: Resurrection Remix OS
  • Obtainium Version: 1.0.1

Additional context
either please tell me what i'm doing wrong at the RegEx version extraction; or making it work even with sub-folders (at least at SourceForge) would be awesome.

@DJCrashdummy DJCrashdummy added bug Something isn't working to check Issue has not been reviewed labels Jan 28, 2024
@DJCrashdummy
Copy link
Author

BTW when mentioning the wiki:
at the second bullet of the section App Sources i'm pretty sure the URL at the link version detection is wrong.
-> unfortunately i didn't find a possibility to edit the wiki, else i would have created a pull request.

ImranR98 pushed a commit that referenced this issue Jan 28, 2024
@ImranR98 ImranR98 added TODO Issue to focus on for the next release and removed to check Issue has not been reviewed labels Jan 28, 2024
@ImranR98
Copy link
Owner

This issue isn't about version extraction - I just wasn't aware of the fact that SourceForge can have nested subfolders. The current design assumes the root folder will always contain a bunch of subfolders, where each subfolder name is an app version, and the folder's contents are the APKs for that version. That's the system used by OpenCamera, the example app I used when coding this source.

The next release will have support for subfolders - then you should then be able to add this app in one of 2 ways:

  • Add https://sourceforge.net/projects/domination/files/Domination/ directly
  • Add https://sourceforge.net/projects/domination/, then the version string will include the subfolder, so it would be something like Domination/1.2.8 and you can use "Version Extraction" to trim it down.

Also thanks for the correction, I've updated the Wiki.

ImranR98 added a commit that referenced this issue Jan 28, 2024
Better support for SourceForge (#1352), Remove READ_EXTERNAL_STORAGE again (#1309) + fix typo
@ImranR98
Copy link
Owner

ImranR98 commented Feb 3, 2024

@ImranR98 ImranR98 closed this as completed Feb 3, 2024
@ImranR98 ImranR98 removed the TODO Issue to focus on for the next release label Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants