ImranR98 / Obtainium

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

AppGallery URL gets malformed #1570

Closed StSav012 closed 3 months ago

StSav012 commented 4 months ago

Prerequisites Either GitHub search fails or this is a new issue indeed.

Describe the bug

In an AppGallery URL, there may be the cloud part already present. Without the proper check, the app adds the part into the URL. This may result in a malformed URL and the corresponding error:

ClientException with SocketException: Failed host lookup: 'appgallery.cloud.cloud.huawei.com' (OS Error: No address associated with hostname, errno = 7), uri=https://appgallery.cloud.cloud.huawei.com/appdl/C000000000

To Reproduce

  1. Go to the main screen.
  2. Tap on Add App
  3. In the App Source URL field, enter https://appgallery.cloud.huawei.com/appdl/C000000000 (or with a valid app number)
  4. Select Override Source to Huawei AppGallery.
  5. Click the Add button.
  6. See the error message.

Please complete the following information:

Additional context When I enter the URL I can get from the browser (like https://appgallery.huawei.com/#/app/C000000000), the app complains that the URL is invalid. The trick is to replace the /#/app/ part with /appdl/. This is not trivial. Please consider the fix for that, too.

ImranR98 commented 3 months ago

https://github.com/ImranR98/Obtainium/releases/tag/v1.1.7